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

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.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

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.remplace_compart(padmet, old_compart, new_compart, verbose=False)[source]

Remplace 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

.. py:function:: manage_medium(padmet, new_growth_medium=None, padmetRef=None, verbose=False)
module:padmet.utils.management.padmet_medium

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.

param padmet:padmet to update
type padmet:padmet.classes.PadmetSpec
param new_growth_medium:
 list of compound id representing the medium
type new_growth_medium:
 list
param padmetRef:
 padmet containing the database of reference
type padmetRef:padmet.classes.PadmetRef
param verbose:if True print information
type verbose:bool
returns:New padmet after updating medium
rtype:padmet.classes.PadmetSpec

relation_curation

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