Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gga_load_data
Manage
Activity
Members
Labels
Plan
Issues
12
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
abims
e-infra
gga_load_data
Merge requests
!29
fix empty strain/sex
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
fix empty strain/sex
fix_empty_strain_sex_2
into
dev
Overview
0
Commits
2
Pipelines
0
Changes
1
Merged
Loraine Gueguen
requested to merge
fix_empty_strain_sex_2
into
dev
3 years ago
Overview
0
Commits
2
Pipelines
0
Changes
1
Expand
👍
0
👎
0
Merge request reports
Compare
dev
version 1
ef94ba2c
3 years ago
dev (base)
and
latest version
latest version
4c56371d
2 commits,
3 years ago
version 1
ef94ba2c
1 commit,
3 years ago
1 file
+
19
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
species_data.py
+
19
−
4
Options
@@ -70,7 +70,11 @@ 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
])
if
self
.
sex
is
None
:
self
.
sex
=
""
self
.
common_name
=
clean_string
(
parameters_dictionary_description
[
constants
.
ORG_PARAM_DESC_COMMON_NAME
])
self
.
date
=
datetime
.
today
().
strftime
(
"
%Y-%m-%d
"
)
@@ -102,8 +106,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
)
@@ -113,10 +123,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
(
"
-
"
,
""
))
Loading