napistu.modify.pathwayannot
Functions
|
Add Complex Formation |
|
Add Complex Formation - Species |
|
Add Entity Sets |
|
Add Reactome Identifiers |
- napistu.modify.pathwayannot._add_complex_formation_compartmentalized_species(sbml_dfs: SBML_dfs, merged_membership: DataFrame, new_species_for_sbml_dfs: DataFrame, complex_component_species_ids: DataFrame) tuple[DataFrame, DataFrame]
Add Complex Formation - Compartmentalized Species
Define all compartmentalized species in complexes and format newly created compartmentalized species
- Parameters:
sbml_dfs (SBML_dfs) – A relational mechanistic network
merged_membership (pd.DataFrame) – A table of complexes and their component members
new_species_for_sbml_dfs (pd.DataFrame) – New entries to add to sbml_dfs.species
complex_component_species_ids (pd.DataFrame) – All complex components
- Returns:
new_compartmentalized_species_for_sbml_dfs (pd.DataFrame) – New entries to add to sbml_dfs.compartmentalized_species
updated_compartmentalized_membership (pd.DataFrame) – Compartmentalized complex components with updated IDs
- napistu.modify.pathwayannot._add_entity_sets_reactions(sbml_dfs: SBML_dfs, new_compartmentalized_species_for_sbml_dfs: DataFrame, updated_compartmentalized_membership: DataFrame) tuple[DataFrame, DataFrame]
Add Entity Sets - Reactions
Create reactions which indicate membership in an entity set
- Parameters:
sbml_dfs (SBML_dfs) – A relational mechanistic network
new_compartmentalized_species_for_sbml_dfs (pd.DataFrame) – New entries to add to sbml_dfs.compartmentalized_species
updated_compartmentalized_membership (pd.DataFrame) – Compartmentalized complex components with updated IDs
- Returns:
new_reactions_for_sbml_dfs (pd.DataFrame) – New entries to add to sbml_dfs.reactions
new_reaction_species_for_sbml_dfs (pd.DataFrame) – New entries to add to sbml_dfs.reaction_species
- napistu.modify.pathwayannot._add_entity_sets_species(sbml_dfs: SBML_dfs, reactome_members: DataFrame) tuple[DataFrame, DataFrame, DataFrame]
Add Entity Sets - Species
Define all species which are part of “entity sets” in the pathway
- Parameters:
sbml_dfs (SBML_dfs) – A relational mechanistic network
reactome_members (pd.DataFrame) – A table of all Reactome entity sets members - obtained using a Neo4j query
- Returns:
merged_membership (pd.DataFrame) – A table of complexes and their component members
new_species_for_sbml_dfs (pd.DataFrame) – New entries to add to sbml_dfs.species
set_component_species_ids (pd.DataFrame) – All set components
- napistu.modify.pathwayannot._merge_reactome_crossref_ids(current_molecular_ids: DataFrame, select_reactome_ids: DataFrame) DataFrame
Merge Reactome CrossRef IDs
Combine existing molecular IDs with Reactome crossref identifiers.
- Parameters:
current_molecular_ids (pd.DataFrame) – Molecular features in the current pathway model
select_reactome_ids (pd.DataFrame) – Crossref identifiers produced by _format_reactome_crossref_ids()
- Returns:
merged_crossrefs – Molecular feature sids matched to crossref annotations
- Return type:
pd.DataFrame
- napistu.modify.pathwayannot._read_neo4j_members(neo4j_members: str) DataFrame
Read a table containing entity sets (members) derived from Reactome’s Neo4J database.
- napistu.modify.pathwayannot._read_reactome_crossref_ids(crossref_path: str) DataFrame
Format Reactome CrossRef IDs
Read and reformat Reactome’s crossref identifiers
- Parameters:
crossref_path (str) – Path to the cross ref file extracted from Reactome’s Neo4j database
- Returns:
select_reactome_ids – Crossref identifiers
- Return type:
pd.DataFrame
- napistu.modify.pathwayannot.add_complex_formation(sbml_dfs: SBML_dfs)
Add Complex Formation
Using Reactome-style complex annotations, where complex components are an attribute of complexes, add explicit complex formation reactions.
Reactome represents complexers using BQB_HAS_PART annotations, which are extracted into Identifiers objects. This is sufficient to define membership but does not include stoichiometry. Also, in this approach components are defined by their identifiers (URIs) rather than internal s_ids/sc_ids.
- napistu.modify.pathwayannot.add_complex_formation_species(sbml_dfs: SBML_dfs) tuple[DataFrame, DataFrame, DataFrame]
Add Complex Formation - Species
Define all species in complexes and format newly created species
- Parameters:
sbml_dfs (SBML_dfs) – A relational mechanistic network
- Returns:
merged_membership (pd.DataFrame) – A table of complexes and their component members
new_species_for_sbml_dfs (pd.DataFrame) – New entries to add to sbml_dfs.species
complex_component_species_ids (pd.DataFrame) – All complex components
- napistu.modify.pathwayannot.add_entity_sets(sbml_dfs: SBML_dfs, neo4j_members: str) SBML_dfs
Add Entity Sets
Reactome represents some sets of interchangeable molecules as “entity sets”. Common examples are ligands for a receptor. This function add members of each entity set as a “is a” style reaction.
- Parameters:
sbml_dfs (SBML_dfs) – A relational mechanistic network
neo4j_members (str) – Path to a table containing Reactome entity sets and corresponding members. This is currently extracted manually with Neo4j.
- Returns:
sbml_dfs – An updated database which includes entity set species and formation reactions
- Return type:
- napistu.modify.pathwayannot.add_reactome_identifiers(sbml_dfs: SBML_dfs, crossref_path: str) SBML_dfs
Add Reactome Identifiers
Add reactome-specific identifiers to existing species
Params
- sbml_dfs: SBML_dfs
A pathway model
- crossref_path:
Path to the cross ref file extracted from Reactome’s Neo4j database
- returns:
sbml_dfs – A pathway model with updated species’ identifiers
- rtype:
SBML_dfs