write PC1 data into csv format prior to export and analysed by external software

Issue #708 new
Former user created an issue

Hi,

I have calculated PCA for a system. I even found residues contribution to PC1. i want to export the value/data of PC1 with residue number into CSV. This will be helpful for comparative analysis of multiple PC1 from multiple trajectories of same protein.

Comments (1)

  1. Xinqiu Yao

    The PC loading along with a PDB object might be what you were seeking for. You can create a “data.frame” with one column the residue number and the other column the residue wise loading. For example,

    ## Haven't tested but just to show the idea.
    ## May need to adjust a bit. 
    dat <- data.frame(res=pdb$atom$resno[pdb$calpha], pc=pca$au[, 1])
    write.csv(dat, file="pc1_loading.csv")
    

  2. Log in to comment