<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi there,
<br>
<br>
this is easy to do since adegenet 2.0.0. You can use x[loc=...] where ... is any usual subsetting, which will be matched against locNames(x). You can use it to retain relevant loci, or discard the unwanted ones.<br>
<br>
For instance:<br>
<font face="Courier New"><br>
> library(adegenet)<br>
Loading required package: ade4<br>
<br>
   /// adegenet 2.0.0 is loaded ////////////<br>
<br>
   > overview: '?adegenet'<br>
   > tutorials/doc/questions: 'adegenetWeb()' <br>
   > bug reports/feature resquests: adegenetIssues()<br>
<br>
<br>
> data(nancycats)<br>
<b>> locNames(nancycats)<br>
[1] "fca8"  "fca23" "fca43" "fca45" "fca77" "fca78" "fca90" "fca96" "fca37"<br>
</b><br>
<b>## removing loci 2, 4 and 5</b><br>
> toRemove= c(2,4,5)<br>
> x=nancycats[loc=-toRemove]<br>
> x<br>
/// GENIND OBJECT /////////<br>
<br>
 // 237 individuals; 6 loci; 76 alleles; size: 102.9 Kb<br>
<br>
 // Basic content<br>
   @tab:  237 x 76 matrix of allele counts<br>
   @loc.n.all: number of alleles per locus (range: 8-18)<br>
   @loc.fac: locus factor for the 76 columns of @tab<br>
   @all.names: list of allele names for each locus<br>
   @ploidy: ploidy of each individual  (range: 2-2)<br>
   @type:  codom<br>
   @call: .local(x = x, i = i, j = j, loc = ..1, drop = drop)<br>
<br>
 // Optional content<br>
   @pop: population of each individual (group size range: 9-23)<br>
   @other: a list containing: xy <br>
<br>
<b>## note the difference from locNames(nancycats):</b><br>
<b>> locNames(x)</b><br>
<b>[1] "fca8"  "fca43" "fca78" "fca90" "fca96" "fca37"</b><br>
</font><br>
<br>
Cheers<br>
Thibaut<br>
<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div class="BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="PlainText">                <br>
==============================<br>
Dr Thibaut Jombart<br>
MRC Centre for Outbreak Analysis and Modelling<br>
Department of Infectious Disease Epidemiology<br>
Imperial College - School of Public Health<br>
Norfolk Place, London W2 1PG, UK<br>
Tel. : 0044 (0)20 7594 3658<br>
http://sites.google.com/site/thibautjombart/<br>
http://sites.google.com/site/therepiproject/<br>
http://adegenet.r-forge.r-project.org/<br>
Twitter: @thibautjombart<br>
<br>
<br>
</div>
</span></font></div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF607556"><font face="Tahoma" color="#000000" size="2"><b>From:</b> adegenet-forum-bounces@lists.r-forge.r-project.org [adegenet-forum-bounces@lists.r-forge.r-project.org] on behalf of Ana Verissimo [verissimoac@gmail.com]<br>
<b>Sent:</b> 20 July 2015 15:58<br>
<b>To:</b> adegenet-forum@lists.r-forge.r-project.org<br>
<b>Subject:</b> [adegenet-forum] How can I filter out loci out of HWE from a genind object?<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Hi all,
<div><br>
</div>
<div>I have a data set comprised on 1000s of SNP loci genotyped for 10s of individuals. I have tested loci for conformance to HWE and want to filter out those loci out of HWE. </div>
<div><br>
</div>
<div>Is there a function already available to perform this filtering in genind objects? </div>
<div>If not, I am guessing I may need to figure out a way to subset my data using a list of loci that I want to keep?</div>
<div><br>
</div>
<div>Any tips or suggestions are welcome!  <br clear="all">
<div>Ana</div>
<div class="gmail_signature">
<div dir="ltr"><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>