commit/galaxy-central: peterjc: Fix for BLAST XML to tabular when both query and subject have XXX masking
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/2bd9d3d0bb29/ changeset: r5596:2bd9d3d0bb29 user: peterjc date: 2011-05-18 19:43:46 summary: Fix for BLAST XML to tabular when both query and subject have XXX masking affected #: 1 file (176 bytes) --- a/tools/ncbi_blast_plus/blastxml_to_tabular.py Wed May 25 11:31:26 2011 +0200 +++ b/tools/ncbi_blast_plus/blastxml_to_tabular.py Wed May 18 18:43:46 2011 +0100 @@ -176,16 +176,19 @@ expected_mismatch = len(q_seq) \ - sum(1 for q,h in zip(q_seq, h_seq) \ if q == h or q == "-" or h == "-") - assert expected_mismatch - q_seq.count("X") <= int(mismatch) <= expected_mismatch, \ - "%s vs %s mismatches, expected %i <= %i <= %i" \ - % (qseqid, sseqid, expected_mismatch - q_seq.count("X"), int(mismatch), expected_mismatch) + xx = sum(1 for q,h in zip(q_seq, h_seq) if q=="X" and h=="X") + if not (expected_mismatch - q_seq.count("X") <= int(mismatch) <= expected_mismatch + xx): + stop_err("%s vs %s mismatches, expected %i <= %i <= %i" \ + % (qseqid, sseqid, expected_mismatch - q_seq.count("X"), + int(mismatch), expected_mismatch)) #TODO - Remove this alternative identity calculation and test #once satisifed there are no problems - expected_idendity = sum(1 for q,h in zip(q_seq, h_seq) if q == h) - assert expected_idendity <= int(nident) <= expected_idendity + q_seq.count("X"), \ - "%s vs %s identities, expected %i <= %i <= %i" \ - % (qseqid, sseqid, expected_idendity, int(identity), expected_idendity + q_seq.count("X")) + expected_identity = sum(1 for q,h in zip(q_seq, h_seq) if q == h) + if not (expected_identity - xx <= int(nident) <= expected_identity + q_seq.count("X")): + stop_err("%s vs %s identities, expected %i <= %i <= %i" \ + % (qseqid, sseqid, expected_identity, int(nident), + expected_identity + q_seq.count("X"))) evalue = hsp.findtext("Hsp_evalue") Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket