How to use the pybel.dsl.Rna function in pybel

To help you get started, we’ve selected a few pybel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pybel / pybel / tests / test_canonicalization.py View on Github external
def test_rna_fusion_unspecified(self):
        node = RnaFusion(
            partner_5p=Rna(namespace='HGNC', name='TMPRSS2'),
            partner_3p=Rna(namespace='HGNC', name='ERG'),
        )
        self.assertEqual('r(fus(HGNC:TMPRSS2, "?", HGNC:ERG, "?"))', str(node))
github pybel / pybel / tests / test_parse / test_parse_bel_relations.py View on Github external
def test_correlation(self):
        """Test the ``correlation`` relation."""
        statement = 'r(HGNC:X) correlation r(HGNC:Y)'
        self.parser.relation.parseString(statement)

        source = Rna('HGNC', 'X')
        target = Rna('HGNC', 'Y')
        self.assert_has_two_way_edge(source, target, CORRELATION)
github pybel / pybel / tests / test_io / test_hetionet.py View on Github external
def test_import(self):
        self._help(
            h_type=hioc.ANATOMY,
            h_dsl=dsl.Population,
            h_namespace='uberon',
            h_id='UBERON:1',
            h_name='anatomy1',
            kind='upregulates',
            t_type=hioc.GENE,
            t_dsl=dsl.Rna,
            t_namespace='ncbigene',
            t_id='1',
            t_name='gene1',
        )
github pybel / pybel / tests / constant_helper.py View on Github external
)

bcr_jak2_rna_fusion = RnaFusion(
    partner_5p=Rna('HGNC', 'BCR'),
    range_5p=EnumeratedFusionRange('r', '?', 1875),
    partner_3p=Rna('HGNC', 'JAK2'),
    range_3p=EnumeratedFusionRange('r', 2626, '?')
)

chchd4_aifm1_rna_fusion = RnaFusion(
    partner_5p=Rna('HGNC', 'CHCHD4'),
    partner_3p=Rna('HGNC', 'AIFM1')
)

tmprss2_erg_rna_fusion = RnaFusion(
    partner_5p=Rna('HGNC', 'TMPRSS2'),
    range_5p=EnumeratedFusionRange('r', 1, 79),
    partner_3p=Rna('HGNC', 'ERG'),
    range_3p=EnumeratedFusionRange('r', 312, 5034)
)
tmprss2_erg_rna_fusion_unspecified = RnaFusion(
    partner_5p=Rna('HGNC', 'TMPRSS2'),
    partner_3p=Rna('HGNC', 'ERG')
)

BEL_THOROUGH_NODES = {
    oxygen_atom,
    tmprss2_erg_rna_fusion,
    tmprss2_erg_rna_fusion_unspecified,
    akt_methylated,
    bcr_jak2_rna_fusion,
    chchd4_aifm1_rna_fusion,
github pybel / pybel / tests / constant_helper.py View on Github external
)

bcr_jak2_protein_fusion = ProteinFusion(
    partner_5p=Protein('HGNC', 'BCR'),
    range_5p=EnumeratedFusionRange('p', '?', 1875),
    partner_3p=Protein('HGNC', 'JAK2'),
    range_3p=EnumeratedFusionRange('p', 2626, '?')
)

chchd4_aifm1_protein_fusion = ProteinFusion(
    Protein('HGNC', 'CHCHD4'),
    Protein('HGNC', 'AIFM1')
)

bcr_jak2_rna_fusion = RnaFusion(
    partner_5p=Rna('HGNC', 'BCR'),
    range_5p=EnumeratedFusionRange('r', '?', 1875),
    partner_3p=Rna('HGNC', 'JAK2'),
    range_3p=EnumeratedFusionRange('r', 2626, '?')
)

chchd4_aifm1_rna_fusion = RnaFusion(
    partner_5p=Rna('HGNC', 'CHCHD4'),
    partner_3p=Rna('HGNC', 'AIFM1')
)

tmprss2_erg_rna_fusion = RnaFusion(
    partner_5p=Rna('HGNC', 'TMPRSS2'),
    range_5p=EnumeratedFusionRange('r', 1, 79),
    partner_3p=Rna('HGNC', 'ERG'),
    range_3p=EnumeratedFusionRange('r', 312, 5034)
)
github pybel / pybel / tests / test_parse / test_parse_bel_relations.py View on Github external
def test_no_correlation(self):
        """Test the ``noCorrelation`` relation."""
        statement = 'r(HGNC:X) noCorrelation r(HGNC:Y)'
        self.parser.relation.parseString(statement)
        source = Rna('HGNC', 'X')
        target = Rna('HGNC', 'Y')
        self.assert_has_two_way_edge(source, target, NO_CORRELATION)
github pybel / pybel / tests / test_canonicalization.py View on Github external
def test_rna_fusion_specified(self):
        node = RnaFusion(
            partner_5p=Rna(namespace='HGNC', name='TMPRSS2'),
            range_5p=EnumeratedFusionRange('r', 1, 79),
            partner_3p=Rna(namespace='HGNC', name='ERG'),
            range_3p=EnumeratedFusionRange('r', 312, 5034)
        )
        self.assertEqual('r(fus(HGNC:TMPRSS2, "r.1_79", HGNC:ERG, "r.312_5034"))', str(node))
github pybel / pybel / tests / test_parse / test_parse_bel_relations.py View on Github external
def test_no_correlation(self):
        """Test the ``noCorrelation`` relation."""
        statement = 'r(HGNC:X) noCorrelation r(HGNC:Y)'
        self.parser.relation.parseString(statement)
        source = Rna('HGNC', 'X')
        target = Rna('HGNC', 'Y')
        self.assert_has_two_way_edge(source, target, NO_CORRELATION)
github pybel / pybel / src / pybel / io / sbgnml / convert.py View on Github external
elif all(c['entity']['prefix'] for c in components.values()):
            rv = dsl.ComplexAbundance([
                dsl.Protein(
                    namespace=c['entity']['prefix'],
                    identifier=c['entity']['identifier'],
                    name=c['entity']['name'],
                )
                for c in components.values()
            ])
            return rv
        else:
            print('unhandled complex of', components)

        return
    elif cls == 'nucleic acid feature' and entity and entity['prefix']:
        rv = dsl.Rna(
            namespace=entity['prefix'],
            identifier=entity['identifier'],
            name=entity['name'],
        )
        return rv

    print('unhandled', glyph)