Skip to content
Snippets Groups Projects
Commit f6ed196a authored by Loraine Gueguen's avatar Loraine Gueguen
Browse files

Merge branch 'fix_empty_strain_sex_2' into dev

# Conflicts:
#	species_data.py
parents 827bf876 4c56371d
No related branches found
No related tags found
1 merge request!18Release v2.1.0
......@@ -72,8 +72,13 @@ class SpeciesData:
self.species = clean_string(parameters_dictionary_description[constants.ORG_PARAM_DESC_SPECIES])
self.genus = clean_string(parameters_dictionary_description[constants.ORG_PARAM_DESC_GENUS])
self.strain = clean_string(parameters_dictionary_description[constants.ORG_PARAM_DESC_STRAIN])
if self.strain is None:
self.strain = ""
self.sex = clean_string(parameters_dictionary_description[constants.ORG_PARAM_DESC_SEX])
self.common_name = parameters_dictionary_description[constants.ORG_PARAM_DESC_COMMON_NAME]
if self.sex is None:
self.sex = ""
self.common_name = parameters_dictionary_description[constants.ORG_PARAM_DESC_COMMON_NAME]
self.date = datetime.today().strftime("%Y-%m-%d")
self.origin = parameters_dictionary_description[constants.ORG_PARAM_DESC_ORIGIN]
......@@ -104,8 +109,14 @@ class SpeciesData:
self.genus_lowercase = self.genus.lower()
self.species_lowercase = self.species.lower()
self.strain_lowercase = self.strain.lower()
self.sex_lowercase = self.sex.lower()
try:
self.strain_lowercase = self.strain.lower()
except AttributeError as exc:
self.strain_lowercase = None
try:
self.sex_lowercase = self.sex.lower()
except AttributeError as exc:
self.sex_lowercase = None
self.genus_uppercase = self.genus[0].upper() + self.genus_lowercase[1:]
self.genus_species = "{0}_{1}".format(self.genus_lowercase, self.species_lowercase)
......@@ -115,10 +126,15 @@ class SpeciesData:
self.full_name_lowercase = self.full_name.lower()
self.species_folder_name = "_".join(utilities.filter_empty_not_empty_items(
[self.genus_lowercase, self.species_lowercase, self.strain.lower(),
self.sex.lower()])["not_empty"])
[self.genus_lowercase,
self.species_lowercase,
self.strain_lowercase,
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("-",""))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment