annotate lrn_risk.py @ 1:f98c92618a6c draft

Uploaded
author greg
date Fri, 28 Apr 2023 15:06:29 +0000
parents 99e04eba4033
children 8dc6d4aa17ec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
99e04eba4033 Uploaded
greg
parents:
diff changeset
1 #!/usr/bin/env python
99e04eba4033 Uploaded
greg
parents:
diff changeset
2
99e04eba4033 Uploaded
greg
parents:
diff changeset
3 import argparse
99e04eba4033 Uploaded
greg
parents:
diff changeset
4
99e04eba4033 Uploaded
greg
parents:
diff changeset
5
99e04eba4033 Uploaded
greg
parents:
diff changeset
6 BLACKLIST_HEADER = ['Blacklisted Gene', 'Reason', 'Risk Category']
99e04eba4033 Uploaded
greg
parents:
diff changeset
7 VFDB_HEADER = ['Gene', 'Contig', '% Identity', '% Coverage', 'E-Value', 'Annotation', 'Comparison to Publicly Available Genomes']
99e04eba4033 Uploaded
greg
parents:
diff changeset
8
99e04eba4033 Uploaded
greg
parents:
diff changeset
9
99e04eba4033 Uploaded
greg
parents:
diff changeset
10 def get_species_from_gtdb(f):
99e04eba4033 Uploaded
greg
parents:
diff changeset
11 # get GTDB species
99e04eba4033 Uploaded
greg
parents:
diff changeset
12 # assumes there is one genome in the GTDB-Tk output file
99e04eba4033 Uploaded
greg
parents:
diff changeset
13 with open(f, 'r') as fh:
1
f98c92618a6c Uploaded
greg
parents: 0
diff changeset
14 for i, line in enumerate(fh):
f98c92618a6c Uploaded
greg
parents: 0
diff changeset
15 if i == 0:
f98c92618a6c Uploaded
greg
parents: 0
diff changeset
16 # Skip header.
f98c92618a6c Uploaded
greg
parents: 0
diff changeset
17 continue
f98c92618a6c Uploaded
greg
parents: 0
diff changeset
18 items = line.split('\t')
f98c92618a6c Uploaded
greg
parents: 0
diff changeset
19 tax = items[1].strip()
f98c92618a6c Uploaded
greg
parents: 0
diff changeset
20 tax = tax.split(';')[-1].strip()
f98c92618a6c Uploaded
greg
parents: 0
diff changeset
21 # split on GTDB species tag
f98c92618a6c Uploaded
greg
parents: 0
diff changeset
22 tax = tax.split('s__')[1].strip()
f98c92618a6c Uploaded
greg
parents: 0
diff changeset
23 if len(tax) == 0:
f98c92618a6c Uploaded
greg
parents: 0
diff changeset
24 tax = '(Unknown Species)'
0
99e04eba4033 Uploaded
greg
parents:
diff changeset
25 return tax
99e04eba4033 Uploaded
greg
parents:
diff changeset
26
99e04eba4033 Uploaded
greg
parents:
diff changeset
27
99e04eba4033 Uploaded
greg
parents:
diff changeset
28 def get_blast_genes(f):
99e04eba4033 Uploaded
greg
parents:
diff changeset
29 # reads genes detected via BLAST
99e04eba4033 Uploaded
greg
parents:
diff changeset
30 # BLAST header is as follows:
99e04eba4033 Uploaded
greg
parents:
diff changeset
31 # qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore nident qlen
99e04eba4033 Uploaded
greg
parents:
diff changeset
32 d = {}
99e04eba4033 Uploaded
greg
parents:
diff changeset
33 with open(f, 'r') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
34 for line in fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
35 items = line.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
36 gene = items[0]
99e04eba4033 Uploaded
greg
parents:
diff changeset
37 # contig = items[1]
99e04eba4033 Uploaded
greg
parents:
diff changeset
38 # pid = items[2]
99e04eba4033 Uploaded
greg
parents:
diff changeset
39 alen = items[3]
99e04eba4033 Uploaded
greg
parents:
diff changeset
40 # e = items[-4]
99e04eba4033 Uploaded
greg
parents:
diff changeset
41 qlen = items[-1]
99e04eba4033 Uploaded
greg
parents:
diff changeset
42 # calculate query coverage by dividing alignment length by query length
99e04eba4033 Uploaded
greg
parents:
diff changeset
43 qcov = round(float(alen) / float(qlen) * 100.0, 2)
99e04eba4033 Uploaded
greg
parents:
diff changeset
44 if gene not in d.keys():
99e04eba4033 Uploaded
greg
parents:
diff changeset
45 d[gene] = []
99e04eba4033 Uploaded
greg
parents:
diff changeset
46 d[gene].append('%s\t%s' % (line, str(qcov)))
99e04eba4033 Uploaded
greg
parents:
diff changeset
47 return d
99e04eba4033 Uploaded
greg
parents:
diff changeset
48
99e04eba4033 Uploaded
greg
parents:
diff changeset
49
99e04eba4033 Uploaded
greg
parents:
diff changeset
50 def get_blacklist(v, b):
99e04eba4033 Uploaded
greg
parents:
diff changeset
51 # identify high-risk isolates based on blacklisted genes
99e04eba4033 Uploaded
greg
parents:
diff changeset
52 # blacklisted genes file contains two columns:
99e04eba4033 Uploaded
greg
parents:
diff changeset
53 # column 0=the gene name as it appears in the gene database
99e04eba4033 Uploaded
greg
parents:
diff changeset
54 # column 1=the reason why the gene was blacklisted, which will be reported
99e04eba4033 Uploaded
greg
parents:
diff changeset
55 # e.g., 'ANTHRAX TOXIN'
99e04eba4033 Uploaded
greg
parents:
diff changeset
56 bdict = {}
99e04eba4033 Uploaded
greg
parents:
diff changeset
57 with open(b, 'r') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
58 for line in fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
59 items = line.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
60 gene = items[0].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
61 val = items[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
62 bdict[gene] = val
99e04eba4033 Uploaded
greg
parents:
diff changeset
63 blacklist_present = {}
99e04eba4033 Uploaded
greg
parents:
diff changeset
64 for key in v.keys():
99e04eba4033 Uploaded
greg
parents:
diff changeset
65 if key in bdict.keys():
99e04eba4033 Uploaded
greg
parents:
diff changeset
66 val = bdict[key]
99e04eba4033 Uploaded
greg
parents:
diff changeset
67 blacklist_present[key] = val
99e04eba4033 Uploaded
greg
parents:
diff changeset
68 return blacklist_present
99e04eba4033 Uploaded
greg
parents:
diff changeset
69
99e04eba4033 Uploaded
greg
parents:
diff changeset
70
99e04eba4033 Uploaded
greg
parents:
diff changeset
71 def gene_dist(f, blast, gtdb):
99e04eba4033 Uploaded
greg
parents:
diff changeset
72 # get within-species prevalence of genes
99e04eba4033 Uploaded
greg
parents:
diff changeset
73 # for virulence factors (VFs): uses VFDB VFs detected via ABRicate's VFDB db
99e04eba4033 Uploaded
greg
parents:
diff changeset
74 # for AMR genes: uses AMR genes detected via ABRicate's ResFinder db
99e04eba4033 Uploaded
greg
parents:
diff changeset
75 # for VFs and AMR genes: genes were detected via ABRicate XXX
99e04eba4033 Uploaded
greg
parents:
diff changeset
76 # minimum nucleotide identity and coverage values >=80%
99e04eba4033 Uploaded
greg
parents:
diff changeset
77 # total of 61,161 genomes queried
99e04eba4033 Uploaded
greg
parents:
diff changeset
78 # takes VFDB or AMR gene distribution file as input (f)
99e04eba4033 Uploaded
greg
parents:
diff changeset
79 # BLAST file of VFDB or AMR genes (blast)
99e04eba4033 Uploaded
greg
parents:
diff changeset
80 # GTDB species (gtdb)
99e04eba4033 Uploaded
greg
parents:
diff changeset
81 # create dictionaries based on gene distribution
99e04eba4033 Uploaded
greg
parents:
diff changeset
82 d = {}
99e04eba4033 Uploaded
greg
parents:
diff changeset
83 annd = {}
99e04eba4033 Uploaded
greg
parents:
diff changeset
84 gtdbd = {}
99e04eba4033 Uploaded
greg
parents:
diff changeset
85 with open(f, 'r') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
86 for line in fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
87 items = line.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
88 tax = items[0].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
89 tax = tax.split('s__')[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
90 if len(tax) == 0:
99e04eba4033 Uploaded
greg
parents:
diff changeset
91 tax = '(Unknown Species)'
99e04eba4033 Uploaded
greg
parents:
diff changeset
92 gene = items[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
93 ann = items[-1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
94 denom = items[3].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
95 d['%s___%s' % (tax, gene)] = line
99e04eba4033 Uploaded
greg
parents:
diff changeset
96 annd[gene] = ann
99e04eba4033 Uploaded
greg
parents:
diff changeset
97 gtdbd[tax] = denom
99e04eba4033 Uploaded
greg
parents:
diff changeset
98 # parse BLAST results
99e04eba4033 Uploaded
greg
parents:
diff changeset
99 finallines = []
99e04eba4033 Uploaded
greg
parents:
diff changeset
100 for key in blast.keys():
99e04eba4033 Uploaded
greg
parents:
diff changeset
101 blastval = blast[key]
99e04eba4033 Uploaded
greg
parents:
diff changeset
102 for bv in blastval:
99e04eba4033 Uploaded
greg
parents:
diff changeset
103 testkey = '%s___%s' % (gtdb, key)
99e04eba4033 Uploaded
greg
parents:
diff changeset
104 if testkey in d.keys() and gtdb != '(Unknown Species)':
99e04eba4033 Uploaded
greg
parents:
diff changeset
105 taxval = d[testkey]
99e04eba4033 Uploaded
greg
parents:
diff changeset
106 items = taxval.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
107 tax = items[0].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
108 tax = tax.split('s__')[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
109 if len(tax) == 0:
99e04eba4033 Uploaded
greg
parents:
diff changeset
110 tax = '(Unknown Species)'
99e04eba4033 Uploaded
greg
parents:
diff changeset
111 gene = items[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
112 pres = items[2].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
113 denom = items[3].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
114 perc = items[4].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
115 perc = str(round(float(perc), 2))
99e04eba4033 Uploaded
greg
parents:
diff changeset
116 ann = items[-1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
117 freetext = 'Gene {0} has been detected in {1}% of {2} genomes ({3} of {4} genomes queried)'.format(gene, perc, tax, pres, denom)
99e04eba4033 Uploaded
greg
parents:
diff changeset
118 elif gtdb != '(Unknown Species)':
99e04eba4033 Uploaded
greg
parents:
diff changeset
119 ann = annd[key]
99e04eba4033 Uploaded
greg
parents:
diff changeset
120 denom = gtdbd[gtdb]
99e04eba4033 Uploaded
greg
parents:
diff changeset
121 freetext = 'WARNING: Gene {0} ({1}) has never been detected in species {2} (n={3} genomes queried)! Interpret with caution!'.format(key, ann, gtdb, denom)
99e04eba4033 Uploaded
greg
parents:
diff changeset
122 else:
99e04eba4033 Uploaded
greg
parents:
diff changeset
123 ann = annd[key]
99e04eba4033 Uploaded
greg
parents:
diff changeset
124 freetext = 'WARNING: Genome belongs to an undescribed species. Interpret with caution!'
99e04eba4033 Uploaded
greg
parents:
diff changeset
125 finalline = '%s\t%s\t%s' % (bv, ann, freetext)
99e04eba4033 Uploaded
greg
parents:
diff changeset
126 finallines.append(finalline)
99e04eba4033 Uploaded
greg
parents:
diff changeset
127 return finallines
99e04eba4033 Uploaded
greg
parents:
diff changeset
128
99e04eba4033 Uploaded
greg
parents:
diff changeset
129
99e04eba4033 Uploaded
greg
parents:
diff changeset
130 def output_blacklist(blacklist, blacklist_output_file):
99e04eba4033 Uploaded
greg
parents:
diff changeset
131 # takes detected blacklisted genes as input (blacklist)
99e04eba4033 Uploaded
greg
parents:
diff changeset
132 # blacklist results
99e04eba4033 Uploaded
greg
parents:
diff changeset
133 with open(blacklist_output_file, 'w') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
134 fh.write('%s\n' % '\t'.join(BLACKLIST_HEADER))
99e04eba4033 Uploaded
greg
parents:
diff changeset
135 if len(blacklist.keys()) == 0:
99e04eba4033 Uploaded
greg
parents:
diff changeset
136 # print this if no blacklisted genes are detected
99e04eba4033 Uploaded
greg
parents:
diff changeset
137 fh.write('(No blacklisted genes detected)\tNA\tNot high risk\n')
99e04eba4033 Uploaded
greg
parents:
diff changeset
138 else:
99e04eba4033 Uploaded
greg
parents:
diff changeset
139 # print this if blacklisted genes are detected
99e04eba4033 Uploaded
greg
parents:
diff changeset
140 # print a table with one row per detected blacklisted gene
99e04eba4033 Uploaded
greg
parents:
diff changeset
141 for key in blacklist.keys():
99e04eba4033 Uploaded
greg
parents:
diff changeset
142 val = blacklist[key]
99e04eba4033 Uploaded
greg
parents:
diff changeset
143 fh.write('%s\t%s\tHIGH RISK\n' % (key, val))
99e04eba4033 Uploaded
greg
parents:
diff changeset
144
99e04eba4033 Uploaded
greg
parents:
diff changeset
145
99e04eba4033 Uploaded
greg
parents:
diff changeset
146 def output_vfdb(vfdist, vfdb_output_file):
99e04eba4033 Uploaded
greg
parents:
diff changeset
147 # takes distribution of virulence factors as input (vfdist)
99e04eba4033 Uploaded
greg
parents:
diff changeset
148 # VFDB results
99e04eba4033 Uploaded
greg
parents:
diff changeset
149 with open(vfdb_output_file, 'w') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
150 fh.write('%s\n' % '\t'.join(VFDB_HEADER))
99e04eba4033 Uploaded
greg
parents:
diff changeset
151 if len(vfdist) == 0:
99e04eba4033 Uploaded
greg
parents:
diff changeset
152 # print this if no VFs detected
99e04eba4033 Uploaded
greg
parents:
diff changeset
153 fh.write('%s\n' % '\t'.join(['(No VFs Detected)'] * 7))
99e04eba4033 Uploaded
greg
parents:
diff changeset
154 else:
99e04eba4033 Uploaded
greg
parents:
diff changeset
155 # print table of VFs if VFs detected
99e04eba4033 Uploaded
greg
parents:
diff changeset
156 for vline in vfdist:
99e04eba4033 Uploaded
greg
parents:
diff changeset
157 # blast_header=['Gene', 'Contig', 'Percent (%) Nucleotide Identity', 'Alignment Length', 'Mismatches', 'Gaps', 'Query Start', 'Query End', 'Subject Start', 'Subject End', 'E-Value', 'Bit Score', 'Identical Matches', 'Query Length']
99e04eba4033 Uploaded
greg
parents:
diff changeset
158 # lc_header=['Query Coverage', 'Annotation', 'Comparison to Publicly Available Genomes']
99e04eba4033 Uploaded
greg
parents:
diff changeset
159 items = vline.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
160 vgene = items[0].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
161 vcontig = items[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
162 vid = items[2].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
163 vcov = items[-3].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
164 veval = items[-7].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
165 vann = items[-2].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
166 vnotes = items[-1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
167 vfinal = [vgene, vcontig, vid, vcov, veval, vann, vnotes]
99e04eba4033 Uploaded
greg
parents:
diff changeset
168 vfinal = '\t'.join(vfinal).strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
169 fh.write('%s\n' % vfinal)
99e04eba4033 Uploaded
greg
parents:
diff changeset
170
99e04eba4033 Uploaded
greg
parents:
diff changeset
171
99e04eba4033 Uploaded
greg
parents:
diff changeset
172 def output_amr(amrdist, amr_output_file):
99e04eba4033 Uploaded
greg
parents:
diff changeset
173 # takes distribution of AMR genes as input (amrdist)
99e04eba4033 Uploaded
greg
parents:
diff changeset
174 # AMR results
99e04eba4033 Uploaded
greg
parents:
diff changeset
175 with open(amr_output_file, 'w') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
176 fh.write('%s\n' % '\t'.join(VFDB_HEADER))
99e04eba4033 Uploaded
greg
parents:
diff changeset
177 if len(amrdist) == 0:
99e04eba4033 Uploaded
greg
parents:
diff changeset
178 # print this if no AMR genes detected
99e04eba4033 Uploaded
greg
parents:
diff changeset
179 fh.write('%s\n' % '\t'.join(['(No AMR Genes Detected)'] * 7))
99e04eba4033 Uploaded
greg
parents:
diff changeset
180 else:
99e04eba4033 Uploaded
greg
parents:
diff changeset
181 # print this if AMR genes detected
99e04eba4033 Uploaded
greg
parents:
diff changeset
182 for aline in amrdist:
99e04eba4033 Uploaded
greg
parents:
diff changeset
183 # blast_header=['Gene', 'Contig', 'Percent (%) Nucleotide Identity', 'Alignment Length', 'Mismatches', 'Gaps', 'Query Start', 'Query End', 'Subject Start', 'Subject End', 'E-Value', 'Bit Score', 'Identical Matches', 'Query Length']
99e04eba4033 Uploaded
greg
parents:
diff changeset
184 # lc_header=['Query Coverage', 'Annotation', 'Comparison to Publicly Available Genomes']
99e04eba4033 Uploaded
greg
parents:
diff changeset
185 items = aline.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
186 agene = items[0].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
187 acontig = items[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
188 aid = items[2].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
189 acov = items[-3].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
190 aeval = items[-7].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
191 aann = items[-2].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
192 anotes = items[-1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
193 afinal = [agene, acontig, aid, acov, aeval, aann, anotes]
99e04eba4033 Uploaded
greg
parents:
diff changeset
194 afinal = '\t'.join(afinal).strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
195 fh.write('%s\n' % afinal)
99e04eba4033 Uploaded
greg
parents:
diff changeset
196
99e04eba4033 Uploaded
greg
parents:
diff changeset
197
99e04eba4033 Uploaded
greg
parents:
diff changeset
198 # lrnrisk_prototype arguments
99e04eba4033 Uploaded
greg
parents:
diff changeset
199 parser = argparse.ArgumentParser()
99e04eba4033 Uploaded
greg
parents:
diff changeset
200
99e04eba4033 Uploaded
greg
parents:
diff changeset
201 parser.add_argument('--gtdb_file', action='store', dest='gtdb_file', help='Path to gtdbtk tsv file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
202 parser.add_argument('--virulence_factors_file', action='store', dest='virulence_factors_file', help='Path to tsv virulence factors file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
203 parser.add_argument('--amr_determinants_file', action='store', dest='amr_determinants_file', help='Path to AMR determinants tsv file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
204 parser.add_argument('--blacklist_file', action='store', dest='blacklist_file', help='Path to blacklisted high-risk virulence factors tsv file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
205 parser.add_argument('--vf_distribution_file', action='store', dest='vf_distribution_file', help='Path to virulence factor distribution tsv file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
206 parser.add_argument('--amr_distribution_file', action='store', dest='amr_distribution_file', help='Path to AMR determinant distribution tsv file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
207 parser.add_argument('--blacklist_output_file', action='store', dest='blacklist_output_file', help='Path to blacklist output file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
208 parser.add_argument('--vfdb_output_file', action='store', dest='vfdb_output_file', help='Path to vfdb output file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
209 parser.add_argument('--amr_output_file', action='store', dest='amr_output_file', help='Path to amr output file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
210
99e04eba4033 Uploaded
greg
parents:
diff changeset
211 # parse arguments and run pipeline
99e04eba4033 Uploaded
greg
parents:
diff changeset
212 args = parser.parse_args()
99e04eba4033 Uploaded
greg
parents:
diff changeset
213
99e04eba4033 Uploaded
greg
parents:
diff changeset
214 # print_output(blacklist, vf_distribution, amr_distribution, args.output, species)
99e04eba4033 Uploaded
greg
parents:
diff changeset
215 virulence_genes = get_blast_genes(args.virulence_factors_file)
99e04eba4033 Uploaded
greg
parents:
diff changeset
216 species = get_species_from_gtdb(args.gtdb_file)
99e04eba4033 Uploaded
greg
parents:
diff changeset
217
99e04eba4033 Uploaded
greg
parents:
diff changeset
218 blacklist = get_blacklist(virulence_genes, args.blacklist_file)
99e04eba4033 Uploaded
greg
parents:
diff changeset
219 output_blacklist(blacklist, args.blacklist_output_file)
99e04eba4033 Uploaded
greg
parents:
diff changeset
220
99e04eba4033 Uploaded
greg
parents:
diff changeset
221 vf_distribution = gene_dist(args.vf_distribution_file, virulence_genes, species)
99e04eba4033 Uploaded
greg
parents:
diff changeset
222 output_vfdb(vf_distribution, args.vfdb_output_file)
99e04eba4033 Uploaded
greg
parents:
diff changeset
223
99e04eba4033 Uploaded
greg
parents:
diff changeset
224 amr_genes = get_blast_genes(args.amr_determinants_file)
99e04eba4033 Uploaded
greg
parents:
diff changeset
225 amr_distribution = gene_dist(args.amr_distribution_file, amr_genes, species)
99e04eba4033 Uploaded
greg
parents:
diff changeset
226 output_amr(amr_distribution, args.amr_output_file)