Folder on cluster: /labs/evolution/projects/Lmelissa_host_adaptation/dpca
Files in the folder:
g_* genotype files used for the analysis
lda_*.jpg bar plots from dapc
pca_* scatter plots from dapc
The software is installed on my computer so first I mount the computer cluster to my computer and copied the g_VCP.txt etc files from the dpca folder on the cluster to ADEGENET folder in Documents in my computer.
#Reading in the files in R
vcp<-matrix(scan("g_VCP.txt",n=184287*20,sep=","),nrow=20,ncol=184287,byrow=T)
#Using adegenet
library(adegenet)
#giving row and column names to the matrix
dimnames(vcp)<-list(rownames(vcp,do.NULL=FALSE,prefix = "ind"), colnames(vcp,do.NULL=FALSE,prefix = "loc"))
ghat<-as.matrix(temp)
> ghat<-round(ghat,0)
> ghat[ghat==0]<-"11"
> ghat[ghat==1]<-"12"
> ghat[ghat==2]<-"22"
> obj <- df2genind(ghat, ploidy=2,sep="")
pops<-c(rep("A",20),rep("B",18))
popdf1<-as.matrix(wal_gvl)
> popdf1<-round(popdf1,0)
> popdf1[popdf1==0]<-"11"
> popdf1[popdf1==1]<-"12"
> popdf1[popdf1==2]<-"22"
> popcomb1<-df2genind(popdf1,ploidy=2,sep="")
> popid1<-c(rep("wal",20),rep("gvl",18))
> dapc1<-dapc(popcomb1,popid1)
>scatter(dapc3)