Andreas Tille <ti...@debian.org> writes:

> When thinking about this just disabling the affected test might be a
> reasonable thing to do.

No need, I've come up with a working patch (attached).

-- 
Aaron M. Ucko, KB1CJC (amu at alum.mit.edu, ucko at debian.org)
http://www.mit.edu/~amu/ | http://stuff.mit.edu/cgi/finger/?a...@monk.mit.edu

Adapt to the modern BLAST engine and BLAST+ legacy_blast wrapper.
* Specify an explicit gap extension cost (2) to accompany the explicit
  mismatch penalty.
* Reduce the word size to the traditional value of 11 so the test
  cases can succeed.
* Stop trying to request the old engine.
* Accommodate minor output format changes between legacy BLAST and
  BLAST+.      
--- a/pynast/util.py
+++ b/pynast/util.py
@@ -147,7 +147,7 @@ def blast_align_unaligned_seqs(seqs,
     
     # Note: -S 1 indicated that we don't want to blast both orientations -- at
     # this would be different behavior than other pairwise aligners.
-    bl2seq_res = system('bl2seq -i %s -j %s -o %s -F F -S 1 -q -1 -p blastn -VT' %\
+    bl2seq_res = system('bl2seq -i %s -j %s -o %s -F F -S 1 -q -1 -E 2 -W 11 -p blastn' %\
      (in_filepath1,in_filepath2,out_filepath))
     if bl2seq_res != 0:
         raise RuntimeError, "bl2seq failed:\n %s" % bl2seq_res 
@@ -157,16 +157,16 @@ def blast_align_unaligned_seqs(seqs,
     blast_res = open(out_filepath)
     in_result = False
     for line in blast_res:
-        if line.strip().startswith('Score'):
+        if line.strip().startswith('Score = '):
             if in_result:
                 break
             else:
                 in_result = True
             
-        if line.startswith('Query: '):
+        if in_result and line.startswith('Query'):
             fields = line.split()
             query_seq.append(fields[2].upper())
-        elif line.startswith('Sbjct: '):
+        elif in_result and line.startswith('Sbjct'):
             fields = line.split()
             subject_seq.append(fields[2].upper())
         else:

Reply via email to