Bloguero_Connor
By: a guest | Feb 28th, 2008 | Syntax:
Python | Size: 0.61 KB | Hits: 13 | Expires: Never
from Bio import SeqIO
from Bio.Blast import NCBIXML
def blastcomp(fastafile,blastfile):
handle = open(fastafile)
fastanames=set()
#Reads the fasta names
for record in SeqIO.parse(handle, "fasta") :
fastanames.add(record.name)
handle.close()
blastnames=set()
#Reads the blast names
b_records=NCBIXML.parse(open(blastfile))
for b_record in b_records:
blastnames.add(b_record.query)
return fastanames.difference(blastnames)
blastfile="/home/sbassi/bioinfo/INTA/filtracMT.xml"
fastafile='INTA/allfiltrados.txt'
print blastcomp(fastafile,blastfile)