From 4c56371de7e5c311e624b6427a9d2be3bddd5bc7 Mon Sep 17 00:00:00 2001 From: Troubardours <arthur.lebars@gmail.com> Date: Thu, 3 Jun 2021 11:53:57 +0200 Subject: [PATCH] fixes for cases where strain and sex attributes are empty --- species_data.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/species_data.py b/species_data.py index 0882881..f2a3e7a 100644 --- a/species_data.py +++ b/species_data.py @@ -129,6 +129,9 @@ class SpeciesData: self.sex_lowercase])["not_empty"]) self.dataset_prefix = self.strain_sex + # If both strain and sex are empty attributes, change the dataset prefix to nothing instead of "_" + if self.dataset_prefix == "_": + self.dataset_prefix = "" self.genome_filename = "{0}_v{1}.fasta".format(self.dataset_prefix, self.genome_version) self.gff_filename = "{0}_OGS{1}_{2}.gff".format(self.dataset_prefix, self.ogs_version, constants.DATA_DATE.replace("-","")) -- GitLab