Skip to content

Commit b8b54a5

Browse files
Fixed challenges hyphen parsing. 2.4.0
1 parent c1690e0 commit b8b54a5

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

lrgasp_metrics/JSON_templates/write_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def metric_to_filename(metric):
5555
return metric
5656

5757
def main(experiment_path, rdata_path, output_path, challenge):
58-
match = challenge.split("_")[0].upper()
58+
match = challenge.split("_")[1].replace('sirvs', 'SIRV')
5959
# Set the values to pass to write_assessment_dataset contained in experiment metadata
6060
experiment = json.load(open(experiment_path, 'r'))
6161
community = "OEBC010"

lrgasp_validation/validation.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,13 @@ def validate_library_to_metadata(experiment_json):
167167

168168
def challenges_are_valid(challenges, experiment_json):
169169
for challenge in challenges:
170-
split_challenge = challenge.split("_")
171-
if experiment_json['library_preps'] not in split_challenge[2]:
170+
split_challenge = challenge.split('_')[:2]
171+
split_challenge.extend(challenge.split('_')[2].split('-'))
172+
if experiment_json.get('library_preps', '') not in split_challenge[2]:
172173
ERRORS.append(f'Library preparation in challenge {challenge} and metadata provided in experiment.json is not consistent; please ensure you selected the proper library preparation.')
173-
if experiment_json['platforms'] not in split_challenge[3]:
174+
if experiment_json.get('platforms', '') not in split_challenge[3]:
174175
ERRORS.append(f'Sequencing platform in challenge {challenge} and metadata provided in experiment.json is not consistent; please ensure you selected the proper sequencing platform.')
175-
length = experiment_json['data_category'].split("_")
176+
length = experiment_json.get('data_category', 'N_N').split("_")
176177
length = f"{length[0][0]}{length[1][0]}".upper()
177178
if length not in split_challenge[4]:
178179
ERRORS.append(f'Read length in challenge {challenge} and metadata provided in experiment.json is not consistent; please ensure you selected the proper read length.')

0 commit comments

Comments
 (0)