annotate run_galaxy.py @ 5:1dbf350629bf draft

Uploaded
author pedro_araujo
date Fri, 29 Jan 2021 16:07:29 +0000
parents f8dee15a72a4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
1
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
2
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
3 class GalaxyPrediction:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
4
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
5 def __init__(self, phage_input_type='ID', bact_input_type='ID', phage='', bacteria='', ml_model='RandomForests', run_interpro=False):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
6 import pickle
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
7 import os
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
8 import re
1
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
9 with open('files/feature_dataset', 'rb') as f:
0
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
10 dataset = pickle.load(f)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
11 self.all_phages = []
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
12 self.all_bacteria = []
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
13 for ID in dataset.index:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
14 temp_phage = ID[:ID.find('--')]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
15 temp_bacteria = ID[ID.find('--')+2:]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
16 if temp_phage not in self.all_phages:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
17 self.all_phages.append(temp_phage)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
18 if temp_bacteria not in self.all_bacteria:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
19 self.all_bacteria.append(temp_bacteria)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
20 if phage_input_type == 'ID':
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
21 phage = re.split('\W', phage.replace(' ', ''))
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
22 len_phage_id = len(phage)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
23 phage_seqs = self._retrieve_from_phage_id(phage)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
24 elif phage_input_type == 'seq_file':
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
25 phage_seqs = {}
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
26 phage_seqs['PhageFasta'] = {}
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
27 with open(phage, 'r') as f:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
28 temp = f.readlines()
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
29 count_prot = 0
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
30 prot = ''
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
31 i=0
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
32 while i < len(temp):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
33 if '>' in temp[i]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
34 if prot:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
35 phage_seqs['PhageFasta']['Protein' + str(count_prot)] = ['Unknown', prot]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
36 count_prot += 1
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
37 prot = ''
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
38 i+=1
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
39 else:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
40 prot += temp[i].strip()
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
41 i+=1
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
42 if bact_input_type == 'ID':
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
43 bacteria = re.split('\W', bacteria.replace(' ', ''))
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
44 if len(bacteria) > 1 and len_phage_id == 1 or len(bacteria) == 1:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
45 bact_seqs = self._retrieve_from_bact_id(bacteria)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
46 elif bact_input_type == 'seq_file':
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
47 bact_seqs = {}
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
48 bact_seqs['BacteriaFasta'] = {}
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
49 with open(bacteria, 'r') as f:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
50 temp = f.readlines()
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
51 count_prot = 0
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
52 prot = ''
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
53 i=0
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
54 while i < len(temp):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
55 if '>' in temp[i]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
56 if prot:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
57 bact_seqs['BacteriaFasta']['Protein' + str(count_prot)] = ['Unknown', prot]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
58 count_prot += 1
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
59 prot = ''
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
60 i+=1
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
61 else:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
62 prot += temp[i].strip()
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
63 i+=1
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
64 phage_seqs = self._find_phage_functions(phage_seqs, run_interpro)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
65 phage_seqs = self._find_phage_tails(phage_seqs)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
66
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
67 list_remove = []
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
68 for org in phage_seqs:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
69 if not phage_seqs[org]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
70 print('Could not find tails for phage ' + org + '. Deleting entry...')
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
71 list_remove.append(org)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
72 for org in list_remove:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
73 del phage_seqs[org]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
74
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
75 if phage_seqs:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
76 output = self.run_prediction(phage_seqs, bact_seqs, ml_model)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
77 self.create_output(output, phage_seqs, bact_seqs)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
78 else:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
79 with open(or_location + '/output.tsv', 'w') as f:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
80 f.write('No phage tails found in query')
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
81 for file in os.listdir('files'):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
82 if file.startswith('temp'):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
83 os.remove('files/' + file)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
84
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
85 def _retrieve_from_phage_id(self, phage):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
86 temp_phage = {}
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
87 for ID in phage:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
88 temp_phage[ID] = {}
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
89 if ID in self.all_phages:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
90 import json
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
91 with open('files/phageTails.json', encoding='utf-8') as f:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
92 phage_tails = json.loads(f.read())
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
93 temp_phage[ID] = phage_tails[ID]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
94 else:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
95 from Bio import Entrez
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
96 from Bio import SeqIO
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
97 phage = {}
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
98 Entrez.email = 'insert@email.com'
1
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
99 try:
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
100 with Entrez.efetch(db="nucleotide", rettype="gb", retmode="text", id=ID) as handle:
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
101 genome = SeqIO.read(handle, "gb")
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
102 for feat in genome.features:
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
103 if feat.type == 'CDS':
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
104 try: temp_phage[ID][feat.qualifiers['protein_id'][0]] = [feat.qualifiers['product'][0], feat.qualifiers['translation'][0]]
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
105 except: pass
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
106 except:
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
107 print(ID, 'not found in GenBank')
0
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
108 return temp_phage
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
109
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
110 def _retrieve_from_bact_id(self, bacteria):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
111 temp_bacteria = {}
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
112 for ID in bacteria:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
113 temp_bacteria[ID] = {}
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
114 if '.' in ID:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
115 ID = ID[:ID.find('.')]
1
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
116 #if ID in self.all_bacteria:
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
117 # import json
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
118 # with open('files/bacteria/' + ID + '.json', encoding='utf-8') as f:
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
119 # temp_bacteria[ID] = json.loads(f.read())
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
120 #else:
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
121 from Bio import Entrez
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
122 from Bio import SeqIO
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
123 bacteria = {}
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
124 Entrez.email = 'insert@email.com'
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
125 try:
0
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
126 with Entrez.efetch(db="nucleotide", rettype="gb", retmode="text", id=ID+'.1') as handle:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
127 genome = SeqIO.read(handle, "gb")
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
128 for feat in genome.features:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
129 if feat.type == 'CDS':
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
130 try: temp_bacteria[ID][feat.qualifiers['protein_id'][0]] = [feat.qualifiers['product'][0], feat.qualifiers['translation'][0]]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
131 except: pass
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
132 if len(genome.features) <= 5:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
133 with Entrez.efetch(db="nucleotide", rettype="gbwithparts", retmode="text", id=ID) as handle:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
134 genome = handle.readlines()
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
135 for i in range(len(genome)):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
136 if ' CDS ' in genome[i]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
137 j = i
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
138 protDone = False
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
139 while j < len(genome):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
140 if protDone:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
141 break
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
142 if '/product=' in genome[j]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
143 product = genome[j].strip()[10:]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
144 j += 1
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
145 elif '_id=' in genome[j]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
146 protKey = genome[j].strip()[13:-1]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
147 j += 1
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
148 elif '/translation=' in genome[j]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
149 protSeq = genome[j].strip()[14:]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
150 j += 1
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
151 for k in range(j, len(genome)):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
152 if genome[k].islower():
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
153 j = k
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
154 protDone = True
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
155 break
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
156 else:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
157 protSeq += genome[k].strip()
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
158 else:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
159 j += 1
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
160 temp_bacteria[ID][protKey] = [product, protSeq[:protSeq.find('"')]]
1
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
161 except:
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
162 print(ID, 'not found in GenBank')
0
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
163 return temp_bacteria
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
164
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
165 def _find_phage_functions(self, phage_dict, run_interpro):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
166 import os
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
167 import json
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
168 with open('files/known_function.json', encoding='utf-8') as F:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
169 known_function = json.loads(F.read())
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
170 with open('files/temp_database.fasta', 'w') as F:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
171 for phage in known_function:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
172 for prot in known_function[phage]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
173 F.write('>' + phage + '-' + prot + '\n' + known_function[phage][prot][1] + '\n')
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
174 os.system('makeblastdb -in files/temp_database.fasta -dbtype prot -title PhageProts -parse_seqids -out files/temp_database -logfile files/temp_log')
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
175 for org in phage_dict:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
176 with open('files/temp.fasta', 'w') as F:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
177 for prot in phage_dict[org]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
178 F.write('>' + prot + '\n' + phage_dict[org][prot][1] + '\n')
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
179 os.system('blastp -db files/temp_database -query files/temp.fasta -out files/temp_blast -num_threads 2 -outfmt 6')
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
180 phage_dict[org] = self.process_blast(phage_dict[org], known_function)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
181 if run_interpro: phage_dict[org] = self.interpro(phage_dict[org])
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
182 return phage_dict
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
183
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
184 def process_blast(self, phage_dict, known_function):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
185 import pandas as pd
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
186 import re
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
187 blast_domains = pd.read_csv('files/temp_blast', sep='\t', header=None)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
188 for prot in phage_dict:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
189 func = phage_dict[prot][0]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
190 known = False
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
191 if (not any(i in func.lower() for i in ['hypothetical', 'unknown', 'kda', 'uncharacterized', 'hyphothetical']) and len(func) > 3) and not ('gp' in func.lower() and len(func.split(' ')) < 2) and not (len(func.split(' ')) == 1 and len(func) < 5):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
192 known = True
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
193 if not known:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
194 evalue = []
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
195 bitscore = []
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
196 pred = blast_domains[blast_domains[0] == prot]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
197 if pred.shape[0] == 0: break
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
198 for i in pred[10]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
199 evalue.append(float(i))
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
200 for i in pred[11]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
201 bitscore.append(float(i))
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
202 if min(evalue) < 1.0 and max(bitscore) > 30.0:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
203 ind = evalue.index(min(evalue))
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
204 if ind != bitscore.index(max(bitscore)):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
205 ind = bitscore.index(max(bitscore))
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
206 temp = pred.iloc[ind, 1]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
207 known_phage = temp[:temp.find('-')]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
208 known_prot = temp[temp.find('-') + 1:]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
209 if known_function[known_phage][known_prot]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
210 new_func = known_function[known_phage][known_prot][0]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
211 # for j in known_function.keys():
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
212 # if pred.iloc[ind, 1] in known_function[j].keys():
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
213 # new_func = known_function[j][pred.iloc[ind, 1]][0]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
214 # break
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
215 x = re.findall('(Gp\d{2,}[^,\d -]|Gp\d{1}[^,\d -])', temp) # se tiver hits, remover
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
216 if not any(z in new_func.lower() for z in ['unknown', 'ucp', 'uncharacterized', 'consensus']) and len(new_func) > 3 and not x:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
217 phage_dict[prot][0] = new_func
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
218 return phage_dict
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
219
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
220 def interpro(self, phage_dict):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
221 import os
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
222 import pandas as pd
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
223 import re
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
224 os.system('interproscan.sh -b ' + 'files/temp_interpro -i ' + 'files/temp.fasta -f tsv > files/temp_interpro_log')
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
225 domains = pd.read_csv('files/temp_interpro.tsv', sep='\t', index_col=0, header=None, names=list(range(13)))
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
226 domains = domains.fillna('-')
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
227 domains = domains[domains.loc[:, 3] != 'Coils']
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
228 domains = domains[domains.loc[:, 3] != 'MobiDBLite']
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
229 for prot in phage_dict:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
230 func = phage_dict[prot][0]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
231 known = False
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
232 if (not any(i in func.lower() for i in ['hypothetical', 'unknown', 'kda', 'uncharacterized', 'hyphothetical']) and len(func) > 3) and not ('gp' in func.lower() and len(func.split(' ')) < 2) and not (len(func.split(' ')) == 1 and len(func) < 5):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
233 known = True
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
234 if prot in domains.index and not known:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
235 temp = '-'
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
236 try:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
237 for i in range(domains.loc[prot, :].shape[0]):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
238 if '-' not in domains.loc[prot, 12].iloc[i].lower():
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
239 if float(domains.loc[prot, 8].iloc[i]) < 1.0:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
240 temp = domains.loc[prot, 12].iloc[i]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
241 break
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
242 except:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
243 if float(domains.loc[prot, 8]) < 1.0:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
244 temp = domains.loc[prot, 12]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
245 x = re.findall('(Gp\d{2,}[^,\d -]|Gp\d{1}[^,\d -])', temp) # se tiver hits, remover
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
246 if temp != '-' and not any(z in temp.lower() for z in ['unknown', 'ucp', 'uncharacterized', 'consensus']) and len(temp) > 3 and not x:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
247 phage_dict[prot][0] = temp
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
248 else:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
249 try:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
250 for i in range(domains.loc[prot, :].shape[0]):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
251 if '-' not in domains.loc[prot, 5].iloc[i].lower():
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
252 temp = domains.loc[prot, 5].iloc[i]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
253 break
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
254 except:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
255 temp = domains.loc[prot, 5]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
256 x = re.findall('(Gp\d{2,}[^,\d -]|Gp\d{1}[^,\d -])', temp)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
257 if temp != '-' and not any(z in temp.lower() for z in ['unknown', 'ucp', 'uncharacterized', 'consensus']) and len(temp) > 3 and not x:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
258 phage_dict[prot][0] = temp
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
259 return phage_dict
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
260
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
261 def _find_phage_tails(self, phage_dict):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
262 for org in phage_dict:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
263 list_remove = []
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
264 for protein in phage_dict[org]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
265 if any(z in phage_dict[org][protein][0].lower() for z in ['fiber', 'fibre', 'spike', 'hydrolase', 'bind', 'depolymerase', 'peptidase', 'lyase', 'sialidase', 'dextranase', 'lipase', 'adhesin', 'baseplate', 'protein h', 'recognizing', 'protein j', 'protein g', 'gpe', 'duf4035', 'host specifity', 'cor protein', 'specificity', 'baseplate component', 'gp38', 'gp12 tail', 'receptor', 'recognition', 'tail']) \
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
266 and not any(z in phage_dict[org][protein][0].lower() for z in ['nucle', 'dna', 'rna', 'ligase', 'transferase', 'inhibitor', 'assembly', 'connect', 'nudix', 'atp', 'nad', 'transpos', 'ntp', 'molybdenum', 'hns', 'gtp', 'riib', 'inhibitor', 'replicat', 'codon', 'pyruvate', 'catalyst', 'hinge', 'sheath completion', 'head', 'capsid', 'tape', 'tip', 'strand', 'matur', 'portal', 'terminase', 'nucl', 'promot', 'block', 'olfact', 'wedge', 'lysozyme', 'mur', 'sheat']):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
267 pass
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
268 else:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
269 list_remove.append(protein)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
270 for protein in list_remove:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
271 del phage_dict[org][protein]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
272 return phage_dict
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
273
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
274 def run_prediction(self, phage_dict, bact_dict, ml_model):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
275 from feature_construction import FeatureConstruction
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
276 import pickle
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
277 from sklearn.preprocessing import LabelEncoder
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
278 from sklearn.preprocessing import StandardScaler
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
279 import numpy as np
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
280
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
281 if ml_model == 'RandomForests':
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
282 with open('files/dataset_reduced', 'rb') as f:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
283 dataset = pickle.load(f)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
284 columns_remove = [3, 7, 9, 11, 24, 28, 32, 34, 38, 42, 45, 52, 53, 61, 65, 73, 75, 79, 104, 122, 141, 151, 154, 155, 157, 159, 160, 161, 163, 165, 169, 170, 173, 176, 178, 180, 182, 183, 185, 186, 187, 190, 193, 194, 196, 197, 201, 202, 203, 206, 207, 209, 210, 212, 216, 217, 221, 223, 225, 226, 230, 233, 235, 236, 245, 251]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
285 elif ml_model == 'SVM':
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
286 with open('files/feature_dataset', 'rb') as f:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
287 dataset = pickle.load(f)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
288 columns_remove = []
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
289
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
290 dataset = dataset.dropna()
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
291 le = LabelEncoder()
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
292 le.fit(['Yes', 'No'])
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
293 output = le.transform(dataset['Infects'].values)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
294 dataset = dataset.drop('Infects', 1)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
295 scaler = StandardScaler()
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
296 scaler.fit(dataset)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
297 data_z = scaler.transform(dataset)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
298
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
299 fc = FeatureConstruction()
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
300 solution = []
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
301 for phage in phage_dict:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
302 for bacteria in bact_dict:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
303 temp_solution = np.array([])
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
304 temp_solution = np.append(temp_solution, fc.get_grouping(phage_dict[phage], bact_dict[bacteria]))
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
305 temp_solution = np.append(temp_solution, fc.get_composition(phage_dict[phage], bact_dict[bacteria]))
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
306 temp_solution = np.append(temp_solution, fc.get_kmers(phage_dict[phage], bact_dict[bacteria]))
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
307 temp_solution = temp_solution.reshape(1, -1)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
308 if columns_remove:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
309 temp_solution = np.delete(temp_solution, columns_remove, 1)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
310 if phage in self.all_phages:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
311 for ID in dataset.index:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
312 if phage in ID:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
313 for i in range(len(dataset.loc[ID].index)):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
314 if 'phage' in dataset.loc[ID].index[i]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
315 temp_solution[0][i] = dataset.loc[ID, dataset.loc[ID].index[i]]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
316 break
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
317 if bacteria in self.all_bacteria:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
318 for ID in dataset.index:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
319 if bacteria in ID:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
320 for i in range(len(dataset.loc[ID].index)):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
321 if 'bact' in dataset.loc[ID].index[i]:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
322 temp_solution[0][i] = dataset.loc[ID, dataset.loc[ID].index[i]]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
323 break
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
324 if type(solution) != np.ndarray:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
325 solution = temp_solution
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
326 else:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
327 solution = np.append(solution, temp_solution, axis=0)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
328 # solution = solution.reshape(1, -1)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
329 solution = scaler.transform(solution)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
330
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
331 if ml_model == 'RandomForests':
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
332 from sklearn.ensemble import RandomForestClassifier
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
333 clf = RandomForestClassifier(n_estimators=200, bootstrap=False, criterion='gini', min_samples_leaf=2, min_samples_split=4, oob_score=False)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
334 clf = clf.fit(data_z, output)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
335 elif ml_model == 'SVM':
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
336 from sklearn.svm import SVC
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
337 clf = SVC(C=10, degree=2, gamma='auto', kernel='rbf')
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
338 clf = clf.fit(data_z, output)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
339 pred = clf.predict(solution)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
340 pred = list(le.inverse_transform(pred))
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
341 return pred
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
342
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
343 def create_output(self, output, phage_seqs, bact_seqs):
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
344 import pandas as pd
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
345 list_orgs = []
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
346 for phage in phage_seqs:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
347 for bact in bact_seqs:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
348 list_orgs.append(phage + ' - ' + bact)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
349 file = pd.DataFrame({'Phage - Bacteria': list_orgs, 'Infects': output})
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
350 file.to_csv('files/output.tsv', sep='\t', index=False, header=True)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
351 file.to_csv(or_location + '/output.tsv', sep='\t', index=False, header=True)
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
352
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
353
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
354 if __name__ == '__main__':
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
355 import sys
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
356 import os
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
357 global or_location
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
358 or_location = os.getcwd()
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
359 os.chdir(os.path.dirname(__file__))
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
360
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
361 phage_input_type = sys.argv[1]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
362 Phages = sys.argv[2]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
363 bact_input_type = sys.argv[3]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
364 Bacts = sys.argv[4]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
365 run_interpro = sys.argv[5]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
366 if run_interpro == 'True':
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
367 run_interpro = True
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
368 else:
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
369 run_interpro = False
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
370 model = sys.argv[6]
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
371 GalaxyPrediction(phage_input_type=phage_input_type, bact_input_type=bact_input_type, phage=Phages, bacteria=Bacts, ml_model=model, run_interpro=run_interpro)
1
f8dee15a72a4 Uploaded
pedro_araujo
parents: 0
diff changeset
372 #rg = GalaxyPrediction(phage_input_type='ID', bact_input_type='ID', phage='NC_050154', bacteria='NC_007414,NZ_MK033499,NZ_CP031214')
0
e4b3fc88efe0 Uploaded
pedro_araujo
parents:
diff changeset
373 # GalaxyPrediction(phage_input_type='ID', bact_input_type='ID', phage='NC_031087,NC_049833,NC_049838,NC_049444', bacteria='LR133964', ml_model='SVM')