Closed hlapp closed 8 years ago
@smanel your change fixed the call to df2genind()
, but now genind2hierfstat()
fails:
Quitting from lines 80-87 (DifferentiationSNP.Rmd)
Error in genind2hierfstat(Mydata1) :
alleles must be encoded as numbers or nucleotides. Exiting
Perhaps @zkamvar knows how to fix this? (I don't.)
This error message means that alleles are not encoded as integer or in c("a","c","g","t","A","C","G",T")
. I am puzzled, because from the version of the data file I've just downloaded, I did not get this error message. What is the result of names(table(unlist(Mydata1@all.names)))
? This should contain only c("a","c","g","t","A","C","G",T")
.
(table(unlist(Mydata1@all.names)))
A C G T 19 6 13 2
@smanel OK, I believe the source of the error is the argument ncode=2
in the call to df2genind
prior to calling genind2hierfstat
. Try replacing this with sep=""
. It worked for me... @thibautjombart, @zkamvar any idea why this behavior?
Thanks @jgx65, that indeed fixes it. Now we have the next error showing up:
Quitting from lines 117-120 (DifferentiationSNP.Rmd)
Error in eval(expr, envir, enclos) : could not find function "pp.fst"
Where did this function use to be, and which package is it in now?
I have sent a working version of the markdown file to Stephanie Manel. Indeed, pp.fst has been replaced with pairwise.WCfst. Better still, use genet.dist(Mydata1, method="WC84")
Sent using OWA for iPad
Are there more changes needed than the one you suggest? Can you send me the file with your edits as well (or much better yet, simply put up a Gist and add a link here). I'd like to reduce @smanel's frustrations with things not directly related to developing her vignette :smile:
this should be it:
Thanks @jgx65. That fixes DifferentiationSNP.Rmd
. Now there is a failure involving Fst()
in another vignette:
Quitting from lines 61-63 (PopDiffSequenceData.Rmd)
Error in Fst(allData_loci) : Fst() requires diploid data
Anyone have any ideas for how to correct that?
Had a quick look. Fst
is from pegas
I believe. allData_Loci mixes haploid (mt) and diploid (CAD) data, which is strange. I tried running things on CAD data set only, but no better success. genind object says diploid but the tab slot contains haploid data only (each row sums to 1). One can run basic.stats
on the genind object with argument diploid=F, but, since, each individual is different, this does not give very meaningful results...
> Mydata2tab<-as.genind.DNAbin(tmp2, rep(c("CA","Ch","Am","AF"), each=5))
> Mydata2tab
/// GENIND OBJECT /////////
// 20 individuals; 1 locus; 19 alleles; size: 9.6 Kb
// Basic content
@tab: 20 x 19 matrix of allele counts
@loc.n.all: number of alleles per locus (range: 19-19)
@loc.fac: locus factor for the 19 columns of @tab
@all.names: list of allele names for each locus
@ploidy: ploidy of each individual (range: 2-2)
@type: codom
@call: .local(.Object = .Object, tab = ..1, pop = ..2)
// Optional content
@pop: population of each individual (group size range: 5-5)
> basic.stats(Mydata2tab,diploid=F)
$perloc
Ho Hs Ht Dst Htp Dstp Fst Fstp Fis Dest
L1 NA 1 0.995 -0.005 0.9933 -0.0067 -0.005 -0.0067 NA -6.0048e+13
dummy.loc NA 1 0.995 -0.005 0.9933 -0.0067 -0.005 -0.0067 NA -6.0048e+13
$overall
Ho Hs Ht Dst Htp Dstp Fst Fstp Fis Dest
NA 1 NA NA NA NA NA NA NA NA
From @smanel: