Skip to content

Commit 3510c4f

Browse files
committed
make MGE key only be created if integron_finder has results
1 parent a7d2f6f commit 3510c4f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

falmeida_py/mges_function.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ def mges_stats(bacannot_summary):
1414

1515
# load dir of samples' results
1616
results_dir = bacannot_summary[sample]['results_dir']
17-
18-
# init MGE annotation dictionary
19-
bacannot_summary[sample]['MGE'] = {}
2017

2118
# integron_finder
2219
if os.path.exists(f"{results_dir}/integron_finder/{sample}_integrons.gff") and os.stat(f"{results_dir}/integron_finder/{sample}_integrons.gff").st_size > 0:
2320

21+
# init MGE annotation dictionary
22+
if 'MGE' not in bacannot_summary[sample]:
23+
bacannot_summary[sample]['MGE'] = {}
24+
2425
# init integron_finder annotation dictionary
2526
bacannot_summary[sample]['MGE']['integron_finder'] = {}
2627

0 commit comments

Comments
 (0)