Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 26 lines (20 sloc) 539 Bytes
#!/usr/bin/python
from splitter import splitter
import sys
from blast_parser import *
def all_uniq_subjects(blast):
subjects = set()
subj_field = BlastFields.index('Subject id')
read_blast(blast,
lambda x : True,
lambda x : subjects.add('>'+extract_blast_fields(x, subj_field)[0])
)
f = open(blast+'.csv', 'w')
def pr(x):
print >> f, x
map(pr, subjects)
return subjects
if __name__=='__main__':
linecounter=0
linethreshold=65535
map(all_uniq_subjects, sys.argv[1:])