From: Diane Trout Date: Mon, 25 Jul 2016 23:38:31 +0000 (-0700) Subject: The DCC has complained about me making a few common typos, so I added some checks... X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=7775b3df07c8d881203a09f05ae20ea31ed01279 The DCC has complained about me making a few common typos, so I added some checks for those cases --- 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):