How to use the pybel.dsl.fusion_range 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_parse / test_parse_bel.py View on Github external
FUSION_STOP: 1875,
                },
                RANGE_3P: {
                    FUSION_REFERENCE: 'p',
                    FUSION_START: 2626,
                    FUSION_STOP: '?',
                },
            },
        }

        self.assertEqual(expected_dict, result.asDict())

        expected_node = protein_fusion(
            protein('HGNC', 'BCR'),
            protein('HGNC', 'JAK2'),
            fusion_range('p', '?', 1875),
            fusion_range('p', 2626, '?')
        )
        self.assert_has_node(expected_node)
        canonical_bel = self.graph.node_to_bel(expected_node)
        self.assertEqual('p(fus(HGNC:BCR, "p.?_1875", HGNC:JAK2, "p.2626_?"))', canonical_bel)
github pybel / pybel / tests / test_parse / test_parse_bel.py View on Github external
FUSION_STOP: 1875,
                },
                RANGE_3P: {
                    FUSION_REFERENCE: 'r',
                    FUSION_START: 2626,
                    FUSION_STOP: '?',
                },
            },
        }
        self.assertEqual(expected_dict, result.asDict())

        expected_node = rna_fusion(
            rna('HGNC', 'BCR'),
            rna('HGNC', 'JAK2'),
            fusion_range('r', '?', 1875),
            fusion_range('r', 2626, '?'),
        )
        self.assert_has_node(expected_node)
        self.assertEqual('r(fus(HGNC:BCR, "r.?_1875", HGNC:JAK2, "r.2626_?"))', self.graph.node_to_bel(expected_node))
github pybel / pybel / tests / test_parse / test_parse_bel.py View on Github external
FUSION_START: 1,
                    FUSION_STOP: 79,
                },
                RANGE_3P: {
                    FUSION_REFERENCE: 'p',
                    FUSION_START: 312,
                    FUSION_STOP: 5034,
                },
            },
        }
        self.assertEqual(expected_dict, result.asDict())

        expected_node = protein_fusion(
            protein('HGNC', 'TMPRSS2'),
            protein('HGNC', 'ERG'),
            fusion_range('p', 1, 79),
            fusion_range('p', 312, 5034),
        )
        self.assert_has_node(expected_node)
        self.assertEqual(
            'p(fus(HGNC:TMPRSS2, "p.1_79", HGNC:ERG, "p.312_5034"))',
            self.graph.node_to_bel(expected_node),
        )
github pybel / pybel / tests / test_parse / test_parse_bel.py View on Github external
FUSION_REFERENCE: 'c',
                    FUSION_START: '?',
                    FUSION_STOP: 1875

                },
                RANGE_3P: {
                    FUSION_REFERENCE: 'c',
                    FUSION_START: 2626,
                    FUSION_STOP: '?'
                }
            }
        }
        self.assertEqual(expected_dict, result.asDict())

        expected_node = gene_fusion(gene('HGNC', 'BCR'), gene('HGNC', 'JAK2'), fusion_range('c', '?', 1875),
                                    fusion_range('c', 2626, '?'))
        self.assert_has_node(expected_node)
        self.assertEqual('g(fus(HGNC:BCR, "c.?_1875", HGNC:JAK2, "c.2626_?"))', self.graph.node_to_bel(expected_node))
github pybel / pybel / tests / test_struct / test_summary / test_summary_nodes.py View on Github external
def test_names_fusions(self):
        """Test that names inside fusions are still found by the iterator."""
        graph = BELGraph()
        graph.namespace_url['HGNC'] = 'http://dummy'

        node = protein_fusion(
            partner_5p=protein(name='A', namespace='HGNC'),
            range_5p=fusion_range('p', 1, 15),
            partner_3p=protein(name='B', namespace='HGNC'),
            range_3p=fusion_range('p', 1, 100)
        )

        graph.add_node_from_data(node)

        result = {
            'A': 1,
            'B': 1,
        }

        self.assertEqual(set(result), get_names_by_namespace(graph, 'HGNC'))
        self.assertEqual(result, count_names_by_namespace(graph, 'HGNC'))
github pybel / pybel / tests / test_parse / test_parse_bel.py View on Github external
RANGE_5P: {
                    FUSION_REFERENCE: 'c',
                    FUSION_START: 1,
                    FUSION_STOP: '?'

                },
                RANGE_3P: {
                    FUSION_REFERENCE: 'c',
                    FUSION_START: 312,
                    FUSION_STOP: 5034
                }
            }
        }
        self.assertEqual(expected_dict, result.asDict())

        expected_node = gene_fusion(gene('HGNC', 'TMPRSS2'), gene('HGNC', 'ERG'), fusion_range('c', 1, '?'),
                                    fusion_range('c', 312, 5034))
        self.assert_has_node(expected_node)

        canonical_bel = self.graph.node_to_bel(expected_node)
        self.assertEqual('g(fus(HGNC:TMPRSS2, "c.1_?", HGNC:ERG, "c.312_5034"))', canonical_bel)
github pybel / pybel / tests / test_parse / test_parse_bel.py View on Github external
FUSION_REFERENCE: 'c',
                    FUSION_START: 1,
                    FUSION_STOP: '?'

                },
                RANGE_3P: {
                    FUSION_REFERENCE: 'c',
                    FUSION_START: 312,
                    FUSION_STOP: 5034
                }
            }
        }
        self.assertEqual(expected_dict, result.asDict())

        expected_node = gene_fusion(gene('HGNC', 'TMPRSS2'), gene('HGNC', 'ERG'), fusion_range('c', 1, '?'),
                                    fusion_range('c', 312, 5034))
        self.assert_has_node(expected_node)

        canonical_bel = self.graph.node_to_bel(expected_node)
        self.assertEqual('g(fus(HGNC:TMPRSS2, "c.1_?", HGNC:ERG, "c.312_5034"))', canonical_bel)
github pybel / pybel / tests / test_parse / test_parse_bel.py View on Github external
FUSION_START: '?',
                    FUSION_STOP: 1875,
                },
                RANGE_3P: {
                    FUSION_REFERENCE: 'r',
                    FUSION_START: 2626,
                    FUSION_STOP: '?',
                },
            },
        }
        self.assertEqual(expected_dict, result.asDict())

        expected_node = rna_fusion(
            rna('HGNC', 'BCR'),
            rna('HGNC', 'JAK2'),
            fusion_range('r', '?', 1875),
            fusion_range('r', 2626, '?'),
        )
        self.assert_has_node(expected_node)
        self.assertEqual('r(fus(HGNC:BCR, "r.?_1875", HGNC:JAK2, "r.2626_?"))', self.graph.node_to_bel(expected_node))