Curation

Modules related with the ComPath curation exercise.

This module loads the hierarchical pathway databases into ComPath.

compath.curation.hierarchies.create_hierarchical_mappings(pathways, compath_manager, pathway_database, curator)[source]

Iterate over pathway objects and creates hierarchies if exist.

Parameters
Returns

number of created mappings

Return type

int

compath.curation.hierarchies.load_hierarchy(*, connection=None, curator_email=None)[source]

Load the hierarchical relationships for the managers containing them.

Parameters
  • connection (Optional[str]) –

  • curator_email (Optional[str]) – email of the admin

This module contains all the curation processing methods to integrate curated mappings to ComPath.

compath.curation.parser.get_users_from_emails(compath_manager, curator_emails)[source]

Return a list with curator users.

Parameters
Return type

list[User]

compath.curation.parser.parse_special_mappings(path, curator_emails=None, connection=None)[source]

Parse special mapping file.

Parameters
  • path (str) – path of the excel sheet

  • curator_emails (Optional[list]) – emails of the curators. Needs to be already in the database

compath.curation.parser.parse_curation_template(path, reference_pathway_db, compared_pathway_db, curator_emails=None, connection=None)[source]

Load the curation template excel sheet into a pandas Dataframe.

Parameters
  • path (str) – path of the excel sheet

  • reference_pathway_db (str) – name of the manager of the reference pathway_db

  • compared_pathway_db (str) – name of the manager of the compared pathway_db

  • curator_emails (Optional[list]) – email of the curators. Needs to be already in the database

  • connection (str) – database connection

This module contains all the utils for curation processing.

compath.curation.utils.remove_star_from_pathway_name(pathway_name)[source]

Remove the star that label the reference pathway in isPartOf statements.

Parameters

statements (str) – pathway name

compath.curation.utils.get_pathways_from_statement(mapping_statement, mapping_type)[source]

Return the subject, object of the mapping.

Parameters
  • mapping_statement (str) – statement

  • mapping_type (str) – type of relationship

Return type

tuple[str,str]

compath.curation.utils.is_valid_pathway_name(manager_dict, resource, pathway_name)[source]

Check if pathway name exists in pathway database.

Parameters
  • manager_dict (dict) – manager name to manager instances dictionary

  • resource (str) – resource name

  • pathway_name (str) – pathway name

Return type

bool

compath.curation.utils.is_valid_pathway_by_id(manager_dict, resource, pathway_id)[source]

Check if pathway identifier exists in pathway database.

Parameters
  • manager_dict (dict) – manager name to manager instances dictionary

  • resource (str) – resource name

  • pathway_id (str) – pathway identifier

Return type

bool