[adegenet-forum] Reading a genepop file with adegenet

Thibaut Jombart thibautjombart at gmail.com
Mon Apr 24 19:25:00 CEST 2017


I so want to say it is a super power..

but the truth is:

1. try opening your file running debug mode
2. in the guts of the read.genepop function, pull the temporary object
storing genotypes
3. use table(nchar(x)) to see the distribution of the number of characters
in all entries
4. found two rogue entries with 8 characters, identified them
5. then opened your file and looked for '00000000'

A similar question would be: how did the rogue entry get there in the first
place?

;)



--
Dr Thibaut Jombart
Lecturer, Department of Infectious Disease Epidemiology, Imperial College
London
Head of RECON: repidemicsconsortium.org
sites.google.com/site/thibautjombart/
github.com/thibautjombart
Twitter: @TeebzR <http://twitter.com/TeebzR>
+44(0)20 7594 3658

On 24 April 2017 at 17:29, Robert Fairweather <rb951092 at dal.ca> wrote:

> Hi Thibaut,
>
> Many thanks finding this, you are right, the file now reads fie. But how
> did you find the two rogue values? The only way I could think would be to
> scan the file by eye.
>
> Best,
>
> Robert
> ------------------------------
> *From:* Thibaut Jombart <thibautjombart at gmail.com>
> *Sent:* 24 April 2017 12:06:11
> *To:* Robert Fairweather
> *Cc:* adegenet-forum at lists.r-forge.r-project.org
> *Subject:* Re: [adegenet-forum] Reading a genepop file with adegenet
>
> Hello,
>
> upon inspection, I think your file is corrupt - there are two rogue
> '00000000' (8 times 0). After replacing these and specifying ncode = 3 it
> reads fine.
>
> Best
> Thibaut
>
>
> --
> Dr Thibaut Jombart
> Lecturer, Department of Infectious Disease Epidemiology, Imperial College
> London
> Head of RECON: repidemicsconsortium.org
> R Epidemics Consortium <http://repidemicsconsortium.org/>
> repidemicsconsortium.org
> The R Epidemics Consortium (RECON) assembles a group of international
> experts in infectious disease modelling, Public Health, and software
> development to create the ...
>
>
> sites.google.com/site/thibautjombart/
> <http://sites.google.com/site/thibautjombart/>
> Thibaut Jombart's webpage - Google Sites
> <http://sites.google.com/site/thibautjombart/>
> sites.google.com
> Dr Thibaut Jombart MRC Centre for Outbreak Analysis and Modelling
> Department of Infectious Disease Epidemiology Imperial College St Mary’s
> Campus
>
>
> github.com/thibautjombart
> Twitter: @TeebzR <http://twitter.com/TeebzR>
> +44(0)20 7594 3658 <+44%2020%207594%203658>
>
> On 24 April 2017 at 15:32, Robert Fairweather <rb951092 at dal.ca> wrote:
>
>> Dear Forum,
>> I am having some trouble importing my genepop file into adegenet using
>> the read.genepop function. I have set the ncode argument to 3 to reflect
>> the the character format of my SNP data (eg 001003) but still receive the
>> error "some alleles are not encoded for by three characters"
>> The error persists even with the default ncode parameter and a two
>> character format used. Missing data is coded for as 000000 (or 0000 in 2
>> character format) and upon comparison with the nancycats file I cannot see
>> any differences. Are you able to help me out? I have attached the file.
>> Many thanks,
>> Robert
>>
>>
>> _______________________________________________
>> adegenet-forum mailing list
>> adegenet-forum at lists.r-forge.r-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo
>> /adegenet-forum
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20170424/f05a9efb/attachment-0001.html>


More information about the adegenet-forum mailing list