This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Draw a pca diagram of plink data in R

Hi, I got the following error with this command code

PCA<-read.table("plink.eigenvec") attach(PCA) PCA head(PCA) plot(PCA[1:4]) dim(PCA) colnames(PCA)<-c("FID","IID","EV1","EV2") head(PCA) tab1<-data.frame(breeds=PCA$FID,PC1=PCA$EV1,PC2=PCA$EV2,stringsFactors=FALSE) head(tab1)

: col <-c("breed1"="red" ,"breed2"="yellow" ,"breed3"="green" ,"breed4"="orange" ,"breed5"="brown" ,"breed6"="pink" ,"breed7"="maroon" ,"breed8"="cyan" ,"breed9"="firebreck1" ,"breed10"="blue" ,"breed11"="bisque" ,"breed12"="chartreuse4")

tab1 %>% mutate(group=substr(breeds,1,3)) %>% ggplot(.,aes(x=PC1,y=PC2)) + + geom_point (aes(colour=breeds))+scale_color_manual(values=col)

Error: Insufficient values in manual scale. 121 needed but only 12 provided.

plink pca r

Hello mohsen!

Questions similar to yours can already be found at:

We have closed your question to allow us to keep similar content in the same thread.

If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.

Cheers!

PS: Do not open multipl posts for the same question - follow up on your existin question instead.

0 answers

No answers yet.

Log in to answer this question.