<div dir="ltr">Great it worked perfectly!<div><br></div><div>Thanks a lot!</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-04-20 18:04 GMT+02:00 Thibaut Jombart <span dir="ltr"><<a href="mailto:thibautjombart@gmail.com" target="_blank">thibautjombart@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>here's an example using made up data:<br><br></div><div>## make up data</div><div><div>> x <- glSim(40, 1e4, LD=FALSE, parallel=FALSE)</div><div><br></div><div>## fake chromosome info</div><div>> chromosome(x) <- rep(c("chr1", "chr2"), c(2000, 8000))</div><div><br></div><div>## create a list of genlights, 1 per chromosome</div><div>> lapply(levels(chromosome(x)), function(lev) x[,chromosome(x)==lev])</div><div>[[1]]</div><div> /// GENLIGHT OBJECT /////////</div><div><br></div><div> // 40 genotypes,  2,000 binary SNPs, size: 73.5 Kb</div><div> 0 (0 %) missing data</div><div><br></div><div> // Basic content</div><div>   @gen: list of 40 SNPbin</div><div>   @ploidy: ploidy of each individual  (range: 1-1)</div><div><br></div><div> // Optional content</div><div>   @chromosome: factor storing chromosomes of the SNPs</div><div>   @other: a list containing: ancestral.pops </div><div><br></div><div><br></div><div>[[2]]</div><div> /// GENLIGHT OBJECT /////////</div><div><br></div><div> // 40 genotypes,  8,000 binary SNPs, size: 126.3 Kb</div><div> 0 (0 %) missing data</div><div><br></div><div> // Basic content</div><div>   @gen: list of 40 SNPbin</div><div>   @ploidy: ploidy of each individual  (range: 1-1)</div><div><br></div><div> // Optional content</div><div>   @chromosome: factor storing chromosomes of the SNPs</div><div>   @other: a list containing: ancestral.pops </div><div><br></div><div><br></div></div><div>This could be an option in seploc; I don't really have time to implement it now but maybe worth filing as an issue on github?</div><div><br></div><div>Note that if you want to randomise SNPs you can tweak the above using 'sample'.</div><div>Best</div><div>Thibaut</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_-2290112786036661093gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><br>--<br>Dr Thibaut Jombart<br>Lecturer, Department of Infectious Disease Epidemiology, Imperial College London<br>Head of RECON: <a href="http://repidemicsconsortium.org" target="_blank">repidemicsconsortium.org</a><br>WHO Consultant - outbreak analysis</div><div><a href="https://thibautjombart.netlify.com" target="_blank">https://thibautjombart.<wbr>netlify.com</a><br>Twitter: @TeebzR<br>+44(0)20 7594 3658</div></div></div></div>
<br><div class="gmail_quote"><div><div class="h5">On 20 April 2018 at 13:50, Amaranta <span dir="ltr"><<a href="mailto:amaranta.fontcuberta@gmail.com" target="_blank">amaranta.fontcuberta@gmail.<wbr>com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hello, <div><br></div><div>I am working with a genelight object. I would like to do analsyes on a subset of SNPs, defined by a list of chromosomes.  Is there a way to do this in adegenet ?</div><div> I know I could convert the genelight object to a matrix and select columns according to a list of names. But I am interested in keeping the information of the genelight object.  Also, I know there is the Seploc() function that subsets the dataset in groups of /random/ SNPs. Is there way to use Seploc() to select locus according to a criteria?</div><div><br></div><div>Many thanks in advance, </div><span class="m_-2290112786036661093HOEnZb"><font color="#888888"><div><br></div><div><br></div><div>Amaranta.</div></font></span></div>
<br></div></div>______________________________<wbr>_________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r<wbr>-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum" rel="noreferrer" target="_blank">https://lists.r-forge.r-projec<wbr>t.org/cgi-bin/mailman/listinfo<wbr>/adegenet-forum</a><br></blockquote></div><br></div>
</blockquote></div><br></div>