[adegenet-forum] Reading a genepop file with adegenet
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
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
Dr Thibaut Jombart
Lecturer, Department of Infectious Disease Epidemiology, Imperial College
Head of RECON: repidemicsconsortium.org
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.
> *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
> 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.
> Dr Thibaut Jombart
> Lecturer, Department of Infectious Disease Epidemiology, Imperial College
> Head of RECON: repidemicsconsortium.org
> R Epidemics Consortium <http://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 ...
> Thibaut Jombart's webpage - Google Sites
> Dr Thibaut Jombart MRC Centre for Outbreak Analysis and Modelling
> Department of Infectious Disease Epidemiology Imperial College St Mary’s
> 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,
>> adegenet-forum mailing list
>> adegenet-forum at lists.r-forge.r-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the adegenet-forum