コード例 #1
0
ファイル: api.py プロジェクト: steppi/indra
    def post(self):
        """
        Process PathwayCommons paths from-to genes, return INDRA Statements.

        Parameters
        ----------
        source : list
            A list of HGNC gene symbols that are the sources of paths being
            searched for.
            Examples: ['BRAF', 'RAF1', 'ARAF']

        target : list
            A list of HGNC gene symbols that are the targets of paths being
            searched for.
            Examples: ['MAP2K1', 'MAP2K2']

        Returns
        -------
        statements : list[indra.statements.Statement.to_json()]
            A list of extracted INDRA Statements.
        """
        args = request.json
        source = args.get('source')
        target = args.get('target')
        bp = biopax.process_pc_pathsfromto(source, target)
        return _stmts_from_proc(bp)
コード例 #2
0
ファイル: test_biopax.py プロジェクト: vishalbelsare/indra-1
def test_pathsfromto():
    bp = biopax.process_pc_pathsfromto(['MAP2K1'], ['MAPK1'])
    assert_pmids(bp.statements)
    assert_source_sub_id(bp.statements)
    assert unicode_strs(bp.statements)
    num_unique = len({s.get_hash(shallow=False) for s in bp.statements})
    assert len(bp.statements) == num_unique
コード例 #3
0
ファイル: test_biopax.py プロジェクト: johnbachman/indra
def test_pathsfromto():
    bp = biopax.process_pc_pathsfromto(['MAP2K1'], ['MAPK1'])
    assert_pmids(bp.statements)
    assert_source_sub_id(bp.statements)
    assert unicode_strs(bp.statements)
    num_unique = len({s.get_hash(shallow=False) for s in bp.statements})
    assert len(bp.statements) == num_unique
コード例 #4
0
def biopax_process_pc_pathsfromto():
    """Process PathwayCommons paths from-to genes, return INDRA Statements."""
    if request.method == 'OPTIONS':
        return {}
    response = request.body.read().decode('utf-8')
    body = json.loads(response)
    source = body.get('source')
    target = body.get('target')
    bp = biopax.process_pc_pathsfromto(source, target)
    return _stmts_from_proc(bp)
コード例 #5
0
ファイル: api.py プロジェクト: johnbachman/indra
def biopax_process_pc_pathsfromto():
    """Process PathwayCommons paths from-to genes, return INDRA Statements."""
    if request.method == 'OPTIONS':
        return {}
    response = request.body.read().decode('utf-8')
    body = json.loads(response)
    source = body.get('source')
    target = body.get('target')
    bp = biopax.process_pc_pathsfromto(source, target)
    return _stmts_from_proc(bp)
コード例 #6
0
ファイル: api.py プロジェクト: budakn/INDRA
def biopax_process_pc_pathsfromto():
    """Process PathwayCommons paths from-to genes, return INDRA Statements."""
    if request.method == 'OPTIONS':
        return {}
    response = request.body.read().decode('utf-8')
    body = json.loads(response)
    source = body.get('source')
    target = body.get('target')
    bp = biopax.process_pc_pathsfromto(source, target)
    if bp and bp.statements:
        stmts = stmts_to_json(bp.statements)
        res = {'statements': stmts}
        return res
    else:
        res = {'statements': []}
    return res
コード例 #7
0
def test_readme_using_indra5():
    from indra.sources import biopax
    # Process the neighborhood of BRAF and MAP2K1
    biopax_processor = biopax.process_pc_pathsfromto(['BRAF', 'RAF1'],
                                                     ['MAP2K1', 'MAP2K2'])
    assert biopax_processor.statements
コード例 #8
0
ファイル: test_biopax.py プロジェクト: pupster90/indra
def test_pathsfromto():
    bp = biopax.process_pc_pathsfromto(['MAP2K1'], ['MAPK1'])
    assert_pmids(bp.statements)
    assert_source_sub_id(bp.statements)
    assert (unicode_strs(bp.statements))