adegenet icon indicating copy to clipboard operation
adegenet copied to clipboard

snapclust on genlight data

Open Ram-Nagar opened this issue 6 years ago • 1 comments

Hi Thibaut, I am trying to use snapclust for hybrids identification in a diploid plant pathogenic fungs. I have genome-wide variants data of 110 individuals in a multi-sample vcf file. I read the multisample vcf file into R with vcfR tools reads vcf and then convert it to greenlight objects with the function vcf2genlight (vcfR).

When I use snapclust to find the k, it thows an error the command: a.clust <- snapclust(gl.WGab, k = 6) the error: Error in snapclust(gl.WGab, k = 6) : x is not a valid genind object

So wondering if snapclust can be used for genlight objects or not.

Thanks Ram

Ram-Nagar avatar Jun 05 '19 05:06 Ram-Nagar

Hi @Ram-Nagar,

In short, no, snapclust does not support genlight objects, mainly because there's currently no method for converting genlight to genpop. My suggestion would be to use PCA to find the loci that contribute most to the structure of your data and create a genind object from that subset.

zkamvar avatar Jun 05 '19 08:06 zkamvar