[adegenet-forum] read.PLINK error message
Zhian Kamvar
kamvarz at science.oregonstate.edu
Sat Dec 16 15:16:20 CET 2023
Hi Ashley,
I suspect that the PLINK format has changed somewhat since this function
was initially written (before 2014). If you have a VCF file, it would be
better to use the {vcfR} package to convert to genlight or genclone (or
even genind).
To do so, you can use:
vcf <- vcfR::read.vcfR("/path/to/my.vcf")
with
vcfR::vcfR2genlight(vcf) to return a genlight object
or
vcfR::vcfR2genind(vcf, return.alleles = TRUE) to return a genind object
I hope that helps. Sorry for the late reply.
Best,
Zhian
> Date: Mon, 4 Dec 2023 19:40:39 -0800
> From: Ashley A Dickinson <Ashley.Dickinson at humboldt.edu>
> To: adegenet-forum at lists.r-forge.r-project.org
> Subject: [adegenet-forum] read.PLINK error message
> Message-ID:
> <CAGM_n_=
> R5oWBJSA__aKGveZyyOn96qHxKEj8j_Q7L9ES8nv0rg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello,
>
> I am trying to use adagenet (v.2.1.10) to do DAPC, but I am receiving an
> error message I can't figure out. I used PLINK2 to convert a vcf file to a
> .raw file for SNP data obtained on 78 individuals using RADseq. I then
> tried to use the read.PLINK function to import into genlight objects
>
> > read.PLINK("myfile.raw", map.file = "myfile.map")
>
> Reading PLINK raw format into a genlight object...
> Reading loci information...
> Reading and converting genotypes...
> .Error in read.PLINK("myfile.raw", map.file = "myfile.map") :
> some individuals do not have -5 SNPs.
>
>
> I have tried again with multiple different vcf output files that I had
> created with different parameters and filtering steps just to make sure
> that it wasn't that one file, but I get the same error each time. The data
> set has >8000 SNPs within 730 loci.
>
> Any ideas or recommendations are appreciated!
>
> -Ashley
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.r-forge.r-project.org%2Fpipermail%2Fadegenet-forum%2Fattachments%2F20231204%2F7594c7f1%2Fattachment-0001.htm&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7C68354a5d4b164e480afa08dbf58157c8%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638373708708353960%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=%2FI9%2BAIxx8tGNK33dlJ2Rg2upxLU4MLHBjEacl%2BsCxgY%3D&reserved=0
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> adegenet-forum mailing list
> adegenet-forum at lists.r-forge.r-project.org
>
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.r-forge.r-project.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fadegenet-forum&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7C68354a5d4b164e480afa08dbf58157c8%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638373708708353960%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=aI1aa92PwCqeBs811%2B5SQJvvU6HWiXCQy8Dw9RW0pLI%3D&reserved=0
>
>
> ------------------------------
>
> End of adegenet-forum Digest, Vol 153, Issue 1
> **********************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20231216/8a31f38b/attachment-0001.htm>
More information about the adegenet-forum
mailing list