SNPRelate; Plot looking blank
I am doing PCA analysis through SNPRelate. Its Generating the PCA plot but completely blank without any error. What to do?
Other question is that how can I add population information in my .gds file as I am working on a plant species. SNPRelate tutorial example file is working very smoothly but I its not user friendly for others.
• 3,905 views
•
link
1 answer
Hi, Although this is an older post but if someone is looking for the answer, here I found one on add column to dataframe r- https://www.hdfstutorial.com/blog/add-column-to-dataframe-r/ Using this you will be able to add a new column at the place you want.
• 0 views
•
link
Log in to answer this question.
Can you post the piece of code that you are using ?
Note: Results are generated from .gds file
One possibility could be the eigenvectors EV1 or EV2 contains NaN as values. You can check the actual value by just typing pca$eigenvect[,1] or pca$eigenvect[,2]
but values are there in file as you look at my previous comment
Then the problem is with the
col=as.integer(tab$pop)as I could not see any column pop in the tab data structure.How can I add this column in my data, because in SNPRelate documentation, it is not written.
SNPrelate is an R package. To add the column you just have to add a column to a data.frame. There are several websites explaining this, e.g. this one might help you: https://stackoverflow.com/questions/10150579/adding-a-column-to-a-data-frame