From 1e8e721122e27a7e7b3e37b770c10aef6814057d Mon Sep 17 00:00:00 2001 From: Ekaterina Sakharova Date: Thu, 16 Jul 2020 17:34:31 +0100 Subject: [PATCH] hotfix for antismash --- .../antismash/run_antismash_short.sh | 2 +- .../change_geneclusters_ctg_js.py | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/Assembly/antismash/chunking_antismash_with_conditionals/antismash/run_antismash_short.sh b/tools/Assembly/antismash/chunking_antismash_with_conditionals/antismash/run_antismash_short.sh index ca0bdf48e..38f940b95 100644 --- a/tools/Assembly/antismash/chunking_antismash_with_conditionals/antismash/run_antismash_short.sh +++ b/tools/Assembly/antismash/chunking_antismash_with_conditionals/antismash/run_antismash_short.sh @@ -9,4 +9,4 @@ done echo "run antismash" source ${CONDA_ENV} antismash && \ -antismash --smcogs --asf --disable-svg --knownclusterblast --outputfolder ${OUTFOLDER} ${INPUT} # --subclusterblast -v \ No newline at end of file +antismash --genefinding prodigal-m --smcogs --asf --disable-svg --knownclusterblast --outputfolder ${OUTFOLDER} ${INPUT} # --subclusterblast -v \ No newline at end of file diff --git a/tools/Assembly/antismash/chunking_antismash_with_conditionals/post-processing/fix_geneclusters_js/change_geneclusters_ctg_js.py b/tools/Assembly/antismash/chunking_antismash_with_conditionals/post-processing/fix_geneclusters_js/change_geneclusters_ctg_js.py index df65c0fc3..f3f359a62 100644 --- a/tools/Assembly/antismash/chunking_antismash_with_conditionals/post-processing/fix_geneclusters_js/change_geneclusters_ctg_js.py +++ b/tools/Assembly/antismash/chunking_antismash_with_conditionals/post-processing/fix_geneclusters_js/change_geneclusters_ctg_js.py @@ -24,15 +24,16 @@ for cluster in data: for locus in data[cluster]['orfs']: old_locus_tag = locus['locus_tag'] - number = old_locus_tag.split('_')[0].split('ctg')[1] - postfix = old_locus_tag.split('_')[1] + if len(old_locus_tag.split('_')[0].split('ctg')) > 1: + number = old_locus_tag.split('_')[0].split('ctg')[1] + postfix = old_locus_tag.split('_')[1] - limit = min(NAME_LIMIT - 1 - len(number), len(accession) - 1) - name = accession[0:limit] + limit = min(NAME_LIMIT - 1 - len(number), len(accession) - 1) + name = accession[0:limit] - new_locus_tag = name + '-' + number + '_' + postfix - locus['locus_tag'] = new_locus_tag - description = locus['description'] - locus['description'] = description.replace(old_locus_tag, new_locus_tag) + new_locus_tag = name + '-' + number + '_' + postfix + locus['locus_tag'] = new_locus_tag + description = locus['description'] + locus['description'] = description.replace(old_locus_tag, new_locus_tag) json.dump(data, out_json)