Mira
PCA analysis: how to output values of PC# versus residue# in text format (apart from the plots)?
Comments (4)
-
-
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).
-
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)
-
reporter Thanks so much for the fast response! It is working!
- Log in to comment
Can you describe in more detail what you want to output?