how to save dataset of PCA

Issue #514 resolved
Former user created an issue

Hi,

I found the bio3d package very useful. Because I'm new to R, I'm more used to use Matlab to do the further data processing. I was wondering how to extract/save dataset generated by the command pc <- pca.xyz(xyz[,ca.inds$xyz])?

Also, for the command: plot(pc, col = grps), is grps following the same index order as that in each trajectory?

Thank you very much Xingyu

Comments (4)

  1. Xingyu Account Deactivated

    I raised the question. Also, just to clarify, I want to save the dataset for all the PCs. And want to know if grps records the index of the original trajectory. I really want to use the PCs calculated by you and perfom data processing by myself. (I'll for sure to cite bio3d properly). So I was wondering how can I get all the PCs to draw a PC projection figure like this.image2.png Thank you very much.

  2. Xinqiu Yao

    Hi,

    If you just want to reproduce the PC1-PC2 plot, save pc$z[, 1:2] as a plain text file and load it in matlab for further processing. For example, write.table(pc$z[, 1:2], file='pc.txt', row.names=FALSE, col.names=FALSE) .

    If you got the grp from a clustering analysis of the PC1-PC2 projection data, then yes the order of grp is exactly the same as the trajectory. You can save it also, by write.table(grp, file='grp.txt', row.names=FALSE, col.names=FALSE).

    Let me know if you have any further questions.

  3. Log in to comment