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)
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
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)
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
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
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))