On Feb 7, 2019, at 18:08 , meharji....@helsinki.fi wrote:
I have been trying to implement AMOVA on my dataset and constantly failing with the below error after running the command for 2-3hrs. Could you please help what has been wrong?
I have created the GENIND object for my dataframe with df2genind function as shown below:
--
You received this message because you are subscribed to the Google Groups "poppr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
To post to this group, send email to po...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/58497e8d-34e5-4fc1-a1a8-1977f68de4f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Feb 7, 2019, at 22:55 , meharji....@helsinki.fi wrote:
Hi,The data is diploid SNP genotype data. However, the genotype are coded as 0 (reference), 1 (heterozygous) , 2 (homozygous) and -1 (missing). The df2genind is used on this matrix.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/7eccfdf2-d857-445a-b816-7476a2a32d95%40googlegroups.com.
The data is diploid SNP genotype data. However, the genotype are coded as 0 (reference), 1 (heterozygous) , 2 (homozygous) and -1 (missing)
> amova.results <- poppr.amova(snp.genlight, ~Breed/Sample)Error in DISTFUN(mpop, ...) :min(ploidy(x)) == 2 || min(ploidy(x)) == 1 is not TRUE
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/99274d12-1412-49b1-9f59-5e92f6081f4c%40googlegroups.com.
> vcf <- read.vcfR("SNP.syn.biallelic.recode.vcf", verbose = FALSE )> snp.genlight<-vcfR2genlight(vcf)
> pop(snp.genlight) <- group ##add population group
> head(group)
Sample Group1: A065 AC2: AM6B1 AM3: BB11 BB4: B1 BC5: BC1026 BC6: BC1028 BC
> snp.genlight /// GENLIGHT OBJECT /////////
// 142 genotypes, 41,570 binary SNPs, size: 5.3 Mb 131852 (2.23 %) missing data
// Basic content @gen: list of 142 SNPbin
// Optional content @ind.names: 142 individual labels @loc.names: 41570 locus labels @chromosome: factor storing chromosomes of the SNPs @position: integer storing positions of the SNPs @pop: population of each individual (group size range: 1-22) @other: a list containing: elements without names
> amova.results <- poppr.amova(snp.genlight, ~Group/Sample)Error: Number of rows in data frame not equal to number of individuals in object.In addition: Warning messages:1: Cannot set the population from an empty strata 2: In poppr.amova(snp.genlight, ~Group/Sample) : Missing data are not filtered from genlight data.3: In make_haplotypes_genlight(gid) : No strata found... creating one from the population
I have verified the sample names in the vcf and with sample names in groups dataframe. All the samples is VCF are in the groups data frame. > all(sort(colnames(vcf@gt)[-1]) == sort(Group$Sample))[1] TRUE
And the length of the samples is also same.> length(colnames(vcf@gt)[-1])[1] 142> length(Group$Sample)[1] 142
Could you hint what has been going wrong here while running 'poppr.amova'.