Skip to content

Commit

Permalink
Add antibiotics to tab-separated output file
Browse files Browse the repository at this point in the history
  • Loading branch information
zclaas committed Aug 17, 2023
1 parent b51404c commit a2e7e15
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/ConvertRGIJsonToTSV.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def run(self):
"Nudged",
"Note",
"Hit_Start",
"Hit_End"])
"Hit_End",
"Antibiotic"])

if os.path.isfile(self.filepath):
with open(self.filepath) as rgi_file:
Expand Down Expand Up @@ -258,7 +259,9 @@ def run(self):
nudged,
note,
rgi_data[hsp][ordered[0]]["hit_start"],
rgi_data[hsp][ordered[0]]["hit_end"]
rgi_data[hsp][ordered[0]]["hit_end"],
"; ".join(rgi_data[hsp][ordered[0]]["ARO_category"][x]["category_aro_name"] for x in rgi_data[hsp][ordered[0]]["ARO_category"] \
if rgi_data[hsp][ordered[0]]["ARO_category"][x]["category_aro_class_name"] == 'Antibiotic')
]
for key, value in match_dict.items():
writer.writerow(value)
Expand Down Expand Up @@ -321,7 +324,9 @@ def run(self):
nudged,
note,
rgi_data[hsp][ordered[0]]["hit_start"],
rgi_data[hsp][ordered[0]]["hit_end"]
rgi_data[hsp][ordered[0]]["hit_end"],
"; ".join(rgi_data[hsp][ordered[0]]["ARO_category"][x]["category_aro_name"] for x in rgi_data[hsp][ordered[0]]["ARO_category"] \
if rgi_data[hsp][ordered[0]]["ARO_category"][x]["category_aro_class_name"] == 'Antibiotic'),
]

for key, value in match_dict.items():
Expand Down

0 comments on commit a2e7e15

Please sign in to comment.