API for padmet.utils.management

Description:

#TODO

manual_curation

Description:

Update a padmetSpec by filling specific forms.

1./ Create new reaction(s) to padmet file.

  • Get the template form with –template_new_rxn

  • Fill the template

  • set –data as path to the filled template

2./ Add reaction(s) from padmetRef or remove reactions(s).

  • Get the template form with –template_add_delete_rxn

  • Fill the template

  • set –date as path to the filled template

Update padmetSpec and create a new padmet (new_padmet) or overwrite the input

usage:
    padmet manual_curation --padmetSpec=FILE --data=FILE [--padmetRef=FILE] [--output=FILE] [--tool=STR] [--category=STR] [-v]
    padmet manual_curation --template_new_rxn=FILE
    padmet manual_curation --template_add_delete_rxn=FILE

option:
    -h --help    Show help.
    --padmetSpec=FILE    path to the padmet to update
    --padmetRef=FILE    path of the padmet representing the reference database
    --data=FILE    path to the form with data for curation
    --output=FILE    path to the output. if None. Overwriting padmetSpec
    --tool=STR    specification of the tool used to allow this curation: ex a tool of gapfilling (meneco)
    --category=STR    specification of the category of curation: ex if a reaction is added based on annotation info, use 'annotation'
    --template_new_rxn=FILE    create a form used to create new reaction, use this form as input for 'data' option
    --template_add_delete_rxn=FILE    create a form used to add or delete reaction, use this form as input for 'data' option
    -v    print info
padmet.utils.management.manual_curation.add_delete_rxn(data_file, padmetSpec, output, padmetRef=None, source=None, tool=None, category='MANUAL', verbose=False)[source]

Read a data_file (form created with template_add_delete and filed), for each reaction if column ‘Action’ == ‘add’:

add the reaction from padmetRef to padmetSpec.

elif column ‘Action’ == ‘delete’:

remove the reaction

Can’t add a reaction without a padmetRef !

the source ensure the traceability of the reaction, its a simple tag ex ‘pathway_XX_update’ if not given the filename of data_file will be used. if a tool was used to infer the reaction, define tool=’name_of_the_tool’

Parameters:
  • data_file (str) – path to file based on template_new_rxn()

  • padmetSpec (padmet.classes.PadmetSpec) – padmet to update

  • padmetRef (padmet.classes.PadmetRef) – padmet containing the database of reference

  • output (str) – path to the new padmet file

  • source (str) – tag associated to the new reactions to create and add, used for traceability

  • tool (str) – The eventual tool used to infer the reactions to create and add

  • category (str) – The default category of the reaction added manually is ‘MANUAL’. Must not be changed.

  • verbose (bool) – if True print information

padmet.utils.management.manual_curation.command_help()[source]

Show help for analysis command.

padmet.utils.management.manual_curation.manual_curation_cli(command_args)[source]
padmet.utils.management.manual_curation.rxn_creator(data_file, padmetSpec, output, padmetRef=None, source=None, tool=None, category='MANUAL', verbose=False)[source]

Read a data_file (form created with template_new_rxn and filed), for each reaction to create, add the reaction in padmetSpec (only if the id of the reaction is not already in padmetSpec or in padmetRef if given) the source ensure the traceability of the reaction, its a simple tag ex ‘pathway_XX_update’ if not given the filename of data_file will be used. if a tool was used to infer the reaction, define tool=’name_of_the_tool’ the Padmet of reference padmetRef can be used to check that the reaction id is not already in the database and copy information from the database for existing compounds strongly recommended to give a padmetRef.

Parameters:
  • data_file (str) – path to file based on template_new_rxn()

  • padmetSpec (padmet.classes.PadmetSpec) – padmet to update

  • output (str) – path to the new padmet file

  • source (str) – tag associated to the new reactions to create and add, used for traceability

  • tool (str) – The eventual tool used to infer the reactions to create and add

  • category (str) – The default category of the reaction added manually is ‘MANUAL’. Must not be changed.

  • padmetRef (padmet.classes.PadmetRef) – padmet containing the database of reference

  • verbose (bool) – if True print information

padmet.utils.management.manual_curation.sniff_datafile(data_file)[source]

Read data_file and check which kind of data input it is. A reaction_creator file contains only 2 columns. Add reaction_add_delete more than 2. Basic, need to be improved.

Parameters:

data_file (str) – path to file of reaction_creator or reaction_add_delete.

Returns:

“rxn_creator” or “add_delete_rxn”

Return type:

str

padmet.utils.management.manual_curation.template_add_delete(output)[source]

Generate template file used as input of add_delete_rxn function

Parameters:

output (str) – path for the template rxn_add_delete to create

padmet.utils.management.manual_curation.template_new_rxn(output)[source]

Generate template file used as input of rxn_creator function

Parameters:

output (str) – path for the template new_rxn to create

padmet_compart

Description:

For a given padmet file, check and update compartment.

1./ Get all compartment with 1st usage

2./ Remove a compartment with 2nd usage. Remove all reactions acting in the given compartment

3./ change compartment id with 3rd usage

usage:
    padmet padmet_compart --padmet=FILE
    padmet padmet_compart --padmet=FILE --remove=STR [--output=FILE] [-v]
    padmet padmet_compart --padmet=FILE --old=STR --new=STR [--output=FILE] [-v]

options:
    -h --help     Show help.
    --padmet=FILE    pathname of the padmet file
    --remove=STR    compartment id to remove
    --old=STR    compartment id to change to new id
    --new=STR    new compartment id
    --output=FILE    new padmet pathname, if none, overwritting the original padmet
    -v   print info
padmet.utils.management.padmet_compart.command_help()[source]

Show help for analysis command.

padmet.utils.management.padmet_compart.padmet_compart_cli(command_args)[source]
padmet.utils.management.padmet_compart.remove_compart(padmet, to_remove, verbose=False)[source]

Remove all reaction associated to a compound in the compartment to remove.

Parameters:
  • padmet (padmet.classes.PadmetSpec) – padmet to udpate

  • to_remove (str) – compartment id to remove, if many separate compartment id by ‘,’

  • verbose (bool) – if True print information

Returns:

New padmet after removing compartment(s)

Return type:

padmet.classes.PadmetSpec

padmet.utils.management.padmet_compart.replace_compart(padmet, old_compart, new_compart, verbose=False)[source]

Replace compartment ‘old_compart’ by ‘new_compart’.

Parameters:
  • padmet (padmet.classes.PadmetSpec) – padmet to udpate

  • old_comaprt (str) – compartment id to remplace

  • new_compart (str) – new compartment id

  • verbose (bool) – if True print information

Returns:

New padmet after remplacing compartment

Return type:

padmet.classes.PadmetSpec

padmet_medium

Description:

For a given set of compounds representing the growth medium (or seeds). Create 2 reactions for each compounds to maintain consistency of the network for flux analysis. For each compounds create:

An exchange reaction: this reaction consumes the compound in the compartment ‘C-BOUNDARY’ and produces the compound in the compartment ‘e’ extracellular

A transport reaction: this reaction consumes the compound in the compartment ‘e’ extracellular’ and produces the compound in the compartment ‘c’ cytosol ex: for seed ‘cpd-a’

1/ check if cpd-a in padmetSpec, if not, copy from padmetRef.

2/ create exchange reaction: ExchangeSeed_cpd-a_b: 1 cpd-a (C-BOUNDARAY) <=> 1 cpd-a (e)

3/ create transport reaction: TransportSeed_cpd-a_e: 1 cpd-a (e) => 1 cpd-a (c)

4/ create a new file if output not None, or overwrite padmetSpec

usage:
    padmet padmet_medium --padmetSpec=FILE
    padmet padmet_medium --padmetSpec=FILE -r [--output=FILE] [-v]
    padmet padmet_medium --padmetSpec=FILE --seeds=FILE [--padmetRef=FILE] [--output=FILE] [-v]

options:
    -h --help     Show help.
    --padmetSpec=FILE    path to the padmet file to update
    --padmetRef=FILE    path to the padmet file representing to the database of reference (ex: metacyc_18.5.padmet)
    --seeds=FILE    the path to the file containing the compounds ids and the compart, line = cpd-id        compart.
    --output=FILE    If not None, pathname to the padmet file updated
    -r    Use to remove all medium from padmet
    -v   print info
padmet.utils.management.padmet_medium.command_help()[source]

Show help for analysis command.

padmet.utils.management.padmet_medium.manage_medium(padmet, new_growth_medium=None, padmetRef=None, verbose=False)[source]

Manage medium of a padmet. If new_growth_medium give, use this list of compound to define the new medium and create transport and exchange reactions. if padmetRef given, use the information from padmetRef to create the missing compound. If no new_growth_medium given: remove the current medium in the padmet.

Parameters:
  • padmet (padmet.classes.PadmetSpec) – padmet to update

  • new_growth_medium (list) – list of compound id representing the medium

  • padmetRef (padmet.classes.PadmetRef) – padmet containing the database of reference

  • verbose (bool) – if True print information

Returns:

New padmet after updating medium

Return type:

padmet.classes.PadmetSpec

padmet.utils.management.padmet_medium.padmet_medium_cli(command_args)[source]

relation_curation

:

usage:

padmet relation_curation –padmet=FILE –id_in=STR [–type=STR] [-v] padmet relation_curation –padmet=FILE –id_out=STR [–type=STR] [-v] padmet relation_curation –padmet=FILE –id_in=STR [–type=STR] –to-remove==STR –output=FILE [-v] padmet relation_curation –padmet=FILE –id_in=STR –id_out=STR [–type=STR] –to-remove==STR –output=FILE [-v]

option:

-h –help Show help. –model_metabolic=FILE pathname to the metabolic network of the model (sbml). –study_metabolic=FILE **. –inp=FILE **. –omcl=FILE **. –output=FILE **. -v print info.

padmet.utils.management.relation_curation.command_help()[source]

Show help for analysis command.

padmet.utils.management.relation_curation.get_relations(padmet, id_in=None, id_out=None, _type=None, to_remove=None, output=None, verbose=False)[source]
padmet.utils.management.relation_curation.relation_curation_cli(command_args)[source]