Users should be able to make db from multiple fasta files. This is very useful if the organism has plasmids. example code below:
blast_dir = os.path.join('..','data','blastdb')if not os.path.exists(blast_dir):
os.makedirs(blast_dir)
for org in orgs:
fasta_file = os.path.join('..','data','cds',org+'.fna')
records = SeqIO.parse(fasta_file,'fasta')
result = []
id_list = []
for record in records:
record.id = re.search(r'\[locus_tag=(.*?)\]',record.description).groups()[0]
# Ignore duplicate sequences
if record.id not in id_list:
id_list.append(record.id)
result.append(record)
new_fasta_file = os.path.join(blast_dir,org+'.fna')
SeqIO.write(result,new_fasta_file,'fasta')`
Users should be able to make db from multiple fasta files. This is very useful if the organism has plasmids. example code below: