Reference
process.py
- class isodesign.base.process.Process
Bases:
objectThe Process class is the main class to organise IsoDesign functionalities. Key features: - importing and reading data files - generating combinations of isotopomers that are stored in influx_si .linp files - runs simulations with influx_s to get predicted fluxes and associated SDs - generates a summary.
- FILES_EXTENSION = ['.netw', '.tvar', '.mflux', '.miso', '.cnstr', '.mmet', '.opt']
- add_isotopomer(substrate_name, labelling, intervals_nb, lower_b, upper_b, price=None)
Add isotopomer to the isotopomers dictionary (self.isotopomers).
- Parameters:
substrate_name – name of the substrate
labelling – labelling of the isotopomer
intervals_nb – number of intervals to test
lower_b – lower bound
upper_b – upper bound
price – price of the isotopomer.
- analyse_model()
Analyze model network to identify substrates, metabolites, etc by using modules from influx_si.
- apply_log()
Apply a log of 10 to the values contained in the score table (stored in the self.scores attribute).
- check_err_files()
Check if, at the end of calculations with influx_si, “.err” files are empty. If they are not, return the file names and contents.
- clear_previous_linp()
Clear the “.linp” files generated by the previous run.
- clear_previous_results()
Clear the “_res” folder containing the results of the previous run.
- clear_tmp_folder()
Clear the temp folder containing all the files generated by IsoDesign.
- configure_linp_files()
This method configures the structure and content of future linp files, a TSV format used for labelled simulations, grouping label input forms and their fractions. Dataframes are generated in linp format, each containing a specific combination of labelled substrates. These dataframes are then stored and used to create the final linp files.
- configure_unlabelled_form()
Add the unlabelled form of the inputs to the isotopomers dictionary (key: substrate name, value: list of isotopomers) with default values.
- copy_files()
Copy the imported files in the linp folder. All the files that will be passed to influx_si have to be in the same folder.
- create_tmp_folder()
Create a temp folder to store all the files generated by IsoDesign.
- data_filter(fluxes_names: list = None, kind: list = None, pathways: list = None)
Filters summary dataframe by fluxes names, kind and/or metabolic pathway
- Parameters:
fluxes_names – list of fluxes names to be displayed
kind – “NET”, “XCH”, “METAB”
pathway – name of metabolic pathways to be displayed
- Returns:
filtered dataframe
- export_data(number, figure)
Export the results of the analysis to tsv files and an image file (html format).
- Parameters:
number – number corresponding to the analysis
figure – plotly figure object
- generate_combinations()
Generate all possible combinations of labelled substrates using the LabelInput class.
- generate_linp_files()
Generates linp files (TSV format) in the temp folder (self.tmp_folder_path). Each file contains a combination of labelled substrates.
A file is generated containing a mapping that associates each file number with its respective combinations.
- generate_score(method: list, operation=None, **kwargs)
Generate a score for each labelled substrate combination according on the criteria method(s) applied.
- Parameters:
method – list of criteria methods to apply
operation – operation to apply to the scores (Addition, Multiply, Divide)
kwargs – additional arguments for the rating methods
- generate_summary()
- Read the tvar.sim files and generate a summary dataframe containing :
flux names, flux types,
the flux values in the tvar.sim files,
the difference between the flux values in the input tvar file and the tvar.sim files,
flux SDs in each tvar.sim file
The summary dataframe is generated in an excel file in the results folder. During the simulation, fluxes are added. These are highlighted in the summary dataframe.
- generate_vmtf_file()
Generate a vmtf file (TSV format) that permit to combine variable and constant parts of a network model. This file contained columns using imported files extensions. Each row contains imported files names that will be used to produce a ftbl file used in the calculation. Each row have ftbl column with unique and non empty name.
- get_isotopomer_price(isotopomer_labelling, isotopomer_name)
Get the price of an isotopomer based on its labelling and name from the isotopomers dictionary.
- Parameters:
isotopomer_labelling – isotopomer labelling
isotopomer_name – isotopomer name
- get_path_input_netw(netw_directory_path)
Get the directory path of the netw file (essential file containing all reactions and transition labels). From this path, we also store the directory path and the name of the model to be analyzed.
- Parameters:
netw_directory_path – str containing the path to the netw file
- influx_simulation(param_list)
Run the simulation using the specified influx_si mode (stationary or instationary).
- Parameters:
param_list – List of command-line arguments to pass to influx_si.
- Returns:
A Popen object representing the running subprocess.
- load_model()
Load MTF files depending on the model name.
- register_scores(number, block_name)
Stores the analysis data (dataframe, criteria, criteria parameters, score table, filters and operations) in a dictionary. This method updates the all_scores dictionary with a new key identified by the specified “number”.
- Parameters:
number – number corresponding to the analysis
- reintegrate_linp_configuration(index_to_reintegrate: list)
Reintegrates linp DataFrames into the linp_dataframes list according to the indices specified in the list provided.
- Parameters:
index_to_reintegrate – list of indices to reintegrate into linp_dataframes.
- remove_isotopomer(substrate, labelling)
Remove isotopomer from the isotopomer dictionary (self.isotopomers) according to the substrate name and labelling.
- Parameters:
substrate – substrate name
labelling – labelling for isotopomer to remove
- remove_linp_configuration(index_to_remove: list)
Removes linp DataFrames from the linp_dataframes list according to the indices specified in the list provided.
- Parameters:
index_to_remove – list of indices to remove from linp_dataframes
- save_process_to_file()
Save the Process object to a pickle file in the model directory.
isotopomer.py
- class isodesign.base.isotopomer.Isotopomer(name, labelling, intervals_nb=10, lower_bound=1, upper_bound=1, price=None)
Bases:
objectClass for the initiation of isotopomer
- generate_fraction()
Generate numpy array containing list of possible fraction between lower_bound and upper_bound depending of the step value. Fractions will be used for influx_si simulations. Influx_si takes only values that are between 0 and 1.
- Returns:
numpy array containing list of possible fraction
- property intervals_nb
- property labelling
- property lower_bound
- property step
- property upper_bound
label_input.py
score.py
- class isodesign.base.score.Score(label_input)
Bases:
objectClass containing the implementation of the rating criteria
- apply_number_labeled_inputs(info_linp_files_dict, weight_labeled_input=1)
Returns the number of labelled substrates for each label input.
- Parameters:
info_linp_files_dict – dictionary containing namedtuples with the number of labelled substrates for each label input
weight_labeled_input – the weight to apply to the score
- apply_price(info_linp_files_dict)
Returns the price for each label input.
- Parameters:
info_linp_files_dict – dictionary containing namedtuples with the price for each label input
- apply_sum_nb_flux_sd(threshold, weight_flux=1)
Returns the total number of fluxes with sds below a given threshold.
- Parameters:
threshold – the threshold value used to filter the flux values
weight_flux – the weight to apply to the score
- apply_sum_sd(weight_sum_sd=1)
Returns the sum of standard deviations for a given label input
- Parameters:
weight_sum_sd – he weight to apply to the score
- compute(criteria, **kwargs)
Computes the score and stores it in self.score according to the given criteria.
- Parameters:
criteria – the criteria to apply
kwargs – additional arguments to pass to the selected criteria. If the weight is
not provided in kwargs for the selected criteria, the default value is 1.
- structurally_identified_fluxes(struct_identif_dict, weight_struct_identif=1)
Returns the number of structurally identified fluxes for each label input.
- Parameters:
struct_identif_dict – dictionary containing the number of structurally identified fluxes for each label input
- class isodesign.base.score.ScoreHandler(dataframe)
Bases:
objectThis class applies rating methods and performs operations between them. .
- apply_criteria(criteria: list, **kwargs)
Apply criteria to the dataframe columns via the score_object class
- Parameters:
criteria – method(s) to apply to the columns
kwargs – additional arguments
- apply_operations(operation)
Apply an operation to the score_objects of the columns
- Parameters:
operation – the operation to apply to the score_objects (Addition, Multiply, Divide)