def testDataExists(self): """ Test that count of ALL_Cre_Cache is non-zero and is equal to or greater than the count of recombinase results in GXD_Expression. (The reason the count is likely higher is because the cre cache duplicates rows with multiple systems) """ creCacheCountQuery = """select count(*) cnt from all_cre_cache""" creCacheCount = runQuery(creCacheCountQuery)[0]['cnt'] # assert cache is non-empty self.assertDataTrue(creCacheCount, "ALL_Cre_Cache should not be empty") creExpressionCountQuery = """select count(*) cnt from gxd_expression where isrecombinase = 1 """ creExpressionCount = runQuery(creExpressionCountQuery)[0]['cnt'] # assert cache has appropriate count failMsg = "Count of results in ALL_Cre_Cache should be greater " + \ "than or equal to count of recombinase results in GXD_Expression" self.assertDataTrue(creCacheCount >= creExpressionCount, failMsg)
def testMarkerCreationDate(self): """ Test that no MP-annotated markers are newer than the latest Derived MP annotations """ derivedDateQuery = """select creation_date from voc_annot va where va._annottype_key = %d limit 1 """ % MP_MARKER_DERIVED_TYPE_KEY derivedCreationDate = runQuery(derivedDateQuery)[0]['creation_date'] newMarkerDateQuery = """select max(m.creation_date) as creation_date from mrk_marker m join gxd_allelegenotype gag on gag._marker_key = m._marker_key join voc_annot va on va._object_key = gag._genotype_key where va._annottype_key = %d """ % MP_GENO_TYPE_KEY markerCreationDate = runQuery(newMarkerDateQuery)[0]['creation_date'] failMsg = "Derived MP annotations older than latest marker with MP annotations" self.assertDataTrue(derivedCreationDate >= markerCreationDate, failMsg)
def testDerivedCreationDate(self): """ Test that no source OMIM annotations are newer than the latest Derived OMIM annotations """ derivedDateQuery = """select creation_date from voc_annot va where va._annottype_key = %d limit 1 """ % OMIM_MARKER_DERIVED_TYPE_KEY derivedCreationDate = runQuery(derivedDateQuery)[0]['creation_date'] sourceAnnotDateQuery = """select max(modification_date) as modification_date from voc_annot va where va._annottype_key = %d """ % OMIM_GENO_TYPE_KEY sourceModificationDate = runQuery(sourceAnnotDateQuery)[0]['modification_date'] failMsg = "Derived OMIM annotations older than the latest source OMIM annotations" self.assertDataTrue(derivedCreationDate >= sourceModificationDate, failMsg)