Scripts: 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:
manual_curation.py --padmetSpec=FILE --data=FILE [--padmetRef=FILE] [--output=FILE] [--tool=STR] [--category=STR] [-v]
manual_curation.py --template_new_rxn=FILE
manual_curation.py --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.
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_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_compart.py --padmet=FILE
padmet_compart.py --padmet=FILE --remove=STR [--output=FILE] [-v]
padmet_compart.py --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.
remove_compart
(padmet, to_remove, verbose=False)[source]¶ Remove all reaction associated to a compound in the compartment to remove.
Parameters: Returns: New padmet after removing compartment(s)
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_medium.py --padmetSpec=FILE
padmet_medium.py --padmetSpec=FILE -r [--output=FILE] [-v]
padmet_medium.py --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.
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: Returns: New padmet after updating medium
Return type: padmet.classes.PadmetSpec