_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 75 19.8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q234300 | FullTextMention.get_children_tag_names | train | def get_children_tag_names(self, xml_element):
"""Returns all tag names of xml element and its children."""
tags = set()
tags.add(self.remove_namespace_from_tag(xml_element.tag))
for element in xml_element.iter(tag=etree.Element):
if element != xml_element:
n... | python | {
"resource": ""
} |
q234301 | FullTextMention.string_matches_sans_whitespace | train | def string_matches_sans_whitespace(self, str1, str2_fuzzy_whitespace):
"""Check if two strings match, modulo their whitespace."""
str2_fuzzy_whitespace = re.sub('\s+', '\s*', str2_fuzzy_whitespace)
return re.search(str2_fuzzy_whitespace, str1) is not None | python | {
"resource": ""
} |
q234302 | FullTextMention.sentence_matches | train | def sentence_matches(self, sentence_text):
"""Returns true iff the sentence contains this mention's upstream
and downstream participants, and if one of the stemmed verbs in
the sentence is the same as the stemmed action type."""
has_upstream = False
has_downstream = False
... | python | {
"resource": ""
} |
q234303 | get_identifiers_url | train | def get_identifiers_url(db_name, db_id):
"""Return an identifiers.org URL for a given database name and ID.
Parameters
----------
db_name : str
An internal database name: HGNC, UP, CHEBI, etc.
db_id : str
An identifier in the given database.
Returns
-------
url : str
... | python | {
"resource": ""
} |
q234304 | dump_statements | train | def dump_statements(stmts, fname, protocol=4):
"""Dump a list of statements into a pickle file.
Parameters
----------
fname : str
The name of the pickle file to dump statements into.
protocol : Optional[int]
The pickle protocol to use (use 2 for Python 2 compatibility).
Defa... | python | {
"resource": ""
} |
q234305 | load_statements | train | def load_statements(fname, as_dict=False):
"""Load statements from a pickle file.
Parameters
----------
fname : str
The name of the pickle file to load statements from.
as_dict : Optional[bool]
If True and the pickle file contains a dictionary of statements, it
is returned a... | python | {
"resource": ""
} |
q234306 | map_grounding | train | def map_grounding(stmts_in, **kwargs):
"""Map grounding using the GroundingMapper.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to map.
do_rename : Optional[bool]
If True, Agents are renamed based on their mapped grounding.
grounding_map... | python | {
"resource": ""
} |
q234307 | merge_groundings | train | def merge_groundings(stmts_in):
"""Gather and merge original grounding information from evidences.
Each Statement's evidences are traversed to find original grounding
information. These groundings are then merged into an overall consensus
grounding dict with as much detail as possible.
The current... | python | {
"resource": ""
} |
q234308 | merge_deltas | train | def merge_deltas(stmts_in):
"""Gather and merge original Influence delta information from evidence.
This function is only applicable to Influence Statements that have
subj and obj deltas. All other statement types are passed through unchanged.
Polarities and adjectives for subjects and objects respect... | python | {
"resource": ""
} |
q234309 | map_sequence | train | def map_sequence(stmts_in, **kwargs):
"""Map sequences using the SiteMapper.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to map.
do_methionine_offset : boolean
Whether to check for off-by-one errors in site position (possibly)
attri... | python | {
"resource": ""
} |
q234310 | run_preassembly | train | def run_preassembly(stmts_in, **kwargs):
"""Run preassembly on a list of statements.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to preassemble.
return_toplevel : Optional[bool]
If True, only the top-level statements are returned. If False,... | python | {
"resource": ""
} |
q234311 | run_preassembly_duplicate | train | def run_preassembly_duplicate(preassembler, beliefengine, **kwargs):
"""Run deduplication stage of preassembly on a list of statements.
Parameters
----------
preassembler : indra.preassembler.Preassembler
A Preassembler instance
beliefengine : indra.belief.BeliefEngine
A BeliefEngin... | python | {
"resource": ""
} |
q234312 | run_preassembly_related | train | def run_preassembly_related(preassembler, beliefengine, **kwargs):
"""Run related stage of preassembly on a list of statements.
Parameters
----------
preassembler : indra.preassembler.Preassembler
A Preassembler instance which already has a set of unique statements
internally.
belie... | python | {
"resource": ""
} |
q234313 | filter_by_type | train | def filter_by_type(stmts_in, stmt_type, **kwargs):
"""Filter to a given statement type.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
stmt_type : indra.statements.Statement
The class of the statement type to filter for.
Exa... | python | {
"resource": ""
} |
q234314 | _remove_bound_conditions | train | def _remove_bound_conditions(agent, keep_criterion):
"""Removes bound conditions of agent such that keep_criterion is False.
Parameters
----------
agent: Agent
The agent whose bound conditions we evaluate
keep_criterion: function
Evaluates removal_criterion(a) for each agent a in a ... | python | {
"resource": ""
} |
q234315 | _any_bound_condition_fails_criterion | train | def _any_bound_condition_fails_criterion(agent, criterion):
"""Returns True if any bound condition fails to meet the specified
criterion.
Parameters
----------
agent: Agent
The agent whose bound conditions we evaluate
criterion: function
Evaluates criterion(a) for each a in a bo... | python | {
"resource": ""
} |
q234316 | filter_grounded_only | train | def filter_grounded_only(stmts_in, **kwargs):
"""Filter to statements that have grounded agents.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
score_threshold : Optional[float]
If scored groundings are available in a list and the h... | python | {
"resource": ""
} |
q234317 | _agent_is_gene | train | def _agent_is_gene(agent, specific_only):
"""Returns whether an agent is for a gene.
Parameters
----------
agent: Agent
The agent to evaluate
specific_only : Optional[bool]
If True, only elementary genes/proteins evaluate as genes and families
will be filtered out. If False,... | python | {
"resource": ""
} |
q234318 | filter_genes_only | train | def filter_genes_only(stmts_in, **kwargs):
"""Filter to statements containing genes only.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
specific_only : Optional[bool]
If True, only elementary genes/proteins will be kept and familie... | python | {
"resource": ""
} |
q234319 | filter_belief | train | def filter_belief(stmts_in, belief_cutoff, **kwargs):
"""Filter to statements with belief above a given cutoff.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
belief_cutoff : float
Only statements with belief above the belief_cutoff... | python | {
"resource": ""
} |
q234320 | filter_gene_list | train | def filter_gene_list(stmts_in, gene_list, policy, allow_families=False,
**kwargs):
"""Return statements that contain genes given in a list.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
gene_list : list[str]
A ... | python | {
"resource": ""
} |
q234321 | filter_by_db_refs | train | def filter_by_db_refs(stmts_in, namespace, values, policy, **kwargs):
"""Filter to Statements whose agents are grounded to a matching entry.
Statements are filtered so that the db_refs entry (of the given namespace)
of their Agent/Concept arguments take a value in the given list of values.
Parameters
... | python | {
"resource": ""
} |
q234322 | filter_human_only | train | def filter_human_only(stmts_in, **kwargs):
"""Filter out statements that are grounded, but not to a human gene.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
save : Optional[str]
The name of a pickle file to save the results (stmts... | python | {
"resource": ""
} |
q234323 | filter_direct | train | def filter_direct(stmts_in, **kwargs):
"""Filter to statements that are direct interactions
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
save : Optional[str]
The name of a pickle file to save the results (stmts_out) into.
Ret... | python | {
"resource": ""
} |
q234324 | filter_no_hypothesis | train | def filter_no_hypothesis(stmts_in, **kwargs):
"""Filter to statements that are not marked as hypothesis in epistemics.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
save : Optional[str]
The name of a pickle file to save the results... | python | {
"resource": ""
} |
q234325 | filter_evidence_source | train | def filter_evidence_source(stmts_in, source_apis, policy='one', **kwargs):
"""Filter to statements that have evidence from a given set of sources.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
source_apis : list[str]
A list of sour... | python | {
"resource": ""
} |
q234326 | filter_top_level | train | def filter_top_level(stmts_in, **kwargs):
"""Filter to statements that are at the top-level of the hierarchy.
Here top-level statements correspond to most specific ones.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
save : Optional[st... | python | {
"resource": ""
} |
q234327 | filter_inconsequential_mods | train | def filter_inconsequential_mods(stmts_in, whitelist=None, **kwargs):
"""Filter out Modifications that modify inconsequential sites
Inconsequential here means that the site is not mentioned / tested
in any other statement. In some cases specific sites should be
preserved, for instance, to be used as rea... | python | {
"resource": ""
} |
q234328 | filter_inconsequential_acts | train | def filter_inconsequential_acts(stmts_in, whitelist=None, **kwargs):
"""Filter out Activations that modify inconsequential activities
Inconsequential here means that the site is not mentioned / tested
in any other statement. In some cases specific activity types should be
preserved, for instance, to be... | python | {
"resource": ""
} |
q234329 | filter_enzyme_kinase | train | def filter_enzyme_kinase(stmts_in, **kwargs):
"""Filter Phosphorylations to ones where the enzyme is a known kinase.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
save : Optional[str]
The name of a pickle file to save the results (... | python | {
"resource": ""
} |
q234330 | filter_transcription_factor | train | def filter_transcription_factor(stmts_in, **kwargs):
"""Filter out RegulateAmounts where subject is not a transcription factor.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
save : Optional[str]
The name of a pickle file to save th... | python | {
"resource": ""
} |
q234331 | filter_uuid_list | train | def filter_uuid_list(stmts_in, uuids, **kwargs):
"""Filter to Statements corresponding to given UUIDs
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to filter.
uuids : list[str]
A list of UUIDs to filter for.
save : Optional[str]
T... | python | {
"resource": ""
} |
q234332 | expand_families | train | def expand_families(stmts_in, **kwargs):
"""Expand FamPlex Agents to individual genes.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to expand.
save : Optional[str]
The name of a pickle file to save the results (stmts_out) into.
Returns
... | python | {
"resource": ""
} |
q234333 | reduce_activities | train | def reduce_activities(stmts_in, **kwargs):
"""Reduce the activity types in a list of statements
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to reduce activity types in.
save : Optional[str]
The name of a pickle file to save the results (stm... | python | {
"resource": ""
} |
q234334 | strip_agent_context | train | def strip_agent_context(stmts_in, **kwargs):
"""Strip any context on agents within each statement.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements whose agent context should be stripped.
save : Optional[str]
The name of a pickle file to save th... | python | {
"resource": ""
} |
q234335 | standardize_names_groundings | train | def standardize_names_groundings(stmts):
"""Standardize the names of Concepts with respect to an ontology.
NOTE: this function is currently optimized for Influence Statements
obtained from Eidos, Hume, Sofia and CWMS. It will possibly yield
unexpected results for biology-specific Statements.
"""
... | python | {
"resource": ""
} |
q234336 | dump_stmt_strings | train | def dump_stmt_strings(stmts, fname):
"""Save printed statements in a file.
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to save in a text file.
fname : Optional[str]
The name of a text file to save the printed statements into.
"""
wi... | python | {
"resource": ""
} |
q234337 | rename_db_ref | train | def rename_db_ref(stmts_in, ns_from, ns_to, **kwargs):
"""Rename an entry in the db_refs of each Agent.
This is particularly useful when old Statements in pickle files
need to be updated after a namespace was changed such as
'BE' to 'FPLX'.
Parameters
----------
stmts_in : list[indra.state... | python | {
"resource": ""
} |
q234338 | align_statements | train | def align_statements(stmts1, stmts2, keyfun=None):
"""Return alignment of two lists of statements by key.
Parameters
----------
stmts1 : list[indra.statements.Statement]
A list of INDRA Statements to align
stmts2 : list[indra.statements.Statement]
A list of INDRA Statements to align... | python | {
"resource": ""
} |
q234339 | submit_query_request | train | def submit_query_request(end_point, *args, **kwargs):
"""Low level function to format the query string."""
ev_limit = kwargs.pop('ev_limit', 10)
best_first = kwargs.pop('best_first', True)
tries = kwargs.pop('tries', 2)
# This isn't handled by requests because of the multiple identical agent
# k... | python | {
"resource": ""
} |
q234340 | submit_statement_request | train | def submit_statement_request(meth, end_point, query_str='', data=None,
tries=2, **params):
"""Even lower level function to make the request."""
full_end_point = 'statements/' + end_point.lstrip('/')
return make_db_rest_request(meth, full_end_point, query_str, data, params, tries... | python | {
"resource": ""
} |
q234341 | render_stmt_graph | train | def render_stmt_graph(statements, reduce=True, english=False, rankdir=None,
agent_style=None):
"""Render the statement hierarchy as a pygraphviz graph.
Parameters
----------
stmts : list of :py:class:`indra.statements.Statement`
A list of top-level statements with associat... | python | {
"resource": ""
} |
q234342 | flatten_stmts | train | def flatten_stmts(stmts):
"""Return the full set of unique stms in a pre-assembled stmt graph.
The flattened list of statements returned by this function can be
compared to the original set of unique statements to make sure no
statements have been lost during the preassembly process.
Parameters
... | python | {
"resource": ""
} |
q234343 | Preassembler.combine_duplicates | train | def combine_duplicates(self):
"""Combine duplicates among `stmts` and save result in `unique_stmts`.
A wrapper around the static method :py:meth:`combine_duplicate_stmts`.
"""
if self.unique_stmts is None:
self.unique_stmts = self.combine_duplicate_stmts(self.stmts)
... | python | {
"resource": ""
} |
q234344 | Preassembler._get_stmt_matching_groups | train | def _get_stmt_matching_groups(stmts):
"""Use the matches_key method to get sets of matching statements."""
def match_func(x): return x.matches_key()
# Remove exact duplicates using a set() call, then make copies:
logger.debug('%d statements before removing object duplicates.' %
... | python | {
"resource": ""
} |
q234345 | Preassembler.combine_duplicate_stmts | train | def combine_duplicate_stmts(stmts):
"""Combine evidence from duplicate Statements.
Statements are deemed to be duplicates if they have the same key
returned by the `matches_key()` method of the Statement class. This
generally means that statements must be identical in terms of their
... | python | {
"resource": ""
} |
q234346 | Preassembler._get_stmt_by_group | train | def _get_stmt_by_group(self, stmt_type, stmts_this_type, eh):
"""Group Statements of `stmt_type` by their hierarchical relations."""
# Dict of stmt group key tuples, indexed by their first Agent
stmt_by_first = collections.defaultdict(lambda: [])
# Dict of stmt group key tuples, indexed ... | python | {
"resource": ""
} |
q234347 | Preassembler.combine_related | train | def combine_related(self, return_toplevel=True, poolsize=None,
size_cutoff=100):
"""Connect related statements based on their refinement relationships.
This function takes as a starting point the unique statements (with
duplicates removed) and returns a modified flat lis... | python | {
"resource": ""
} |
q234348 | Preassembler.find_contradicts | train | def find_contradicts(self):
"""Return pairs of contradicting Statements.
Returns
-------
contradicts : list(tuple(Statement, Statement))
A list of Statement pairs that are contradicting.
"""
eh = self.hierarchies['entity']
# Make a dict of Statement ... | python | {
"resource": ""
} |
q234349 | get_text_content_for_pmids | train | def get_text_content_for_pmids(pmids):
"""Get text content for articles given a list of their pmids
Parameters
----------
pmids : list of str
Returns
-------
text_content : list of str
"""
pmc_pmids = set(pmc_client.filter_pmids(pmids, source_type='fulltext'))
pmc_ids = []
... | python | {
"resource": ""
} |
q234350 | universal_extract_paragraphs | train | def universal_extract_paragraphs(xml):
"""Extract paragraphs from xml that could be from different sources
First try to parse the xml as if it came from elsevier. if we do not
have valid elsevier xml this will throw an exception. the text extraction
function in the pmc client may not throw an exceptio... | python | {
"resource": ""
} |
q234351 | filter_paragraphs | train | def filter_paragraphs(paragraphs, contains=None):
"""Filter paragraphs to only those containing one of a list of strings
Parameters
----------
paragraphs : list of str
List of plaintext paragraphs from an article
contains : str or list of str
Exclude paragraphs not containing this ... | python | {
"resource": ""
} |
q234352 | get_valid_residue | train | def get_valid_residue(residue):
"""Check if the given string represents a valid amino acid residue."""
if residue is not None and amino_acids.get(residue) is None:
res = amino_acids_reverse.get(residue.lower())
if res is None:
raise InvalidResidueError(residue)
else:
... | python | {
"resource": ""
} |
q234353 | get_valid_location | train | def get_valid_location(location):
"""Check if the given location represents a valid cellular component."""
# If we're given None, return None
if location is not None and cellular_components.get(location) is None:
loc = cellular_components_reverse.get(location)
if loc is None:
rai... | python | {
"resource": ""
} |
q234354 | _read_activity_types | train | def _read_activity_types():
"""Read types of valid activities from a resource file."""
this_dir = os.path.dirname(os.path.abspath(__file__))
ac_file = os.path.join(this_dir, os.pardir, 'resources',
'activity_hierarchy.rdf')
g = rdflib.Graph()
with open(ac_file, 'r'):
... | python | {
"resource": ""
} |
q234355 | _read_cellular_components | train | def _read_cellular_components():
"""Read cellular components from a resource file."""
# Here we load a patch file in addition to the current cellular components
# file to make sure we don't error with InvalidLocationError with some
# deprecated cellular location names
this_dir = os.path.dirname(os.p... | python | {
"resource": ""
} |
q234356 | _read_amino_acids | train | def _read_amino_acids():
"""Read the amino acid information from a resource file."""
this_dir = os.path.dirname(os.path.abspath(__file__))
aa_file = os.path.join(this_dir, os.pardir, 'resources', 'amino_acids.tsv')
amino_acids = {}
amino_acids_reverse = {}
with open(aa_file, 'rt') as fh:
... | python | {
"resource": ""
} |
q234357 | export_sbgn | train | def export_sbgn(model):
"""Return an SBGN model string corresponding to the PySB model.
This function first calls generate_equations on the PySB model to obtain
a reaction network (i.e. individual species, reactions). It then iterates
over each reaction and and instantiates its reactants, products, and... | python | {
"resource": ""
} |
q234358 | export_kappa_im | train | def export_kappa_im(model, fname=None):
"""Return a networkx graph representing the model's Kappa influence map.
Parameters
----------
model : pysb.core.Model
A PySB model to be exported into a Kappa IM.
fname : Optional[str]
A file name, typically with .png or .pdf extension in whi... | python | {
"resource": ""
} |
q234359 | export_kappa_cm | train | def export_kappa_cm(model, fname=None):
"""Return a networkx graph representing the model's Kappa contact map.
Parameters
----------
model : pysb.core.Model
A PySB model to be exported into a Kappa CM.
fname : Optional[str]
A file name, typically with .png or .pdf extension in which... | python | {
"resource": ""
} |
q234360 | _prepare_kappa | train | def _prepare_kappa(model):
"""Return a Kappa STD with the model loaded."""
import kappy
kappa = kappy.KappaStd()
model_str = export(model, 'kappa')
kappa.add_model_string(model_str)
kappa.project_parse()
return kappa | python | {
"resource": ""
} |
q234361 | send_request | train | def send_request(**kwargs):
"""Return a data frame from a web service request to cBio portal.
Sends a web service requrest to the cBio portal with arguments given in
the dictionary data and returns a Pandas data frame on success.
More information about the service here:
http://www.cbioportal.org/w... | python | {
"resource": ""
} |
q234362 | get_mutations | train | def get_mutations(study_id, gene_list, mutation_type=None,
case_id=None):
"""Return mutations as a list of genes and list of amino acid changes.
Parameters
----------
study_id : str
The ID of the cBio study.
Example: 'cellline_ccle_broad' or 'paad_icgc'
gene_list :... | python | {
"resource": ""
} |
q234363 | get_case_lists | train | def get_case_lists(study_id):
"""Return a list of the case set ids for a particular study.
TAKE NOTE the "case_list_id" are the same thing as "case_set_id"
Within the data, this string is referred to as a "case_list_id".
Within API calls it is referred to as a 'case_set_id'.
The documentation does ... | python | {
"resource": ""
} |
q234364 | get_profile_data | train | def get_profile_data(study_id, gene_list,
profile_filter, case_set_filter=None):
"""Return dict of cases and genes and their respective values.
Parameters
----------
study_id : str
The ID of the cBio study.
Example: 'cellline_ccle_broad' or 'paad_icgc'
gene_list... | python | {
"resource": ""
} |
q234365 | get_num_sequenced | train | def get_num_sequenced(study_id):
"""Return number of sequenced tumors for given study.
This is useful for calculating mutation statistics in terms of the
prevalence of certain mutations within a type of cancer.
Parameters
----------
study_id : str
The ID of the cBio study.
Exam... | python | {
"resource": ""
} |
q234366 | get_cancer_studies | train | def get_cancer_studies(study_filter=None):
"""Return a list of cancer study identifiers, optionally filtered.
There are typically multiple studies for a given type of cancer and
a filter can be used to constrain the returned list.
Parameters
----------
study_filter : Optional[str]
A st... | python | {
"resource": ""
} |
q234367 | get_cancer_types | train | def get_cancer_types(cancer_filter=None):
"""Return a list of cancer types, optionally filtered.
Parameters
----------
cancer_filter : Optional[str]
A string used to filter cancer types. Its value is the name or
part of the name of a type of cancer. Example: "melanoma",
"pancrea... | python | {
"resource": ""
} |
q234368 | get_ccle_mutations | train | def get_ccle_mutations(gene_list, cell_lines, mutation_type=None):
"""Return a dict of mutations in given genes and cell lines from CCLE.
This is a specialized call to get_mutations tailored to CCLE cell lines.
Parameters
----------
gene_list : list[str]
A list of HGNC gene symbols to get ... | python | {
"resource": ""
} |
q234369 | get_ccle_lines_for_mutation | train | def get_ccle_lines_for_mutation(gene, amino_acid_change):
"""Return cell lines with a given point mutation in a given gene.
Checks which cell lines in CCLE have a particular point mutation
in a given gene and return their names in a list.
Parameters
----------
gene : str
The HGNC symbo... | python | {
"resource": ""
} |
q234370 | get_ccle_cna | train | def get_ccle_cna(gene_list, cell_lines):
"""Return a dict of CNAs in given genes and cell lines from CCLE.
CNA values correspond to the following alterations
-2 = homozygous deletion
-1 = hemizygous deletion
0 = neutral / no change
1 = gain
2 = high level amplification
Parameters
... | python | {
"resource": ""
} |
q234371 | get_ccle_mrna | train | def get_ccle_mrna(gene_list, cell_lines):
"""Return a dict of mRNA amounts in given genes and cell lines from CCLE.
Parameters
----------
gene_list : list[str]
A list of HGNC gene symbols to get mRNA amounts for.
cell_lines : list[str]
A list of CCLE cell line names to get mRNA amou... | python | {
"resource": ""
} |
q234372 | _filter_data_frame | train | def _filter_data_frame(df, data_col, filter_col, filter_str=None):
"""Return a filtered data frame as a dictionary."""
if filter_str is not None:
relevant_cols = data_col + [filter_col]
df.dropna(inplace=True, subset=relevant_cols)
row_filter = df[filter_col].str.contains(filter_str, cas... | python | {
"resource": ""
} |
q234373 | allow_cors | train | def allow_cors(func):
"""This is a decorator which enable CORS for the specified endpoint."""
def wrapper(*args, **kwargs):
response.headers['Access-Control-Allow-Origin'] = '*'
response.headers['Access-Control-Allow-Methods'] = \
'PUT, GET, POST, DELETE, OPTIONS'
response.he... | python | {
"resource": ""
} |
q234374 | trips_process_text | train | def trips_process_text():
"""Process text with TRIPS and return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
text = body.get('text')
tp = trips.process_text(text)
return _stmts_from_proc(tp) | python | {
"resource": ""
} |
q234375 | trips_process_xml | train | def trips_process_xml():
"""Process TRIPS EKB XML and return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
xml_str = body.get('xml_str')
tp = trips.process_xml(xml_str)
return _stmts_from_proc... | python | {
"resource": ""
} |
q234376 | reach_process_text | train | def reach_process_text():
"""Process text with REACH and return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
text = body.get('text')
offline = True if body.get('offline') else False
rp = reac... | python | {
"resource": ""
} |
q234377 | reach_process_json | train | def reach_process_json():
"""Process REACH json and return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
json_str = body.get('json')
rp = reach.process_json_str(json_str)
return _stmts_from_pr... | python | {
"resource": ""
} |
q234378 | reach_process_pmc | train | def reach_process_pmc():
"""Process PubMedCentral article and return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
pmcid = body.get('pmcid')
rp = reach.process_pmc(pmcid)
return _stmts_from_pr... | python | {
"resource": ""
} |
q234379 | bel_process_pybel_neighborhood | train | def bel_process_pybel_neighborhood():
"""Process BEL Large Corpus neighborhood and return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
genes = body.get('genes')
bp = bel.process_pybel_neighborhoo... | python | {
"resource": ""
} |
q234380 | bel_process_belrdf | train | def bel_process_belrdf():
"""Process BEL RDF and return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
belrdf = body.get('belrdf')
bp = bel.process_belrdf(belrdf)
return _stmts_from_proc(bp) | python | {
"resource": ""
} |
q234381 | biopax_process_pc_pathsbetween | train | def biopax_process_pc_pathsbetween():
"""Process PathwayCommons paths between genes, return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
genes = body.get('genes')
bp = biopax.process_pc_pathsbetw... | python | {
"resource": ""
} |
q234382 | biopax_process_pc_pathsfromto | train | 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')
... | python | {
"resource": ""
} |
q234383 | biopax_process_pc_neighborhood | train | def biopax_process_pc_neighborhood():
"""Process PathwayCommons neighborhood, return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
genes = body.get('genes')
bp = biopax.process_pc_neighborhood(gen... | python | {
"resource": ""
} |
q234384 | eidos_process_text | train | def eidos_process_text():
"""Process text with EIDOS and return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
req = request.body.read().decode('utf-8')
body = json.loads(req)
text = body.get('text')
webservice = body.get('webservice')
if not webservice:
respo... | python | {
"resource": ""
} |
q234385 | eidos_process_jsonld | train | def eidos_process_jsonld():
"""Process an EIDOS JSON-LD and return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
eidos_json = body.get('jsonld')
ep = eidos.process_json_str(eidos_json)
return ... | python | {
"resource": ""
} |
q234386 | cwms_process_text | train | def cwms_process_text():
"""Process text with CWMS and return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
text = body.get('text')
cp = cwms.process_text(text)
return _stmts_from_proc(cp) | python | {
"resource": ""
} |
q234387 | hume_process_jsonld | train | def hume_process_jsonld():
"""Process Hume JSON-LD and return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
jsonld_str = body.get('jsonld')
jsonld = json.loads(jsonld_str)
hp = hume.process_js... | python | {
"resource": ""
} |
q234388 | sofia_process_text | train | def sofia_process_text():
"""Process text with Sofia and return INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
text = body.get('text')
auth = body.get('auth')
sp = sofia.process_text(text, auth... | python | {
"resource": ""
} |
q234389 | assemble_pysb | train | def assemble_pysb():
"""Assemble INDRA Statements and return PySB model string."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
stmts_json = body.get('statements')
export_format = body.get('export_format')
stmts ... | python | {
"resource": ""
} |
q234390 | assemble_cx | train | def assemble_cx():
"""Assemble INDRA Statements and return CX network json."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
stmts_json = body.get('statements')
stmts = stmts_from_json(stmts_json)
ca = CxAssembler... | python | {
"resource": ""
} |
q234391 | share_model_ndex | train | def share_model_ndex():
"""Upload the model to NDEX"""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
stmts_str = body.get('stmts')
stmts_json = json.loads(stmts_str)
stmts = stmts_from_json(stmts_json["statements"... | python | {
"resource": ""
} |
q234392 | fetch_model_ndex | train | def fetch_model_ndex():
"""Download model and associated pieces from NDEX"""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
network_id = body.get('network_id')
cx = process_ndex_network(network_id)
network_attr = [... | python | {
"resource": ""
} |
q234393 | assemble_graph | train | def assemble_graph():
"""Assemble INDRA Statements and return Graphviz graph dot string."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
stmts_json = body.get('statements')
stmts = stmts_from_json(stmts_json)
ga ... | python | {
"resource": ""
} |
q234394 | assemble_cyjs | train | def assemble_cyjs():
"""Assemble INDRA Statements and return Cytoscape JS network."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
stmts_json = body.get('statements')
stmts = stmts_from_json(stmts_json)
cja = CyJ... | python | {
"resource": ""
} |
q234395 | assemble_english | train | def assemble_english():
"""Assemble each statement into """
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
stmts_json = body.get('statements')
stmts = stmts_from_json(stmts_json)
sentences = {}
for st in stmts:... | python | {
"resource": ""
} |
q234396 | assemble_loopy | train | def assemble_loopy():
"""Assemble INDRA Statements into a Loopy model using SIF Assembler."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
stmts_json = body.get('statements')
stmts = stmts_from_json(stmts_json)
s... | python | {
"resource": ""
} |
q234397 | get_ccle_mrna_levels | train | def get_ccle_mrna_levels():
"""Get CCLE mRNA amounts using cBioClient"""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
gene_list = body.get('gene_list')
cell_lines = body.get('cell_lines')
mrna_amounts = cbio_clie... | python | {
"resource": ""
} |
q234398 | get_ccle_mutations | train | def get_ccle_mutations():
"""Get CCLE mutations
returns the amino acid changes for a given list of genes and cell lines
"""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
gene_list = body.get('gene_list')
cell_... | python | {
"resource": ""
} |
q234399 | map_grounding | train | def map_grounding():
"""Map grounding on a list of INDRA Statements."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
stmts_json = body.get('statements')
stmts = stmts_from_json(stmts_json)
stmts_out = ac.map_grou... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.