This is indeed a great solution,<br><br>Many Thanks!<br><br>Maxime<br><br><div class="gmail_quote">2012/5/31 Leonor Palmeira <span dir="ltr"><<a href="mailto:mlpalmeira@ulg.ac.be" target="_blank">mlpalmeira@ulg.ac.be</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Dear Maxime,<br>
<br>
what you could try is get all species that are in "genbank" by:<br>
<br>
query("seqsp","K=rbcl", virtual=T)<br>
<br>
and then project all these sequences to species:<br>
<br>
query("sp","PS seqsp")<br>
namesp=getName(sp)<br>
<br>
Once you have all the species names present in "genbank", you can make a<br>
condition on the iteration on 'Genustobefind', if you don't match a name<br>
in 'namesp', the query is not sent.<br>
<br>
Best,<br>
Leonor.<br>
<div class="im"><br>
On 31/05/12 15:33, Maxime Réjou-Méchain wrote:<br>
> Dear all,<br>
><br>
> I am currently using a loop with the function query to know which genera in<br>
> my list (n>2000 genera) have some sequences in genbank.<br>
><br>
> Here is the loop:<br>
><br>
> choosebank("genbank")<br>
> sequences=vector(mode="numeric",length=length(Genustobefind))<br>
> for (i in 1:length(Genustobefind)){<br>
> print(paste("Retrieving sequence ",Genustobefind[i]," i=",i,sep=""))<br>
> query1=paste("SP=",Genustobefind[i], " AND K=rbcl", sep="")<br>
> query("bb", query1,virtual=T)<br>
> sequences[i]=bb$nelem<br>
> }<br>
><br>
> The loop work well but a lot of genera block the query function. For<br>
> example, if I do<br>
><br>
> query("bb", "SP=Acanthodium AND K=rbcl",virtual=T)<br>
><br>
> The function run without stopping. I thus have to break the loop.<br>
><br>
> For information, if I submit manually the genera that block the query<br>
> function to genbank I obtain in the main cases:<br>
><br>
</div>>    - The following term was not found in Nucleotide: Acanthodium.<br>
>    - See the search<br>
> details<<a href="http://www.ncbi.nlm.nih.gov/nuccore/details?querykey=1" target="_blank">http://www.ncbi.nlm.nih.gov/nuccore/details?querykey=1</a>>.<br>
><br>
>    - No items found.<br>
<div class="im">><br>
> In fact all these genera are not present in Genbank. Have you any idea to<br>
> overcome this problem? I just want to have a value of zero for these genera<br>
> and to continue my loop.<br>
> Many thanks in advance for your help,<br>
><br>
> Maxime<br>
><br>
><br>
><br>
><br>
</div>> _______________________________________________<br>
> Seqinr-forum mailing list<br>
> <a href="mailto:Seqinr-forum@lists.r-forge.r-project.org">Seqinr-forum@lists.r-forge.r-project.org</a><br>
> <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/seqinr-forum" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/seqinr-forum</a><br>
<br>
- --<br>
Leonor Palmeira, PhD<br>
<br>
Phone: <a href="tel:%2B32%204%20366%2042%2069" value="+3243664269">+32 4 366 42 69</a><br>
Email: mlpalmeira AT ulg DOT ac DOT be<br>
<a href="http://sites.google.com/site/leonorpalmeira" target="_blank">http://sites.google.com/site/leonorpalmeira</a><br>
<br>
Immunology-Vaccinology, Bat. B43b<br>
Faculty of Veterinary Medicine<br>
Boulevard de Colonster, 20<br>
University of Liege, B-4000 Liege (Sart-Tilman)<br>
Belgium<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.10 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
iQEcBAEBAgAGBQJPx3ZZAAoJEKquFGwgRb3za8gIAMB7kIRp/vciSlvgd9tLdt12<br>
wAZLGpMoP6drWsewDGMfk6yfAeOxGM5Q3U4HkHdzC6ilZ2gL2yEaFMfwEYHSqVFh<br>
EFz7GstvI/6zZ6yAsup6CVlbYOQTPLR7eh9rUB74Ik+IT03tjAyLQc5jp1eRcmmv<br>
nRrv+LqLtRUHnDdR+EWh5O7+AFb3q2h9WyeiTzkAiSmwBnYzioVVocwgt+4WHIDc<br>
+6w0aOrK7JTeHkb7WZTBiqfpqQ+1WLrVf88XNK+TZqB71nFms8losZ1jmJbSNRoZ<br>
r1YoSljG6uhwpT5k3w4uy2JZT+vAv5keoPkFFbtpKyLYoZgdZTH6HYi6Eiv+mJU=<br>
=P3tV<br>
-----END PGP SIGNATURE-----<br>
</blockquote></div><br><br clear="all"><br>-- <br>Maxime Réjou-Méchain<br>Laboratoire Evolution et Diversité Biologique UMR 5174<br>Centre National Recherche Scientifique/Université Paul Sabatier<br>Bâtiment 4R1 31062 Toulouse<br>
France<br><a href="https://sites.google.com/site/maximerejoumechain/" target="_blank">Personal website</a><br>+33 (0) 5-61-55-85-81<br><a href="mailto:maxime.rejou@gmail.com" target="_blank"></a><br>