Re: [poppr] Error in Poppr AMOVA Error in DISTFUN(mpop, ...) : min(ploidy(x)) == max(ploidy(x)) is not TRUE

83 views
Skip to first unread message

Zhian Kamvar

unread,
Mar 6, 2022, 10:15:39 AM3/6/22
to astur...@fau.edu, poppr
Hello,

The error is saying that you have individuals with varying ploidies in your data and bitwise.dist() does not know how to compare those. I'm sorry that you saw this error and I agree that it is not really unhelpful. I will write a better error for the next release.

If all of your samples have the same ploidy, you can use:

ploidy(regionalGenlightPopDepth) <- 2 # or whatever ploidy your organism is

and then run AMOVA again.

The reason why this is happening is because if you do not supply a ploidy argument when you make your genlight object, it tries to guess the ploidy for each individual, so those that have no homozygotes for the minor allele will appear to be haploid (though if you used vcfR to convert your data, I don't think there is a ploidy argument).

All the best,
Zhian

On Thu, Feb 24, 2022 at 11:56 AM 'astur...@fau.edu' via poppr <po...@googlegroups.com> wrote:
Hello,

I commonly run this code with no error but with this sample set I am finding errors having to do with ploidy even though it is a simple diploid SNP dataset.

regionalVcf = read.vcfR("regionalMcavNoClones.bcf")

#Scanning file to determine attributes.
#File attributes are all correct and all variants are processed

popData = read.csv("regionalInds2PopsNoClones.csv") 
# Reads in population data for each sample
 
  strata(regionalGenlightPopDepth) = data.frame(popData)
  
setPop(regionalGenlightPopDepth) = ~regionDepth

amova <- poppr.amova(regionalGenlightPopDepth, ~regionDepth) #Runs AMOVA

Error in DISTFUN(mpop, ...) :
  min(ploidy(x)) == max(ploidy(x)) is not TRUE

Could it be an issue with the file size (2.7 Mb)? I otherwise can't tell any difference between this and other genlight files I have made.

Thank you,
Alexis Sturm

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/poppr/ce965a3c-dc38-4cb5-b62f-173ff3bba125n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages