[Biopython-dev] [Biopython - Bug #3419] Bio.SearchIO.FastaIO

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Thu Feb 28 07:38:20 UTC 2013


Issue #3419 has been updated by Jason Stajich.

File bll0026-vs-94.tfasty added

Here is a -m 10 report.

I made this local patch to get it to report the strands, but this is not quite right because you actually don't have a strand for the query which is the protein.

diff --git a/Bio/SearchIO/FastaIO.py b/Bio/SearchIO/FastaIO.py
index ca08797..794efb8 100644
--- a/Bio/SearchIO/FastaIO.py
+++ b/Bio/SearchIO/FastaIO.py
@@ -197,7 +197,7 @@ def _set_hsp_seqs(hsp, parsed, program):
         # set seq and alphabet
         setattr(hsp.fragment, seq_type, parsed[seq_type]['seq'])
 
-        if alphabet is not generic_protein:
+        if alphabet is not generic_protein or 'tfast' in program:
             # get strand from coordinate; start <= end is plus
             # start > end is minus
             if start <= end:

In BioPerl I solved this by writing explicit code for the TBLASTN/TFAST[XY] and BLASTX/FAST[XY] situations which then new whether the query or subject was translated DNA with a strand or input DNA.
----------------------------------------
Bug #3419: Bio.SearchIO.FastaIO
https://redmine.open-bio.org/issues/3419

Author: Jason Stajich
Status: New
Priority: Low
Assignee: Biopython Dev Mailing List
Category: Main Distribution
Target version: 
URL: 


The strand of the translated sequence (query or subject depending on the analysis) is lost for tfastxy and fastx/y reports.

from Bio import SearchIO
qresults = SearchIO.parse('test.FASTY.out','fasta-m10')
for qresult in qresults:
    for hit in qresult:
        for hsp in hit.hsps:
                print qresult.id, " ", hit.id, " ", \
                hsp.query_start, "..",hsp.query_end, " ", hsp.query_strand, " ", \
                hsp.hit_start, "..",hsp.hit_end, " ", hsp.hit_strand


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org




More information about the Biopython-dev mailing list