<div dir="ltr">I got the iterator support and random access working. Alias support can also be worked around by using each of nr.*.pin bases as a separate DB. So before I go to more complex stuff like proper Aliases and support for DNA, I have a few integration-related questions:<div>1) How adding code to Biopython work anyway? Do I send a pull request to main Biopython repo?</div><div>2) What handle you think SeqIO-compatible module should take, if any? BLAST database is at least 3 files (if there are no aliases and no additional indexes)</div><div>3) Is there any need to even bother with SeqIO.write()? Writing one sequence is a major hassle and no one is gonna generate these bases directly from Python when there is Bio.Applications</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-11 11:54 GMT+08:00 Alexey Morozov <span dir="ltr">&lt;<a href="mailto:alexeymorozov1991@gmail.com" target="_blank">alexeymorozov1991@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Yes, DNA support, alias files and so on will be added. I&#39;m not sure about indexing, though. That may be a nice option to have, but definitely not default.</div><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2015-03-10 17:17 GMT+08:00 Peter Cock <span dir="ltr">&lt;<a href="mailto:p.j.a.cock@googlemail.com" target="_blank">p.j.a.cock@googlemail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Alexey,<br>
<br>
I think this would be a very interesting addition to Bio.SeqIO,<br>
initially a simple iterator for parsing the records one by one<br>
(like a binary FASTA file), but with more work if we can decode<br>
the BLAST lookup files efficient random access via the<br>
Bio.SeqIO.index interface would be great.<br>
<br>
Your code currently only looks at protein databases - have<br>
you tried nucleotide BLAST databases yet? I would expect<br>
the basic structure to be quite similar...<br>
<br>
Also for many uses parsing *.pal (and *.nal) alias files would<br>
be important (e.g. accessing sequencing from the nr/nt<br>
databases).<br>
<br>
Once you have some functional tests, generalising Python 3<br>
code to also run on Python 2.6 and 2.7 is not too hard - and<br>
we would need to do that for inclusion in Biopython. See<br>
the code in SffIO.py for another example which deals with<br>
a binary sequence file format:<br>
<br>
<a href="https://github.com/biopython/biopython/blob/master/Bio/SeqIO/SffIO.py" target="_blank">https://github.com/biopython/biopython/blob/master/Bio/SeqIO/SffIO.py</a><br>
<br>
Peter<br>
<div><div><br>
<br>
<br>
On Tue, Mar 10, 2015 at 7:59 AM, Alexey Morozov<br>
&lt;<a href="mailto:alexeymorozov1991@gmail.com" target="_blank">alexeymorozov1991@gmail.com</a>&gt; wrote:<br>
&gt; Dear colleagues,<br>
&gt; I have a pretty crude pure Python3 module that reads binary BLAST databases<br>
&gt; (<a href="https://github.com/SynedraAcus/BinaryBlast" target="_blank">https://github.com/SynedraAcus/BinaryBlast</a>). Is there any chance it&#39;ll make<br>
&gt; to main distribuition as SeqIO subclass if I add iterator behaviour and fix<br>
&gt; dirty hacks?<br>
&gt;<br>
&gt; --<br>
&gt; Alexey Morozov,<br>
&gt; LIN SB RAS, bioinformatics group.<br>
&gt; Irkutsk, Russia.<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Biopython-dev mailing list<br>
&gt; <a href="mailto:Biopython-dev@mailman.open-bio.org" target="_blank">Biopython-dev@mailman.open-bio.org</a><br>
&gt; <a href="http://mailman.open-bio.org/mailman/listinfo/biopython-dev" target="_blank">http://mailman.open-bio.org/mailman/listinfo/biopython-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><font face="arial,helvetica,sans-serif">Alexey Morozov,<br>LIN SB RAS, bioinformatics group.<br>Irkutsk, Russia.<br></font></div>
</div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><font face="arial,helvetica,sans-serif">Alexey Morozov,<br>LIN SB RAS, bioinformatics group.<br>Irkutsk, Russia.<br></font></div>
</div>