Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Population Differentiation for Sequence Data" Vignette #81

Open
mmlopezu opened this issue Dec 6, 2015 · 3 comments
Open

"Population Differentiation for Sequence Data" Vignette #81

mmlopezu opened this issue Dec 6, 2015 · 3 comments

Comments

@mmlopezu
Copy link

mmlopezu commented Dec 6, 2015

@hlapp @zkamvar

I am having problems with the AMOVA analysis of sequence data.

FIRST APPROACH USING hierfstat:
Problem: when trying to convert a genind object to hierfstat, it gives me the following error:

"Error in genind2hierfstat(allData3) : 
  alleles must be encoded as integers or nucleotides. Exiting"

The object allData3 was a multidna object converted to genind and now I need to convert to hierfstat to run hierfstat

SECOND APPROACH USING pegas:
I am trying to run an AMOVA using the genetic distances calculated from a multidna object (allData2) and run into the following error:

allData_dist<-dist.multidna(allData2)
levels <- factor(c(rep("West", 20), rep("East", 20)))
populations <- factor(c(rep("CA", 10), rep("Ch", 10),rep("Am", 10), rep("AF", 10)))
amova(allData_dist ~ populations, nperm = 100)
"Error in y^2 : non-numeric argument to binary operator"

Any ideas how to solve any or both of these problems?

Thanks!
Margarita

@hlapp
Copy link
Member

hlapp commented Dec 7, 2015

I am having problems with the AMOVA analysis of sequence data.

Which file are you referring to? PopDiffSequenceData.Rmd? Generally, it is always best to give the name of the file, that way it is unambiguous.

@hlapp
Copy link
Member

hlapp commented Dec 7, 2015

And if the code you are having problems with is in a new file that's being developed by you, the first issue you are seeing we've also had in DifferentiationSNP.Rmd. The solution suggested there by @jgx65 actually worked; here's the code change: ee619ea.

@jgx65
Copy link

jgx65 commented Dec 7, 2015

@mmlopezu @hlapp @zkamvar

re the conversion from genind to hierfstat, try this:

myData1<-read.FASTA("Ebom_CAD.fas") 

myData.genind<-DNAbin2genind(myData1,pop=rep(c("CA","Ch","Am","AF"), each=5)) 

myData.hierfstat<-genind2hierfstat(myData.genind)

wc(myData.hierfstat,diploid=FALSE)

Note the use of DNAbin2genind rather than as.genind.DNAbin on the second line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants