<div dir="ltr"><div class="gmail_default" style="color:rgb(0,0,255)"><font size="1">Hello,</font></div><div class="gmail_default" style="color:rgb(0,0,255)"><font size="1"><br></font></div><div class="gmail_default" style="color:rgb(0,0,255)"><font size="1">I am trying to remove a set of loci, as in the question posted here: <a href="http://lists.r-forge.r-project.org/pipermail/adegenet-forum/2015-July/001194.html">http://lists.r-forge.r-project.org/pipermail/adegenet-forum/2015-July/001194.html</a>. However, I'm wondering if there is a way to list the exact locus names instead of simply the position of the locus. And, what is more, if there is a way to provide a vector with loci to remove, with the identifier be only part of the full locus name? </font></div><div class="gmail_default" style="color:rgb(0,0,255)"><font size="1"><br></font></div><div class="gmail_default" style="color:rgb(0,0,255)"><font size="1">Say I have the following</font></div><div class="gmail_default"><div class="gmail_default"><font color="#0000ff" size="1">> dat.s_subset <- dat.s[1:5,1:5]</font></div><div class="gmail_default"><font color="#0000ff" size="1">> dat.s_subset</font></div><div class="gmail_default"><font color="#0000ff" size="1">/// GENIND OBJECT /////////</font></div><div class="gmail_default"><font color="#0000ff" size="1"><br></font></div><div class="gmail_default"><font color="#0000ff" size="1"> // 5 individuals; 3 loci; 5 alleles; size: 6.7 Kb</font></div><div class="gmail_default"><font color="#0000ff" size="1"><br></font></div><div class="gmail_default"><font color="#0000ff" size="1"> // Basic content</font></div><div class="gmail_default"><font color="#0000ff" size="1"> @tab: 5 x 5 matrix of allele counts</font></div><div class="gmail_default"><font color="#0000ff" size="1"> @loc.n.all: number of alleles per locus (range: 1-2)</font></div><div class="gmail_default"><font color="#0000ff" size="1"> @loc.fac: locus factor for the 5 columns of @tab</font></div><div class="gmail_default"><font color="#0000ff" size="1"> @all.names: list of allele names for each locus</font></div><div class="gmail_default"><font color="#0000ff" size="1"> @ploidy: ploidy of each individual (range: 2-2)</font></div><div class="gmail_default"><font color="#0000ff" size="1"> @type: codom</font></div><div class="gmail_default"><font color="#0000ff" size="1"> @call: .local(x = x, i = i, j = j, drop = drop)</font></div><div class="gmail_default"><font color="#0000ff" size="1"><br></font></div><div class="gmail_default"><font color="#0000ff" size="1"> // Optional content</font></div><div class="gmail_default"><font color="#0000ff" size="1"> @pop: population of each individual (group size range: 5-5)</font></div><div class="gmail_default"><font color="#0000ff" size="1">> locNames(dat.s_subset)</font></div><div class="gmail_default"><font color="#0000ff" size="1">[1] "12706_10" "14223_16" "14481_7" </font></div><div class="gmail_default"><font color="#0000ff" size="1"><br></font></div><div class="gmail_default"><font color="#0000ff" size="1">As I understand it, if I want to remove locus 14223_16, I can use</font></div><div class="gmail_default"><font color="#0000ff" size="1"><div class="gmail_default">> toRemove=c(2)</div><div class="gmail_default">> x=dat.s_subset[loc=-toRemove]</div><div class="gmail_default">> x</div><div class="gmail_default">/// GENIND OBJECT /////////</div><div class="gmail_default"><br></div><div class="gmail_default"> // 5 individuals; 2 loci; 3 alleles; size: 6.3 Kb</div><div class="gmail_default"><br></div><div class="gmail_default"> // Basic content</div><div class="gmail_default"> @tab: 5 x 3 matrix of allele counts</div><div class="gmail_default"> @loc.n.all: number of alleles per locus (range: 1-2)</div><div class="gmail_default"> @loc.fac: locus factor for the 3 columns of @tab</div><div class="gmail_default"> @all.names: list of allele names for each locus</div><div class="gmail_default"> @ploidy: ploidy of each individual (range: 2-2)</div><div class="gmail_default"> @type: codom</div><div class="gmail_default"> @call: .local(x = x, i = i, j = j, loc = ..1, drop = drop)</div><div class="gmail_default"><br></div><div class="gmail_default"> // Optional content</div><div class="gmail_default"> @pop: population of each individual (group size range: 5-5)</div><div class="gmail_default">> locNames(x)</div><div class="gmail_default">[1] "12706_10" "14481_7" </div><div class="gmail_default"><br></div><div class="gmail_default">However, I have thousands of loci, and from the analysis that I have done, my vector of loci that I want to remove has the number of the locus before the underscore. Is there a way of specifying loci using only this information? So, I'd need something like the unix wildcard "*", and to be able to say something like toRemove=c(14223*).</div><div class="gmail_default"><br></div><div class="gmail_default">I've done a bunch of searching on the web to see if it would be easier to do this outside of adegenet, but it seems like it is going to be hard.</div><div class="gmail_default"><br></div><div class="gmail_default">Any help would be much appreciated.</div><div class="gmail_default"><br></div><div class="gmail_default">Sincerely,</div><div class="gmail_default">Ella</div></font></div></div><div><font size="1"><br></font></div><font size="1">-- <br></font><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font size="1">Ella Bowles, PhD<br>Postdoctoral Researcher<br>Department of Biology<br>Concordia University<br><br>Website: <a href="https://ellabowlesphd.wordpress.com/" target="_blank">https://ellabowlesphd.wordpress.com/</a><br>Email: <a href="mailto:bowlese@gmail.com" target="_blank">bowlese@gmail.com</a></font></div></div></div></div></div></div></div>
</div>