fluxpyt package — fluxpyt 0.1.3+ngac531ff.dirty documentation

# fluxpyt package

## Submodules

## fluxpyt.bootstrap module

Created on Wed Aug 23 12:06:00 2017

@author: Trunil

`fluxpyt.bootstrap.` `bootstrap`(**kws)

  inputs:

  > kws:
  >   rxnList: Optional. List of reactions for which bootstrapping is to be done.
  >     It should be in form of python list

  >   ylim = Optional. It should be a tuple. e.g. (0,10).

  Example

  bootstrap(‘tca’,rxnList=[‘V01’,’V02’],ylim=(0,10))

## fluxpyt.build_model module

Created on Sat Feb 6 21:09:50 2016

@author: Trunil

Reads and build model from csv. Note 2Jul2016: this program reads csv model into stoichiometric matrix with list of rxns and metabolites

`fluxpyt.build_model.` `build_model`(fileName)

`fluxpyt.build_model.` `get_linenumber`()

  Get line number in the code. Usefull to find which line of the code this function occurrs.

`fluxpyt.build_model.` `make_stoich_matrix`(reactions, reaction_formulae, excludedMetabolites=[])

  > Stoichiometric matrix (S) from reaction formulae

  Reactions must be written in form:

    A -> 2 B

    A + B <-> C

`fluxpyt.build_model.` `metabolite_list`(reaction_formulae, excludedMetabolites=[])

  > Make list of metabolites from reaction formula.

  Reactions must be written in form:
    A -> 2 B C <- A + B A + B <-> C

`fluxpyt.build_model.` `modify_rxn_for_S`(rxn, excludedMetabolites=[])

`fluxpyt.build_model.` `read_mfa_model`(filename)

  Import and read csv file. Returns the model in lists that separate columns

`fluxpyt.build_model.` `test_model_build`()

## fluxpyt.create_atm_transition_equations module

Created on Mon Jul 4 12:46:38 2016

Generates elementary reaction list.

@author: Trunil

`fluxpyt.create_atm_transition_equations.` `create_atm_transition_equations`(rxnIDs, rxnList, atm_transition_rxns, moleculeList)
  Input:
    rxnList = reaction formulae in form of list atm_transition_rxns = respective atom transition reaction list moleculeList = list of molecules observed (emu types e.g. A:0111)
  Output:
    reaction list with atom transitions, new metabolite (emu types) list

`fluxpyt.create_atm_transition_equations.` `findMolRxns`(rxnIDs, molecule, rxnList, atm_transition_rxns)

`fluxpyt.create_atm_transition_equations.` `get_coeff`(rxn)

`fluxpyt.create_atm_transition_equations.` `get_formula`(molecule, rxn, atm_rxn)

`fluxpyt.create_atm_transition_equations.` `get_new_molecule`(rxn, moleculeList, current_molecule)

`fluxpyt.create_atm_transition_equations.` `insert_hash`(list)

`fluxpyt.create_atm_transition_equations.` `num_sort`(num)

`fluxpyt.create_atm_transition_equations.` `rewrite_molecule`(molecule, rxn, atm_rxn, mol_index)

`fluxpyt.create_atm_transition_equations.` `test`()

`fluxpyt.create_atm_transition_equations.` `write_rxn_full`(rxn)

## fluxpyt.draw_flux_map module

Created on Thu Sep 21 11:07:25 2017

@author: Trunil

`fluxpyt.draw_flux_map.` `draw_flux_map`(filename)

  Input: filename of flux diagram in svg format.

## fluxpyt.free_flux_null module

Created on Mon Jun 19 10:39:54 2017

@author: Trunil

`fluxpyt.free_flux_null.` `get_null_mat`(stoich_matrix, model_metabolite)

## fluxpyt.glpk_solve module

Created on Sun Aug 7 12:37:26 2016

@author: Trunil

`fluxpyt.glpk_solve.` `glpk_solve`(mat, c, b, bounds, rxnNames, maximize=False)

`fluxpyt.glpk_solve.` `parse_output`(fileName, rxnNames)

`fluxpyt.glpk_solve.` `write_constraint`(constr_name, vec, rxnNames, model)

## fluxpyt.input_substrate_emu module

Created on Tue Aug 2 15:44:59 2016

@author: Trunil

`fluxpyt.input_substrate_emu.` `cal_substrate_mid`(fileName, elementary_rxn_list)

  Calculates substrate mids.

  Note: Only 13C carbon mids can be calculated for now.

  Input:
    1. fileName: substrate input file name. (csv format file)
    2. elementary_rxn_list: list of elementary reactions.
  assumption:
    1. nat = [0.9893, 0.0107] ... naturnal carbon isotope abundance
    2. lab = [0.01,0.99]... labeled carbon abundance

`fluxpyt.input_substrate_emu.` `detect_substrate_emus`(substrates, labeling)

`fluxpyt.input_substrate_emu.` `genInSubEMU`(substrate_info, network_substrate_emus)

`fluxpyt.input_substrate_emu.` `list_network_subs_emus`(elementary_rxn_list, substrates)

`fluxpyt.input_substrate_emu.` `read_substrate_input`(fileName)

`fluxpyt.input_substrate_emu.` `sort_sub_input`(substrates, labeling, ratios)

## fluxpyt.main module

Created on Mon Jul 4 12:23:46 2016

Main module of FluxPyt.

Collects user inputs.

All the modules are run through this.

@author: Trunil

`fluxpyt.main.` `main`()

## fluxpyt.make_emu_model module

## fluxpyt.make_emu_networks module

Created on Wed Jul 12 11:35:14 2017

@author: Trunil

`fluxpyt.make_emu_networks.` `make_networks`(mol_rxnIDs, elementary_rxn_list, measured_emus, known_mids)

## fluxpyt.mid_corr module

Created on Wed Mar 8 12:03:26 2017

Adapted from function corrMatGen in Openflux

@author: Trunil

`fluxpyt.mid_corr.` `corrMatGen`(output_size, input_size=0, molecularFormula='')

  function CM = corrMatGen(output_size, input_size, molform)

  Returns correction matrix.

  example: outputMDV = CM * inputMDV

  > Inputs:
  >   output_size: int. length of output MDV (truncated length) (number of values in measured MID
  >     e.g. pyruvate has 3 carbons (ideally 4 mids) but only three are measured or detected.)

  >   input_size: int. lenght of input MDV (carbon backbone + 1)

  >   molform: molecular formula without carbon backbone.

`fluxpyt.mid_corr.` `corrMatGen1`(output_row, input_size=0, molecularFormula='')

  function CM = corrMatGen(output_size, input_size, molform)

  Generates correction matrix.

  example: outputMDV = CM * inputMDV

  > Inputs:

  > > output_row: list of output rows i.e. masses to be calculated
  > >   e.g. [0,1,2] will give corrected mids of M+0 , M+1 and M+2 .

  > > input_size: int. lenght of input MDV (carbon backbone + 1)

  > > molform: molecular formula without carbon backbone.

`fluxpyt.mid_corr.` `getAtoms`(pos, molecularFormula)

`fluxpyt.mid_corr.` `getCoefficients`(pos, molecularFormula)

`fluxpyt.mid_corr.` `isletter`(molecularFormula)

`fluxpyt.mid_corr.` `mid_correct`(emu, mol_formula, num_obs, max_obs, mid)

`fluxpyt.mid_corr.` `stepCV`(CV, columns)

`fluxpyt.mid_corr.` `test`()

## fluxpyt.mid_vec_gen module

Generate correction vector for a given natural isotope distribution vector and number of atomic elements
  iDist = isotope_dist = isotopomer distribution vector of the atom ele = num_atom = number of elements of the same atom

Similar to corr_vect = cVectGen(iDist, ele) in openFLux by Lake-Ee Quek, AIBN Created on Mon Jul 18 16:44:48 2016

@author: Trunil

`fluxpyt.mid_vec_gen.` `mid_round`(vector)

`fluxpyt.mid_vec_gen.` `mid_vec_gen`(iDist, ele=0)

`fluxpyt.mid_vec_gen.` `sum_row`(matrix)

`fluxpyt.mid_vec_gen.` `test`()

## fluxpyt.monte_carlo module

Created on Sun Jun 25 12:36:28 2017

Monte Carlo for confidence interval estimation

@author: Trunil

`fluxpyt.monte_carlo.` `monte_carlo`(num_data=500)

  num_data = number of data sets to be genrated for monte_carlo analysis numIter = number of iteration of least square minimazation for single data set

## fluxpyt.priliminary_fba module

Created on Thu Jul 14 11:50:41 2016

@author: Trunil

`fluxpyt.priliminary_fba.` `create_objective`(stoich_matrix, model_metabolite, rxnInd='minTotal', maximize=False, boundTag=True)

`fluxpyt.priliminary_fba.` `flux_range`(rxnId, model_metabolite, stoich_matrix, bounds)

`fluxpyt.priliminary_fba.` `flux_variability`(stoich_matrix, model_metabolite, bounds)

`fluxpyt.priliminary_fba.` `make_bounds`(model_metabolite, minTotal=False)

`fluxpyt.priliminary_fba.` `priliminary_fba`(model_metabolite, stoich_matrix)

  Checks model feasibility. Returns flux variability and initial solution.

`fluxpyt.priliminary_fba.` `sort_glpk_solution`(glpk_solution, rxnNames)

## fluxpyt.solve_mfa_lm module

Created on Thu Jun 8 10:55:41 2017

Function to solve MFA problem using lmfit package

@author: Trunil

`fluxpyt.solve_mfa_lm.` `correct_mids`(cal_mids, **kws)

`fluxpyt.solve_mfa_lm.` `iter_cb`(params, iter, resid, **kws)

`fluxpyt.solve_mfa_lm.` `make_objective`(rxnId, rxnList)

`fluxpyt.solve_mfa_lm.` `prob_func`(x)

`fluxpyt.solve_mfa_lm.` `residual`(params, **kws)

`fluxpyt.solve_mfa_lm.` `solve_mfa_problem`(stoich_matrix, model_metabolite, rxnId_networks, rxn_networks, measured_mids, substrate_mids, rates, bounds, initial_sol, userInput, optimal_flux_dist=[], extra_params=[], **kws)

## fluxpyt.solve_mid_networks module

Solves the elementory metabolite unit networks.

Solves mids for only one set of flux_distribution

Created on Fri Jul 15 10:57:23 2016

@author: Trunil

`fluxpyt.solve_mid_networks.` `append_mids`(mids1, mids2)

  used when we have two lists of mids. Joins these two

`fluxpyt.solve_mid_networks.` `get_mids`(mids)

  arranges mid values and emus in list

`fluxpyt.solve_mid_networks.` `solve_mid_networks`(rxnId_networks, rxn_networks, substrate_mids, rates, flux_dist)

`fluxpyt.solve_mid_networks.` `solve_network`(rxn_ids, emu_net, known_mids, rates, flux_dist)

`fluxpyt.solve_mid_networks.` `update_mids`(rxnIds, rxns, mids)

## fluxpyt.utility module

Created on Tue Jul 19 10:44:54 2016

@author: Trunil

`fluxpyt.utility.` `find`(a, b, exclude=False)

  a = list b = item to be found

`fluxpyt.utility.` `nCr`(n, r)

  http://stackoverflow.com/questions/4941753/is-there-a-math-ncr-function-in-python

`fluxpyt.utility.` `pause`()

`fluxpyt.utility.` `prod`(array)

  array = list of lists

`fluxpyt.utility.` `size`(array)

  array should be numpy array or list of lists

`fluxpyt.utility.` `space`()

`fluxpyt.utility.` `split_rxn`(rxn)

`fluxpyt.utility.` `sum_matrix`(matrix)

  gives sum of elements in a matrix. matrix = list of list of numbers

## Module contents