项目作者: mjenior

项目描述 :
Reaction Inclusion by Parsimony and Transcript Distribution
高级语言: Python
项目地址: git://github.com/mjenior/riptide.git
创建时间: 2018-11-04T17:00:10Z
项目社区:https://github.com/mjenior/riptide

开源协议:MIT License

下载


RIPTiDe

Reaction Inclusion by Parsimony and Transcript Distribution

v3.4.79

Transcriptomic analyses of bacteria have become instrumental to our understanding of their responses to changes in their environment. While traditional analyses have been informative, leveraging these datasets within genome-scale metabolic network reconstructions (GENREs) can provide greatly improved context for shifts in pathway utilization and downstream/upstream ramifications for changes in metabolic regulation. Many previous techniques for GENRE transcript integration have focused on creating maximum consensus with input datasets, but these approaches have been shown to generate less accurate metabolic predictions than a transcript-agnostic method of flux minimization (pFBA), which identifies the most efficient/economic patterns of metabolism given certain growth constraints. Despite this success, growth conditions are not always easily quantifiable and highlights the need for novel platforms that build from these findings. This method, known as RIPTiDe, combines these concepts and utilizes overall minimization of flux weighted by transcriptomic analysis to identify the most energy efficient pathways to achieve growth that include more highly transcribed enzymes, without previous insight into extracellular conditions. This platform could be important for revealing context-specific bacterial phenotypes in line with governing principles of adaptive evolution, that drive disease manifestation or interactions between microbes.

Please cite when using:

  1. Jenior ML, Moutinho Jr TJ, Dougherty BV, & Papin JA. (2020). Transcriptome-guided parsimonious flux analysis improves predictions with metabolic networks in complex environments. PLOS Comp Biol. https://doi.org/10.1371/journal.pcbi.1007099.

Dependencies

  1. >=python-3.6.4
  2. >=cobra-0.15.3
  3. >=pandas-0.24.1
  4. >=symengine-0.4.0
  5. >=scipy-1.3.0

Installation

Installation is:

  1. $ pip install riptide

Arguments for core RIPTiDe functions:

riptide.read_transcription_file() - Generates dictionary of transcriptomic abundances from a file

  1. REQUIRED
  2. file : string
  3. User-provided file name which contains gene IDs as rows and associated transcription values as columns per replicate
  4. OPTIONAL
  5. header : boolean
  6. Defines if read abundance file has a header that needs to be ignored
  7. Default is no header
  8. sep: string
  9. Defines what character separates entries on each line
  10. Defaults to tab (.tsv)
  11. rarefy : bool
  12. Rarefies rounded transcript abundances to 90% of the smallest replicate
  13. Default is False
  14. level : int
  15. Level by which to rarefy samples
  16. Default is 100000
  17. binning : boolean
  18. Perform discrete binning of transcript abundances into quantiles
  19. OPTIONAL, not advised
  20. Default is False
  21. quant_max : float
  22. Largest quantile to consider
  23. Default is 0.9
  24. quant_min : float
  25. Smallest quantile to consider
  26. Default is 0.5
  27. step : float
  28. Step size for parsing quantiles
  29. Default is 0.125
  30. norm : bool
  31. Normalize transcript abundances using RPM calculation
  32. Performed by default
  33. factor : numeric
  34. Denominator for read normalization calculation
  35. Default is 1e6 (RPM)
  36. silent : bool
  37. Silences std out
  38. Default is False

riptide.maxfit() - Create context-specific model based on transcript distribution with maximum fit of flux distribution to input transctiptome

  1. REQUIRED
  2. model : cobra.Model
  3. The model to be contextualized
  4. transcriptome : dictionary
  5. Dictionary of transcript abundances, output of read_transcription_file()
  6. OPTIONAL
  7. frac_min : float
  8. Lower bound for range of minimal fractions to test
  9. Default is 0.25
  10. frac_max : float
  11. Upper bound for range of minimal fractions to test
  12. Default is 0.85
  13. frac_step : float
  14. Starting interval size within fraction range
  15. Default is 0.1
  16. prune : bool
  17. Perform pruning step
  18. Default is True
  19. samples : int
  20. Number of flux samples to collect
  21. Default is 500
  22. silent : bool
  23. Silences std out
  24. Default is False
  25. minimum : float
  26. Minimum linear coefficient allowed during weight calculation for pFBA
  27. Default is False
  28. conservative : bool
  29. Conservatively remove inactive reactions based on GPR rules (all member reactions must be inactive to prune)
  30. Default is False
  31. objective : bool
  32. Sets previous objective function as a constraint with minimum flux equal to user input fraction
  33. Default is True
  34. additive : bool
  35. Pool transcription abundances for reactions with multiple contributing gene products
  36. Default is False
  37. direct : bool
  38. Assigns both minimization and maximization step coefficents directly, instead of relying on abundance distribution
  39. Default is False
  40. set_bounds : bool
  41. Uses flux variability analysis results from constrained model to set new bounds for all reactions
  42. Default is True
  43. tasks : list
  44. List of gene or reaction ID strings for forced inclusion in final model (metabolic tasks or essential genes)
  45. task_lb : float
  46. Minimum flux bound for metabolic task reactions during pruning
  47. Default is equal to threshold var
  48. exclude : list
  49. List of reaction ID strings for forced exclusion from final model
  50. gpr : bool
  51. Determines if GPR rules will be considered during coefficient assignment
  52. Default is False
  53. threshold : float
  54. Minimum flux a reaction must acheive in order to avoid pruning during flux sum minimization step
  55. Default is 1e-8
  56. defined : False or list
  57. User defined range of linear coeffients, needs to be defined in a list like [1, 0.5, 0.1, 0.01, 0.001]
  58. Works best paired with binned abundance catagories from riptide.read_transcription_file()
  59. Default is False

riptide.contextualize() - Create context-specific model based on transcript distribution with user-defined objective flux minimum

  1. REQUIRED
  2. model : cobra.Model
  3. The model to be contextualized
  4. OPTIONAL
  5. transcriptome : dictionary
  6. Dictionary of transcript abundances, output of read_transcription_file()
  7. With default, an artifical transcriptome is generated where all abundances equal 1.0
  8. fraction : float
  9. Minimum objective fraction used during single run setting
  10. Default is 0.8
  11. * Other arguments from iterative implementation are carried over (excluding frac_min and frac_max)

riptide.save_output() - Writes RIPTiDe results to files in a new directory

  1. REQUIRED
  2. riptide_obj : RIPTiDe object
  3. Class object creared by riptide.contextualize()
  4. OPTIONAL
  5. path : str
  6. New directory to write output files
  7. file_type : str
  8. Type of output file for RIPTiDe model
  9. Accepts either sbml or json
  10. Default is JSON
  11. silent : bool
  12. Silences std out
  13. Default is False

Usage

Comments before starting:

  • Make sure that genes in the transcriptome file matches those that are in your model.
  • Check the example files for proper data formatting
  • Binning genes into discrete thresholds for coefficient assignment is available in riptide.read_transcription_file() (not recommended)
  • Opening the majority of exchange reactions (bounds = +/- 1000) may yeild better prediction when extracellular conditions are unknown
  • The resulting RIPTiDe object has multiple properties including the context-specific model and flux analyses, accessing each is described below
  1. import riptide
  2. my_model = cobra.io.read_sbml_model('tests/genre.sbml')
  3. transcript_abundances_1 = riptide.read_transcription_file('tests/transcriptome1.tsv')
  4. transcript_abundances_2 = riptide.read_transcription_file('tests/transcriptome2.tsv') # has replicates
  5. riptide_object_1_a = riptide.contextualize(model=my_model, transcriptome=transcript_abundances_1)
  6. riptide_object_1_b = riptide.contextualize(model=my_model, transcriptome=transcript_abundances_1, tasks=['rxn1'], exclude=['rxn2','rxn3'])
  7. riptide.save_output(riptide_obj=riptide_object_1_a, path='~/Desktop/example_riptide_output')

Example riptide.contextualize() stdout report:

  1. Initializing model and integrating transcriptomic data...
  2. Pruning zero flux subnetworks...
  3. Analyzing context-specific flux distributions...
  4. Running max fit RIPTiDe for objective fraction range: 0.65 to 0.85
  5. Progress: 100%
  6. Testing local fractions to 0.3...
  7. Progress: 100%
  8. Context-specific metabolism fit with 0.35 of optimal objective flux
  9. Reactions pruned to 285 from 1129 (74.76% change)
  10. Metabolites pruned to 285 from 1132 (74.82% change)
  11. Flux through the objective DECREASED to ~54.71 from ~65.43 (16.38% change)
  12. Context-specific metabolism correlates with transcriptome (r=0.149, p=0.011 *)
  13. Max fit RIPTiDe completed in, 4 minutes and 33 seconds

In the final step, RIPTiDe assesses the fit of transcriptomic data for the calculated network activity through correlation of transcript abundance and median flux value for each corresponding reaction. The Spearman correlation coefficient and associated p-value are the reported following the fraction of network topology that is pruned during the flux minimization step.

Max fit RIPTiDe tests all minimum objective flux fractions over the provided range and returns only the model with the best Spearman correlation between context-specific flux for reactions and the associated transcriptomic values. Note, terminating search if a subsequent iteration has a lower correlation coefficient than the last could result from a local maxima and must be considered if an exhaustive analysis is preferred.

Resulting RIPTiDe object (class) properties:

The resulting object is a container for the following data structures.

  • model - Contextualized genome-scale metabolic network reconstruction
  • transcriptome - Transcriptomic replicate abundances provided by user
  • percent_of_mapping - Percent of genes in mapping file found in input GENRE
  • minimization_coefficients - Linear coefficients used during flux sum minimization (based on transcriptome replicates)
  • maximization_coefficients - Linear coefficients for each reaction based used during flux sampling
  • pruned - Dictionary containing the IDs of genes, reactions, and metabolites pruned by RIPTiDe
  • flux_samples - Flux samples from constrained model
  • flux_variability - Flux variability analysis from constrained model
  • fraction_of_optimum - Minimum specified percentage of optimal objective flux during contextualization
  • metabolic_tasks - User defined reactions whose activity is saved from pruning
  • concordance - Spearman correlation results between linear coefficients and median fluxes from sampling
  • gpr_integration - Whether GPR rules were considered during assignment of linear coefficients
  • defined_coefficients - Range of linear coefficients RIPTiDe is allowed to utilize provided as a list
  • included_important - Reactions or Genes included in the final model which the user defined as important
  • additional_parameters - Dictionary of additional parameters RIPTiDe uses
  • fraction_bounds - Minimum and maximum values for the range of objective flux minimum fractions tested
  • maxfit_iters - Objective flux and fit to transcriptome for each minimum flux fraction tested

Examples of accessing components of RIPTiDe output:

  1. context_specific_GENRE = riptide_object.model
  2. context_specific_FVA = riptide_object.flux_variability
  3. context_specific_flux_samples = riptide_object.flux_samples

Additional Information

Thank you for your interest in RIPTiDe!

If you encounter any problems, please file an issue along with a detailed description.

Distributed under the terms of the MIT license, “riptide” is free and open source software