I am trying to replicate the Principal Component Analysis (PCA) method for a set of proteins using Bio3D in R to examine the relationship between different structures based on their equivalent residues. This is the link to the documentation of PCA in the Bio3D package - http://thegrantlab.org/bio3d_v2/tutorials/principal-component-analysis#:~:text=different%20analysis%20methods%3F-,Principal%20Component%20Analysis%20(PCA),-Following%20core%20identification When I run the final plotting step
plot(pc.xray, col=annotation[, "color"])
I face the following issue:
Error in annotation[, "color"] :
object of type 'closure' is not subsettable
I can see the annotation function is of type of closure and cannot be used in R-4.2.0 (The version of R I'm using). I wanted to know, if there is some alternative to this function. Basically, I want to visualise different groups of points in different colours in the PCA plot as they have done in this figure (Red and green).
It looks like in the example they don't actually create the
annotationobject. They do have:
which produces the correct data structure (matrix). You could use this with something like
but i can't tell from that page what they are coloring.