-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepareDBs.py
More file actions
26 lines (18 loc) · 777 Bytes
/
Copy pathprepareDBs.py
File metadata and controls
26 lines (18 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'''
@auther: Samaneh
Preparing the database for BLAST search by creatig a new fasta file
out of the uniprot version of database excluding those sequences
which are included in reference file
'''
from Bio import SeqIO
sprotInFile = open("/home/samaneh/AHRD/data/db/uniprot_sprot.fasta","r")
referenceFile = open("/home/samaneh/eggNOG/output/clstrd_ref_myAlgo_descs.fasta","r")
excludingIds = []
for seq in SeqIO.parse(referenceFile,"fasta") :
excludingIds.append(seq.id.split("|")[1])
sprotOutFile = open("/home/samaneh/AHRD/data/db/uniprot_sprot_clstrd_myAlgo_removed.fasta", "w")
for record in SeqIO.parse(sprotInFile, "fasta"):
recordId = record.id.split("|")[1]
if recordId not in excludingIds:
SeqIO.write(record, sprotOutFile, "fasta")
sprotOutFile.close()