psamm.manual_curation – Model Mapping Curation

class psamm.manual_curation.Curator(compound_map_file, reaction_map_file, curated_compound_map_file, curated_reaction_map_file)

Parse and save mapping files during manual curation.

Use add_mapping() to add new curated pairs. Save current progress into files by save().

Besides the curated mapping files, the Curator will also store false mappings into .false files, and compounds and reactions to be ignored can be stored in .ignore files. For example, if the curated_compound_map_file is set to curated_compound_mapping.tsv, then the false mappings will be stored in curated_compound_mapping.tsv.false, and the pairs to be ignored should be stored in curated_compound_mapping.tsv.ignore.

If the curated files already exist, the Curator will consider them as the previous progress, then append new curation results.

Parameters:
  • compound_map_file – .tsv file of compound mapping result
  • reaction_map_file – .tsv file of reaction mapping result
  • curated_compound_map_file – .tsv file of curated compound mapping result
  • curated_reaction_map_file – .tsv file of curated reaction mapping result
reaction_checked(id)

Return True if reaction pair has been checked.

Parameters:id – one reaction id or a tuple of id pair
reaction_ignored(id)

Return True if reaction id is in ignore list.

compound_checked(id)

Return True if compound pair has been checked.

Parameters:id – one compound id or a tuple of id pair
compound_ignored(id)

Return True if compound id is in ignore list.

add_mapping(id, type, correct)

Add new mapping result to curated list.

Parameters:
  • id – tuple of id pair
  • type – ‘c’ for compound mapping, ‘r’ for reaction mapping
  • correct – True if the mapping pair is correct
add_ignore(id, type)

Add id to ignore list.

Parameters:
  • id – id to be ignored
  • type – ‘c’ for compound mapping, ‘r’ for reaction mapping
save()

Save current curator to files.

psamm.manual_curation.search_compound(model, id)

Search a set of compounds, then print detailed properties.

Parameters:id – a list of compound ids
psamm.manual_curation.search_reaction(model, ids)

Search a set of reactions, print detailed properties, then return a generator. Each item in the generator is a list of compounds in the corresponding reaction.

Parameters:ids – a list of reaction ids