From 7775b3df07c8d881203a09f05ae20ea31ed01279 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Mon, 25 Jul 2016 16:38:31 -0700 Subject: [PATCH] The DCC has complained about me making a few common typos, so I added some checks for those cases --- htsworkflow/submission/encoded.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htsworkflow/submission/encoded.py b/htsworkflow/submission/encoded.py index 2e91a60..dc546ea 100644 --- a/htsworkflow/submission/encoded.py +++ b/htsworkflow/submission/encoded.py @@ -537,6 +537,20 @@ class ENCODED: del hidden['@type'] jsonschema.validate(hidden, schema) + # Additional validation rules passed down from the DCC for our grant + assay_term_name = hidden.get('assay_term_name') + if assay_term_name is not None: + if assay_term_name.lower() == 'rna-seq': + if assay_term_name != 'RNA-seq': + raise jsonschema.ValidationError('Incorrect capitialization of RNA-seq') + + species = hidden.get('species') + if species == '/organisms/human/': + model_age_terms = ['model_organism_age', 'model_organism_age_units'] + for term in model_age_terms: + if term in obj: + raise jsonschema.ValidationError('model age terms not needed in human') + class TypedColumnParser(object): @staticmethod def parse_sheet_array_type(value): -- 2.30.2