Hi all ^_^
Im working on a script in biopython that extracts SSR's from some plant species , blast their sequences against each other and group the results of similarity based on some coverage value .
here's the part of the code that does the filtering task and save the results to external files :
import sys
from Bio.SeqRecord import SeqRecord
from Bio.Blast import NCBIXML
right_database_names=["Right-Aegilops","Right-Brachypodium","Right-Hordeum"]
left_reverse_names=["RCLeft-Aegilops","RCLeft-Brachypodium","RCLeft-Hordeum"]
coverage=00.00
for indx,query in enumerate(left_reverse__names) :
for indx2,database in enumerate(right_database_names) :
if indx2>indx:
filtered_outname=("%s_%s"%(query,database))
outname=("%s.xml" %filtered_outname)
records=NCBIXML.parse(open(outname))
save_file1 = open("95_"+filtered_outname+".fasta", 'w')
save_file2 = open("85_"+filtered_outname+".fasta", 'w')
save_file3 = open("75_"+filtered_outname+".fasta", 'w')
for record in records :
for alignment in record.alignments:
for hsp in alignment.hsps:
if (int(hsp.align_length)<int(record.query_length)):
coverage=(int(hsp.align_length)/int(record.query_length))
if (coverage*100>=95.00):
...