def test_protein_pmod(self): node = Protein(name='PLCG1', namespace='HGNC', variants=[ProteinModification(name='Ph', code='Tyr')]) self.assertEqual( 'p(HGNC:PLCG1, pmod(go:0006468 ! "protein phosphorylation", Tyr))', str(node))
def test_pmod_default_with_residue(self, mock): dummy_namespace = n() dummy_name = n() node_data = Protein(namespace=dummy_namespace, name=dummy_name, variants=[ProteinModification('Me', code='Ser')]) self._help_reconstitute(node_data, 2, 1)
def test_canonicalize_variant_dsl(self): """Use the __str__ functions in the DSL to create BEL instead of external pybel.canonicalize.""" self.assertEqual('var("p.Val600Glu")', str(Hgvs('p.Val600Glu'))) self.assertEqual('var("p.Val600Glu")', str(ProteinSubstitution('Val', 600, 'Glu'))) self.assertEqual('pmod(go:0006468 ! "protein phosphorylation")', str(ProteinModification('Ph'))) self.assertEqual('pmod(TEST:Ph)', str(ProteinModification('Ph', namespace='TEST'))) self.assertEqual( 'pmod(TEST:Ph, Ser)', str(ProteinModification('Ph', namespace='TEST', code='Ser'))) self.assertEqual( 'pmod(TEST:Ph, Ser, 5)', str( ProteinModification('Ph', namespace='TEST', code='Ser', position=5))) self.assertEqual( 'pmod(GO:"protein phosphorylation", Thr, 308)', str( ProteinModification(name='protein phosphorylation', namespace='GO', code='Thr', position=308))) self.assertEqual('frag("?")', str(Fragment())) self.assertEqual('frag("672_713")', str(Fragment(start=672, stop=713))) self.assertEqual('frag("?", "descr")', str(Fragment(description='descr'))) self.assertEqual( 'frag("672_713", "descr")', str(Fragment(start=672, stop=713, description='descr'))) self.assertEqual('gmod(go:0006306 ! "DNA methylation")', str(GeneModification('Me'))) self.assertEqual('gmod(TEST:Me)', str(GeneModification('Me', namespace='TEST'))) self.assertEqual( 'gmod(GO:"DNA Methylation")', str(GeneModification('DNA Methylation', namespace='GO')))
def _help_test_non_standard_namespace(self, statement): result = self.parser.parseString(statement) expected = { KIND: PMOD, CONCEPT: Entity(namespace='MOD', name='PhosRes'), PMOD_CODE: 'Ser', PMOD_POSITION: 473, } self.assertEqual(expected, ProteinModification(name='PhosRes', namespace='MOD', code='Ser', position=473)) self.assertEqual(expected, result.asDict())
def _help_test_pmod_simple(self, statement): result = self.parser.parseString(statement) expected = { KIND: PMOD, CONCEPT: { NAMESPACE: BEL_DEFAULT_NAMESPACE, NAME: 'Ph', }, } self.assertEqual(expected, ProteinModification('Ph')) self.assertEqual(expected, result.asDict())
def _help_test_pmod_simple(self, statement): result = self.parser.parseString(statement) expected = { KIND: PMOD, CONCEPT: { NAMESPACE: 'go', NAME: 'protein phosphorylation', IDENTIFIER: '0006468', }, } self.assertEqual(expected, ProteinModification('Ph')) self.assertEqual(expected, result.asDict())
def test_pmod_custom_simple(self, mock): dummy_namespace = 'HGNC' dummy_name = 'AKT1' dummy_mod_namespace = 'GO' dummy_mod_name = 'Protein phosphorylation' node_data = Protein(namespace=dummy_namespace, name=dummy_name, variants=[ ProteinModification( name=dummy_mod_name, namespace=dummy_mod_namespace) ]) self._help_reconstitute(node_data, 2, 1)
def _help_test_pmod_full(self, statement): result = self.parser.parseString(statement) expected = { KIND: PMOD, CONCEPT: { NAMESPACE: BEL_DEFAULT_NAMESPACE, NAME: 'Ph', }, PMOD_CODE: 'Ser', PMOD_POSITION: 473, } self.assertEqual(expected, ProteinModification('Ph', code='Ser', position=473)) self.assertEqual(expected, result.asDict())
def _help_test_pmod_full(self, statement): result = self.parser.parseString(statement) expected = { KIND: PMOD, CONCEPT: { NAMESPACE: 'go', NAME: 'protein phosphorylation', IDENTIFIER: '0006468', }, PMOD_CODE: 'Ser', PMOD_POSITION: 473, } self.assertEqual(expected, ProteinModification('Ph', code='Ser', position=473)) self.assertEqual(expected, result.asDict())
akt_methylated, bcr_jak2_rna_fusion, chchd4_aifm1_rna_fusion, akt1_gene, akt1_phe_508_del, akt1, Gene('HGNC', 'AKT1', variants=Hgvs('c.308G>A')), tmprss2_erg_gene_fusion, Gene('HGNC', 'AKT1', variants=[Hgvs('c.1521_1523delCTT'), Hgvs('c.308G>A'), Hgvs('p.Phe508del')]), MicroRna('HGNC', 'MIR21'), bcr_jak2_gene_fusion, Gene('HGNC', 'CFTR', variants=Hgvs('c.1521_1523delCTT')), Gene('HGNC', 'CFTR'), Gene('HGNC', 'CFTR', variants=Hgvs('g.117199646_117199648delCTT')), Gene('HGNC', 'CFTR', variants=Hgvs('c.1521_1523delCTT')), Protein('HGNC', 'AKT1', variants=ProteinModification('Ph', 'Ser', 473)), MicroRna('HGNC', 'MIR21', variants=Hgvs('p.Phe508del')), Protein('HGNC', 'AKT1', variants=Hgvs('p.C40*')), Protein('HGNC', 'AKT1', variants=[Hgvs('p.Ala127Tyr'), ProteinModification('Ph', 'Ser')]), chchd4_aifm1_gene_fusion, tmprss2_erg_protein_fusion, Protein('HGNC', 'AKT1', variants=Hgvs('p.Arg1851*')), bcr_jak2_protein_fusion, Protein('HGNC', 'AKT1', variants=Hgvs('p.40*')), chchd4_aifm1_protein_fusion, Protein('HGNC', 'CFTR', variants=HgvsReference()), cftr, egfr, cftr_protein_unspecified_variant, adenocarcinoma, cftr_protein_phe_508_del,
Protein('HGNC', 'CXCR3'), Abundance('CHEBI', 'acrolein'), Protein('HGNC', 'IDO2'), Pathology('MESHD', 'Pulmonary Disease, Chronic Obstructive'), Protein('HGNC', 'IFNG'), Protein('HGNC', 'TNFRSF4'), Protein('HGNC', 'CTLA4'), Protein('HGNC', 'GZMA'), Protein('HGNC', 'PRF1'), Protein('HGNC', 'TNF'), Protein('SFAM', 'Chemokine Receptor Family'), ComplexAbundance([Protein('HGNC', 'CD8A'), Protein('HGNC', 'CD8B')]), ComplexAbundance([Protein('HGNC', 'CD8A'), Protein('HGNC', 'CD8B')]), Protein('HGNC', 'PLCG1', variants=ProteinModification('Ph', 'Tyr')), Protein('EGID', '21577'), } jgif_expected_edges = [ (calcium, calcineurin_complex, { RELATION: DIRECTLY_INCREASES, EVIDENCE: 'NMDA-mediated influx of calcium led to activated of the calcium-dependent phosphatase calcineurin and the subsequent dephosphorylation and activation of the protein-tyrosine phosphatase STEP', CITATION: { NAMESPACE: CITATION_TYPE_PUBMED, IDENTIFIER: '12483215' }, TARGET_MODIFIER: { MODIFIER: ACTIVITY, EFFECT: activity_mapping['phos']
pybel.dsl.activity( name='ATPase activity', namespace='go', identifier='0016887', ), 'psi-mi:"MI:1146"(phospholipase reaction)': pybel.dsl.activity( name='phospholipase activity', namespace='go', identifier='0004620', ), } PROTEIN_INCREASES_MOD_DICT: Mapping[str, ProteinModification] = { 'psi-mi:"MI:0844"(phosphotransfer reaction)': ProteinModification('Ph'), 'psi-mi:"MI:0559"(glycosylation reaction)': ProteinModification('Glyco'), 'psi-mi:"MI:0216"(palmitoylation reaction)': ProteinModification('Palm'), 'psi-mi:"MI:1327"(sulfurtransfer reaction)': ProteinModification('Sulf'), 'psi-mi:"MI:0217"(phosphorylation reaction)': ProteinModification('Ph'), 'psi-mi:"MI:0566"(sumoylation reaction)': ProteinModification('Sumo'), 'psi-mi:"MI:0213"(methylation reaction)': ProteinModification('Me'), 'psi-mi:"MI:0556"(transglutamination reaction)': ProteinModification( namespace='mi',
akt_methylated, bcr_jak2_rna_fusion, chchd4_aifm1_rna_fusion, akt1_gene, akt1_phe_508_del, akt1, Gene('HGNC', 'AKT1', variants=Hgvs('c.308G>A')), tmprss2_erg_gene_fusion, Gene('HGNC', 'AKT1', variants=[ Hgvs('c.1521_1523delCTT'), Hgvs('c.308G>A'), Hgvs('p.Phe508del') ]), MicroRna('HGNC', 'MIR21'), bcr_jak2_gene_fusion, Gene('HGNC', 'CFTR', variants=Hgvs('c.1521_1523delCTT')), Gene('HGNC', 'CFTR'), Gene('HGNC', 'CFTR', variants=Hgvs('g.117199646_117199648delCTT')), Gene('HGNC', 'CFTR', variants=Hgvs('c.1521_1523delCTT')), Protein('HGNC', 'AKT1', variants=ProteinModification('Ph', 'Ser', 473)), MicroRna('HGNC', 'MIR21', variants=Hgvs('p.Phe508del')), Protein('HGNC', 'AKT1', variants=Hgvs('p.C40*')), Protein('HGNC', 'AKT1', variants=[Hgvs('p.Ala127Tyr'), ProteinModification('Ph', 'Ser')]), chchd4_aifm1_gene_fusion, tmprss2_erg_protein_fusion, Protein('HGNC', 'AKT1', variants=Hgvs('p.Arg1851*')), bcr_jak2_protein_fusion, Protein('HGNC', 'AKT1', variants=Hgvs('p.40*')), chchd4_aifm1_protein_fusion, Protein('HGNC', 'CFTR', variants=HgvsReference()), cftr, egfr, cftr_protein_unspecified_variant, adenocarcinoma, cftr_protein_phe_508_del, Protein('HGNC', 'MIA', variants=Fragment(5, 20)), mia, interleukin_23_complex,