Mira

Issue #905 new
Mirfath Mesbahuddin created an issue

PCA analysis: how to output values of PC# versus residue# in text format (apart from the plots)?

Comments (4)

  1. Mirfath Mesbahuddin reporter

    Hi Xinqiu, this following command “plot.bio3d(pc$au[,1], ylab="PC1", xlab="Residue Position", typ="l")” gives a graph of PC1 (y-axis) versus residue number (x-axis). Apart from the graph plot, I want the values as well (PC1 versus residue number, as well as the other PC# values at corresponding residue numbers).

  2. Xinqiu Yao

    Hi,

    You can write it out using the write.table() command:

    write.table(pc$au[, 1], file="pc1_loading.txt", row.names=FALSE, col.names=FALSE)

    In the output file, each row will correspond to the residue number (assuming starting from 1 and continuous). You may then use other software tools to analyze/plot.

    To output along with specific residue numbers, try:

    resno <- pdb$atom$resno[pdb$calpha] # assume you use all C-alpha to do the PCA
    out <- cbind(resno, pc$au[, 1])
    write.table(out, file='pc1_loading.txt", row.names=FALSE, col.names=FALSE)
    

  3. Log in to comment