def test_get_consequence_types(self): self.assertEqual( clinvar_to_evidence_strings.get_consequence_types( self.test_crm, self.consequence_type_dict)[0], CT.ConsequenceType('ENSG00000139988', CT.SoTerm('missense_variant')), '') self.assertEqual( clinvar_to_evidence_strings.get_consequence_types( self.test_crm, {}), [None])
def setUp(self): self.clinvar_record = test_clinvar.get_test_record() report = clinvar_to_evidence_strings.Report() consequence_type = CT.ConsequenceType("ENSG00000163646", CT.SoTerm("stop_gained")) # skip_record(clinvarRecord, cellbase_record, allowed_clinical_significance, counters) self.args = [ self.clinvar_record, self.clinvar_record.measures[0], consequence_type, "germline", ["not provided"], report ]
def test__process_consequence_type_file_tsv(self): test_consequence_type = CT.ConsequenceType( "ENSG00000021488", CT.SoTerm("missense_variant")) snp_2_gene_file_path = os.path.join(os.path.dirname(__file__), 'resources', config.snp_2_gene_file) consequence_type_dict, one_rs_multiple_genes = \ CT.process_consequence_type_file_tsv(snp_2_gene_file_path) self.assertEqual(consequence_type_dict["rs121908485"][0], test_consequence_type)
def test__process_gene(self): test_consequence_type_dict = defaultdict(list) test_rs_id = "rs121912888" test_ensembl_gene_id = "ENSG00000139219" test_so_name = "missense_variant" test_consequence_type = CT.ConsequenceType(test_ensembl_gene_id, CT.SoTerm(test_so_name)) CT.process_gene(test_consequence_type_dict, test_rs_id, test_ensembl_gene_id, test_so_name) self.assertEqual(test_consequence_type_dict["rs121912888"][0], test_consequence_type)
def test_get_consequence_types(self): test_consequence_type = CT.ConsequenceType("ENSG00000163646", CT.SoTerm("stop_gained")) self.assertEqual( clinvar_to_evidence_strings.get_consequence_types( self.test_crm, self.consequence_type_dict)[0], test_consequence_type) self.assertEqual( clinvar_to_evidence_strings.get_consequence_types( self.test_crm, {}), [None])
def test_set_known_mutations(self): test_consequence_type = CT.ConsequenceType( "ENSG00000008710", CT.SoTerm("3_prime_UTR_variant")) self.test_ses._clear_known_mutations() self.test_ses.set_known_mutations(test_consequence_type.so_term) self.assertEqual(self.test_ses['evidence']['known_mutations'], [{ 'functional_consequence': 'http://purl.obolibrary.org/obo/SO_0001624', 'preferred_name': '3_prime_UTR_variant' }])
def setUpClass(cls): cls.test_so_term_a = CT.SoTerm("stop_gained") cls.test_so_term_b = CT.SoTerm("not_real_term")
def test__process_consequence_type_file_tsv(self): test_consequence_type = CT.ConsequenceType("ENSG00000139988", CT.SoTerm("synonymous_variant")) consequence_type_dict, one_rs_multiple_genes = CT.process_consequence_type_file_tsv(config.snp_2_gene_file) self.assertEqual(consequence_type_dict["14:67729241:C:T"][0], test_consequence_type)