diff --git a/gecco/cli/commands/convert.py b/gecco/cli/commands/convert.py index 07f8b59..756711b 100644 --- a/gecco/cli/commands/convert.py +++ b/gecco/cli/commands/convert.py @@ -133,7 +133,7 @@ def _convert_gbk_bigslice(self, ctx: contextlib.ExitStack) -> None: record.features.append(subregion_feature) # rename the {id}_cluster_{N}.gbk file to {id}.region{N}.gbk gbk_name = os.path.basename(gbk_file) - contig_id, cluster_n = re.search("^(.*)_cluster_(\d+).gbk", gbk_file).groups() # type: ignore + contig_id, cluster_n = re.search("^(.*)_cluster_(\d+).gbk", gbk_name).groups() # type: ignore new_name = os.path.join(self.input_dir, "{}.region{:03}.gbk".format(contig_id, int(cluster_n))) self.info(f"Rewriting {gbk_file!r} to {new_name!r}") Bio.SeqIO.write(record, new_name, "genbank")