-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerateCompetitors.py
More file actions
36 lines (26 loc) · 967 Bytes
/
Copy pathgenerateCompetitors.py
File metadata and controls
36 lines (26 loc) · 967 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
25
26
27
28
29
30
31
32
33
34
'''
@auther: Samaneh
'''
from Bio import SeqIO
import re
######################################################################
eggnog = open("/home/samaneh/eggNOG/output/clstrd_ref_eggNOG_descs.fasta", "r")
eggnogCom = open("/home/samaneh/eggNOG/output/clstrd_ref_eggNOG_descs.tsv", "w")
myAlgo = open("/home/samaneh/eggNOG/output/clstrd_ref_myAlgo_descs.fasta", "r")
myAlgoCom = open("/home/samaneh/eggNOG/output/clstrd_ref_myAlgo_descs.tsv", "w")
for record in SeqIO.parse(eggnog, "fasta"):
ac = record.id.strip(" ")
desc = record.description.strip(record.name).lstrip(" ")
desc = re.sub("OS=.*", "", desc)
eggnogCom.write(ac)
eggnogCom.write("\t")
eggnogCom.write(desc)
eggnogCom.write("\n")
for record in SeqIO.parse(myAlgo, "fasta"):
ac = record.id.strip(" ")
desc = record.description.strip(record.name).lstrip(" ")
desc = re.sub("OS=.*", "", desc)
myAlgoCom.write(ac)
myAlgoCom.write("\t")
myAlgoCom.write(desc)
myAlgoCom.write("\n")