from Bio import pairwise2 from Bio import SeqIO import sys for t in SeqIO.parse(sys.argv[1], "fasta"): for q in SeqIO.parse(sys.argv[2], "fasta"): a = pairwise2.align.localms(t.seq, q.seq, 1, -3, -7, -2, one_alignment_only=1, score_only=1) print t.id, "\t", q.id, "\t", a
i was trying this script another persn posted on here. The thing is it outputs all scores for one to the other, for instance
gi|321422410|gb|ADIH01013800.1| gi|321371556|gb|AEAQ01026353.1| 245.0 gi|321422410|gb|ADIH01013800.1| gi|321372252|gb|AEAQ01025657.1|_1 266.0 gi|321422410|gb|ADIH01013800.1| gi|321393004|gb|AEAQ01005223.1| 307.0 gi|321422409|gb|ADIH01013801.1| gi|321371556|gb|AEAQ01026353.1| 266.0 gi|321422409|gb|ADIH01013801.1| gi|321372252|gb|AEAQ01025657.1|_1 299.0 gi|321422409|gb|ADIH01013801.1| gi|321393004|gb|AEAQ01005223.1| 356.0
but i only want it to output the best score for that one to the other, like for insance
gi|321422410|gb|ADIH01013800.1| gi|321393004|gb|AEAQ01005223.1| 307.0 gi|321422409|gb|ADIH01013801.1| gi|321393004|gb|AEAQ01005223.1| 356.0
is there something i could add to get it to do this. i looked up pairwise2 but thing.? thanks
Could you please clarify what your question actually is? You want to parse text or modify an output?
yes i want to modify the output. The script gives every one match to for example, A TO C gives score 56 A TO D gives score 95 B TO C gives score 65 B TP D gives score 82
and i want it to only output the best score, such that A TO D gives score 95 B TP D gives score 82