<div dir="ltr">Lior,<div><br></div><div>As you have already identified, doing everything locally is probably best if you have a large number of queries.</div><div><br></div><div>You can also keep BLASTing remotely, collecting all your hits, and then do the following:</div>

<div><br></div><div><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)">

<code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial"><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">ncbiResults </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(43,145,175);background:transparent">Entrez</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">efetch</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">(</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">db</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&quot;nucleotide&quot;</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> id</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">=[</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">gi1, gi2,gi3...]</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> rettype</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&quot;gb&quot;</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> retmode</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&quot;text&quot;</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">)</span></code></pre>

<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)">

<span style="font-family:arial,helvetica,sans-serif;white-space:inherit;line-height:17.8048000335693px;background-color:transparent">Where you provide a list of all gi keys you collected. You will get a list of Entrez records.</span><br>

</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)">

<code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;white-space:inherit;background-image:initial;background-repeat:initial"><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"><font face="arial, helvetica, sans-serif"><br>

</font></span></code></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)">

<code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;white-space:inherit;background-image:initial;background-repeat:initial"><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-image:initial;background-color:transparent;background-repeat:initial"><font face="arial, helvetica, sans-serif">You can then process these records with SeqIO.parse() (as an iterator) instead of SeqIO.read(), e.g.:</font></span></code></pre>

<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)">

<code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial"><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">organisms = []</span></code></pre>

<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)">

<code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial"><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">for seqrec in SeqIO.parse(</span></code><span style="white-space:inherit;line-height:17.8048000335693px">ncbiResults):</span></pre>

<pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)">

<span style="white-space:inherit;line-height:17.8048000335693px">     organisms.append(</span><span style="white-space:inherit;line-height:17.8048000335693px;margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">seqrec</span><span style="white-space:inherit;line-height:17.8048000335693px;margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">.</span><span style="white-space:inherit;line-height:17.8048000335693px;margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">annotations[&#39;organism&#39;])</span></pre>

</div><div class="gmail_extra"><br>Best,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Iddo</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 18, 2014 at 10:14 AM, Lior Glick <span dir="ltr">&lt;<a href="mailto:liorglic@mail.tau.ac.il" target="_blank">liorglic@mail.tau.ac.il</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="rtl"><div dir="ltr">Dear Biopython list users,</div><div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif;line-height:17.804800033569336px;background-image:initial;background-repeat:initial">


I&#39;m using Biopython for the first time. I have sequence data from unknown organisms, and trying to use BLAST to tell which organism they are most likely to have come from. I wrote the following function to do that:</p>


<pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.804800033569336px;background:rgb(238,238,238)">

<code style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial"><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(0,0,139);background:transparent">def</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> find_organism</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">(</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">file</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">):</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&quot;&quot;&quot;
Receives a fasta file with a single seq, and uses BLAST to find
from which organism it was taken.
&quot;&quot;&quot;</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,128,128);background:transparent"># get seq from fasta file</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
seqRecord </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(43,145,175);background:transparent">SeqIO</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">read</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">(</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">file</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">,</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&quot;fasta&quot;</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">)</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,128,128);background:transparent"># run BLAST</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
blastResult </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> NCBIWWW</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">qblast</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">(</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&quot;blastn&quot;</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">,</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&quot;nt&quot;</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">,</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> seqRecord</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">seq</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">)</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,128,128);background:transparent"># get first hit</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
blastRecord </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> NCBIXML</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">read</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">(</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">blastResult</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">)</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
firstHit </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> blastRecord</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">alignments</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">[</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">0</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">]</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,128,128);background:transparent"># get hit&#39;s gi number</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
title </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> firstHit</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">title
gi </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> title</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">split</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">(</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&quot;|&quot;</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">)[</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">1</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">]</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,128,128);background:transparent"># search NCBI for the gi number</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
ncbiResult </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(43,145,175);background:transparent">Entrez</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">efetch</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">(</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">db</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&quot;nucleotide&quot;</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">,</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> id</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">gi</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">,</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> rettype</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&quot;gb&quot;</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">,</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> retmode</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&quot;text&quot;</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">)</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
ncbiResultSeqRec </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(43,145,175);background:transparent">SeqIO</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">read</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">(</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">ncbiResult</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">,</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&quot;gb&quot;</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">)</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,128,128);background:transparent"># get organism</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">
annotatDict </span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">=</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent"> ncbiResultSeqRec</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">annotations
</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(0,0,139);background:transparent">return</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">(</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">annotatDict</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">[</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">&#39;organism&#39;</span><span style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background:transparent">])</span></code></pre>


<p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif;line-height:17.804800033569336px;background-image:initial;background-repeat:initial">


It works fine, but takes about 2 minutes to retrieve the organism for each species, which seems very slow to me. I&#39;m just wondering if I could do better. I know that I may create a local copy of NCBI to improve performance, and I might do that. However, I suspect that querying BLAST first, then take the id and use it to query Entrez is not the way to go. Do you have any other suggestions for improvements?<br>


Thanks!</p></div></div>
<br>_______________________________________________<br>
Biopython mailing list  -  <a href="mailto:Biopython@mailman.open-bio.org">Biopython@mailman.open-bio.org</a><br>
<a href="http://mailman.open-bio.org/mailman/listinfo/biopython" target="_blank">http://mailman.open-bio.org/mailman/listinfo/biopython</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Iddo Friedberg<br>

<a href="http://iddo-friedberg.net/contact.html" target="_blank">http://iddo-friedberg.net/contact.html</a><br>++++++++++[&gt;+++&gt;++++++&gt;++++++++&gt;++++++++++&gt;+++++++++++&lt;&lt;&lt;&lt;&lt;-]&gt;&gt;&gt;&gt;++++.&gt;<br>

++++++..----.&lt;&lt;&lt;&lt;++++++++++++++++++++++++++++.-----------..&gt;&gt;&gt;+.-----.<br>.&gt;-.&lt;&lt;&lt;&lt;--.&gt;&gt;&gt;++.&gt;+++.&lt;+++.----.-.&lt;++++++++++++++++++.&gt;+.&gt;.&lt;++.&lt;&lt;&lt;+.&gt;&gt;<br>

&gt;&gt;----.&lt;--.&gt;++++++.&lt;&lt;&lt;&lt;------------------------------------.<br>
</div></div>