MATLAB vs Python#

RAVEN ships as a MATLAB toolbox and as the Python package raven-toolbox. This page is generated from the source of both toolboxes at build time. Pairs are found automatically where the names match, completed from a curated list where they do not, and marked with a cobrapy badge where cobrapy covers the function instead of raven-toolbox. Every name is verified to exist.

Paired functions#

130 RAVEN functions listed: 53 matched automatically, 49 from a curated list, 28 covered by cobrapy instead of raven-toolbox.

RAVEN (MATLAB)

raven-toolbox (Python)

Summary

addExchangeRxns

cobra.Model.add_boundary cobrapy

Add exchange reactions for some metabolites.

addGenesRaven

cobra.Reaction.gene_reaction_rule cobrapy

Add genes to a model.

addIdentifierPrefix

cobra.io.read_sbml_model cobrapy

Add identifier prefixes required by SBML.

addMets

cobra.Metabolite cobrapy

Add metabolites to a model.

addRxns

add_reactions_from_equations

Add reactions to a model.

addRxnsGenesMets

add_reactions_from_model

Copy reactions from a source model into another model.

addTransport

add_transport_reactions

Add transport reactions between compartments.

analyzeSampling

analyze_sampling

Compare flux change significance with expression change.

applyCondition

apply_condition

Apply a deterministic condition to a model.

assignCompartments

assign_compartments

Assign reactions to compartments by a functionality-constrained MILP.

assignSBOterms

add_sbo_terms

Assign SBO terms to metabolites and reactions.

canExchange

analyse_topology

Check which metabolites a model can produce or consume.

changeGrRules

change_gene_reaction_rules

Change multiple grRules at the same time.

changeRxns

change_reaction_equations

Modify the equations of reactions in a model.

checkModelStruct

check_model

Perform a number of checks to ensure a model structure is ok.

checkProduction

analyse_topology

Check which metabolites can be produced from a model.

checkTasks

check_tasks

Perform a set of simulations as defined in a task file.

closeModel

close_model

Add boundary metabolites and their exchange reactions.

compareFluxes

compare_fluxes

Find the most significant flux changes between two conditions.

compareMultipleModels

compare_models

Compare two or more condition-specific models.

constructEquations

cobra.Reaction.build_reaction_string cobrapy

Construct equation strings for reactions.

contractModel

remove_duplicate_reactions

Contract a model by grouping all identical reactions.

convertToIrrev

convert_to_irreversible

Convert a model to irreversible form.

copyToComps

copy_to_compartment

Copy reactions to new compartment(s).

curateModelFromTables

batch_curate_from_tsv

Curate or add mets, rxns and genes from tables.

deleteUnusedGenes

remove_genes

Delete all genes not associated to any reaction.

diffModels

diff_models

Report the semantic differences between two models.

downloadGenomeData

download_genome_data

Download genome annotation files from NCBI.

expandModel

expand_model

Expand reactions that use several gene associations.

exportForGit

export_for_git

Export a model for a Git-maintained model repository.

exportModel

cobra.io.write_sbml_model cobrapy

Export a constraint-based model to an SBML file (L3V1 FBCv2).

exportToExcelFormat

export_to_excel

Export a model to the Microsoft Excel model format.

fillGaps

connect_blocked_reactions

Use template model(s) to fill gaps in a model.

findDuplicateRxns

find_duplicate_reactions

Find reactions that share identical stoichiometry.

findGeneDeletions

cobra.flux_analysis.single_gene_deletion cobrapy

Delete genes and track the resulting fluxes.

findLeakMetabolite

find_leak_metabolite

Find a metabolite that can be freely made or consumed.

fitParameters

fit_parameters

Fit stoichiometric parameters such as maintenance ATP to measured data.

fitTasks

fill_tasks

Fill gaps in a model so it can perform a list of tasks.

FSEOF

fseof

Flux Scanning based on Enforced Objective Flux.

ftINIT

ftinit

Generate a model using the ftINIT algorithm.

ftINITFillGaps

fill_tasks

Variant of fillGaps specially adapted to speed up generation of ftINIT models.

ftINITInternalAlg

run_ftinit

This function runs the MILP for a step in ftINIT.

gapFillFastCore

fill_gaps_fast_lp

L1-norm LP subroutine for fastGapFill.

gapFillFastLP

fill_gaps_fast_lp

LP-based gap-filling (fastGapFill / swiftGapFill).

gapFillMILP

fill_gaps_milp

Objective-based gap-filling via a global growth-floor MILP.

gapFillSwiftCore

fill_gaps_fast_lp

SWIFTCORE LP subroutine for swiftGapFill.

gapFillTopological

analyse_topology

BFS metabolite-producibility pre-screening.

gapReport

gap_report

Perform a gap analysis and summarize the results.

generateNewIds

generate_new_ids

Generate a list of new metabolite or reaction ids.

getAllowedBounds

cobra.flux_analysis.flux_variability_analysis cobrapy

Return the minimal and maximal fluxes through reactions.

getAllRxnsFromGenes

cobra.Gene.reactions cobrapy

Find all reactions annotated by the genes of a set.

getAllSubGraphs

analyse_topology

Get all metabolic subgraphs in a model.

getBiomassFractions

sum_biomass

Compute mass fraction per biomass component.

getBlast

run_blast

Bidirectional BLAST between an organism and template organisms.

getDiamond

run_diamond

Bidirectional BLAST with DIAMOND against template organisms.

getElementalBalance

get_elemental_balance

Check whether the reactions of a model are balanced.

getEssentialRxns

find_task_essential_reactions

Calculate the essential reactions for a solvable model.

getExchangeRxns

cobra.Model.exchanges cobrapy

Retrieve the exchange reactions from a model.

getFluxZ

get_flux_z

Calculate Z scores between two sets of random flux distributions.

getGeneData

get_gene_data

Build a gene-mapping table from NCBI genome annotation files.

getGenesFromGrRules

cobra.core.gene.GPR cobrapy

Extract gene list and rxnGeneMat from grRules array.

getIndexes

cobra.DictList.get_by_id cobrapy

Retrieve the indexes for a list of reactions or metabolites.

getINITSteps

get_init_steps

Define the steps used as input to ftINIT.

getKEGGModelForOrganism

get_kegg_model_for_organism

Reconstruct a model from KEGG protein homology.

getMinimalMedium

cobra.medium.minimal_medium cobrapy

Find the minimal set of uptake reactions for growth.

getMinNrFluxes

get_min_nr_fluxes

Find the minimal set of fluxes that satisfy the model.

getModelFromHomology

get_model_from_homology

Construct a new model from existing models and homology.

getModelFromKEGG

build_reference_model

Load the global KEGG model.

getPhylDist

phyl_dist

Load the pre-built KEGG phylogenetic distance matrix.

getRxnsInComp

cobra.Reaction.compartments cobrapy

Get the reactions in a specified compartment.

getUniProtScores

load_uniprot

Fetch curated subcellular locations from UniProt -> gene scoring structure.

groupRxnScores

group_rxn_scores

This function sums up the reaction scores for all reactions that were merged

grRuleToDNF

gpr_to_dnf

Convert a grRule to disjunctive normal form.

grRuleToString

cobra.core.gene.GPR cobrapy

Render a grRule syntax tree back to a string.

guessComposition

guess_composition

Guess the composition of metabolites without one.

haveFlux

analyse_topology

Check which reactions can carry a flux.

hitsFromSuppOrth

hits_from_supporth

Read SuppOrth consensus orthologs into a blastStructure.

importModel

cobra.io.read_sbml_model cobrapy

Import a constraint-based model from an SBML file.

isDnfGrRule

is_dnf

Test whether a grRule is in disjunctive normal form.

loadDeltaGCSV

load_delta_g_csv

Load metDeltaG and rxnDeltaG from CSV files.

makeFakeBlastStructure

make_ortholog_hits

Make a fake blastStructure from an ortholog list.

mergeCompartments

merge_compartments

Merge all compartments in a model.

mergeLinear

merge_linear

Simplifies a model by merging rxns with linear dependencies. There are two

mergeModels

merge_models

Merge models into one model structure.

modelSummary

cobra.Model.summary cobrapy

Print a concise overview of a RAVEN model and its flux state.

optimizeProb

cobra.Model.solver cobrapy

Optimize an LP or MILP formulated in COBRA terms.

parseGrRule

cobra.core.gene.GPR cobrapy

Parse a grRule into a syntax tree.

parseHPA

parse_hpa

Parse a database dump of the Human Protein Atlas (HPA).

parseHPArna

parse_hpa_rna

Parse a dump of Human Protein Atlas (HPA) RNA-Seq data.

parseScores

combine_scores

Parse predictor / database output into a gene scoring structure (GSS).

parseTaskList

parse_task_list

Parse a task list file.

predictLocalization

predict_localization

Assign reactions to compartments using localization predictors.

prepINITModel

prep_init_model

Precompute omics-independent data for ftINIT.

printModelStats

cobra.Model cobrapy

Print some statistics about a model to the screen.

processProteinFastaFile

process_protein_fasta_file

Rename protein FASTA headers using a gene mapping table.

randomSampling

random_sampling

Sample the flux solution space (entry point for all samplers).

readKEGGTable

read_kegg_table

Read a gzipped KEGG relational table into a table with

readYAMLmodel

read_yaml_model

Read a model structure from a YAML file.

removeGenes

remove_genes

Delete a set of genes from a model.

removeIdentifierPrefix

cobra.io.write_sbml_model cobrapy

Remove SBML-required identifier prefixes.

removeLowScoreGenes

remove_low_score_genes

Remove low-scoring genes from model.

removeMets

remove_metabolites

Delete a set of metabolites from a model.

removeReactions

cobra.Model.remove_reactions cobrapy

Delete a set of reactions from a model.

renameModelGenes

rename_model_genes

Replace gene identifiers in a RAVEN model.

replaceMets

replace_metabolite

Replace a metabolite with another already in the model.

reporterMetabolites

reporter_metabolites

Identify metabolites around which transcriptional changes occur.

rescaleModelForINIT

rescale_for_init

Rescale a model to avoid large stoichiometric differences.

runPhenotypePhasePlane

cobra.flux_analysis.production_envelope cobrapy

Run phenotype phase plane analysis and plot the results.

runProductionEnvelope

cobra.flux_analysis.production_envelope cobrapy

Calculate the byproduct secretion envelope.

runSuppOrth

run_supporth

Run SuppOrth on an organism and template proteomes.

sampleACHR

random_sampling

Artificially Centered Hit-and-Run flux sampling.

sampleCHRR

random_sampling

Coordinate Hit-and-Run with Rounding flux sampling.

saveDeltaGCSV

save_delta_g_csv

Save metDeltaG and rxnDeltaG to CSV files.

scaleBiomassFraction

scale_biomass

Rescale a biomass component to a target value.

scaleBiomassPseudoreaction

rescale_pseudoreaction

Rescale a biomass component pseudoreaction.

scoreModel

score_reactions_from_genes

Score reactions and genes in a model with complex gene rules.

setExchangeBounds

set_exchange_bounds

Define exchange flux bounds for a set of metabolites.

setExchangeBounds

cobra.Model.medium cobrapy

Define exchange flux bounds for a set of metabolites.

setGAM

set_gam

Set the growth-associated maintenance (GAM) coefficient.

setParam

cobra.Reaction.bounds cobrapy

Set parameters for reactions.

setRavenSolver

cobra.Configuration cobrapy

Set the solver for RAVEN.

simplifyModel

simplify_model

Simplify a model by deleting reactions and metabolites.

solveLP

cobra.Model.optimize cobrapy

Solve a linear programming problem.

sortIdentifiers

sort_identifiers

Sort model identifiers alphabetically.

sortModel

sort_identifiers

Standardize a model's internal ordering: by default orients

standardizeGrRules

gpr_to_dnf

Standardize gene-reaction rules in a model.

traceFluxPath

trace_flux_path

Find the highest-flux-fraction path between two reactions.

walkFluxes

walk_fluxes

Interactively navigate a flux distribution reaction by reaction.

writeFasta

write_fasta

Write sequences to a FASTA file.

writeYAMLmodel

write_yaml_model

Write a model to a yaml file in the standard cobra-format

Deliberately not ported#

RAVEN (MATLAB)

Why not

buildEquation

Internal helper for building an equation string from raw metabolites and coefficients; the equivalent is inside add_reactions_from_equations and cobra.Reaction.build_reaction_string, both already mapped.

buildGlobalGPR

Internal to assembling the global KEGG reference model; the equivalent is inside build_reference_model, already mapped from getModelFromKEGG.

buildGlobalKEGGModel

Internal to assembling the global KEGG reference model; the equivalent is inside build_reference_model, already mapped from getModelFromKEGG.

checkFileExistence

A generic file-existence check; Python's own pathlib/os.path cover this directly.

checkSolution

Checks whether a Mosek solution is feasible and optimal; Mosek is not a solver either toolbox supports through this site's documented setup.

cleanSheet

Internal to the old Excel-import pipeline (importExcelModel), which RAVEN 3 removed; raven-toolbox never had an Excel reader either.

constructS

Internal helper for building a stoichiometric matrix from equation strings; the equivalent is inside add_reactions_from_equations, already mapped from addRxns.

convertCharArray

MATLAB char-array/string-array normalisation; Python has one string type.

defaultCompartmentMap

raven-toolbox exposes the same table as a module-level constant, localization.DEFAULT_COMPARTMENT_MAP, not a function.

deprecationWarning

Emits RAVEN's own one-time deprecated-function notice; Python's warnings.warn covers this directly.

editMiriam

cobra's .annotation is already a {namespace: id} dictionary -- read and write it directly.

extractMiriam

cobra's .annotation is already a {namespace: id} dictionary -- read and write it directly.

findPotentialErrors

Detects grRules that are not in disjunctive normal form. cobrapy's own GPR class represents a parsed rule directly, so raven-toolbox has no equivalent "detect an invalid legacy string" step.

getINITModel

The original tINIT implementation. RAVEN keeps it for models already built with it; raven-toolbox, a new implementation with no such installed base, carries ftINIT alone.

getTransportRxns

Classifies which reactions move a metabolite between compartments. raven-toolbox has no equivalent classifier yet.

keggDataVersion

Internal to assembling the global KEGG reference model; the equivalent is inside build_reference_model, already mapped from getModelFromKEGG.

legacyMethodNotice

Emits RAVEN's own one-time legacy-method notice; Python's warnings.warn covers this directly.

parallelWorkersRAVEN

Returns a parfor worker count for the Parallel Computing Toolbox; raven-toolbox's parallelism is configured directly through cobra.Configuration().processes.

parseFormulas

Internal formula-to-elemental-composition parser; the equivalent is inside get_elemental_balance, not exposed separately.

parseRAVENargs

Resolves RAVEN's positional-or-named optional arguments; Python functions take native keyword arguments directly.

parseRxnEqu

Internal helper for extracting metabolite names from equation strings; the equivalent is inside add_reactions_from_equations, already mapped from addRxns.

parseYAML

A generic YAML parser for condition files; Python's standard YAML libraries (PyYAML) cover this directly, with no toolbox wrapper needed.

permuteModel

Reorders the parallel arrays of a RAVEN MATLAB struct; a cobra.Model has no comparable field-order concept to reorder.

printFluxes

No equivalent yet. Use cobra's model.summary(), or the solution's fluxes Series directly.

printOrange

Prints coloured text to the MATLAB Command Window; not applicable outside the MATLAB GUI.

ravenCobraWrapper

Not needed: a raven-toolbox model is a cobra.Model already, so there is nothing to convert.

ravenList

Formats a header and item list for a MATLAB warning()/error() call; Python's own string formatting covers this directly.

ravenModelFields

A registry of RAVEN's own MATLAB struct fields, used internally by permuteModel and removeReactions; a cobra.Model has no comparable struct-field concept.

readFasta

raven-toolbox has no public FASTA reader; the closest relative is write_fasta (already auto-matched from writeFasta), the read side stays internal to the functions that need it.

removeBadRxns

Iteratively removes reactions that let the model make or consume something from nothing. raven-toolbox has no equivalent yet; see find_leak_metabolite (mapped from makeSomething/consumeSomething) for finding the same kind of issue.

reverseRxns

Negates a reaction's stoichiometry and bounds to reverse its direction. Simple enough to do directly against a cobra.Reaction's own API; no dedicated function exists.

runDynamicFBA

Dynamic FBA is covered by maintained Python packages (dfba, reframed, mewpy).

runINIT

The original tINIT implementation. RAVEN keeps it for models already built with it; raven-toolbox, a new implementation with no such installed base, carries ftINIT alone.

runRAVENtests

Runs RAVEN's own MATLAB unit test suite. raven-toolbox's tests run through pytest, the standard Python testing workflow, not a toolbox function.

runRobustnessAnalysis

Robustness analysis for one reaction against an objective. raven-toolbox has no equivalent yet.

runSimpleOptKnock

A simple, brute-force OptKnock implementation. raven-toolbox has no equivalent; strain-design algorithms like OptKnock are explicitly out of scope for both toolboxes, see RAVEN 3 and raven-toolbox.

sampleChebyshevCenter

Internal rounding-step subroutine of RAVEN's own sampleCHRR; raven-toolbox's random_sampling (already mapped from sampleACHR/sampleCHRR) handles rounding and warmup internally without exposing separate functions.

sampleMaxVolEllipse

Internal rounding-step subroutine of RAVEN's own sampleCHRR; raven-toolbox's random_sampling (already mapped from sampleACHR/sampleCHRR) handles rounding and warmup internally without exposing separate functions.

sampleWarmupPoints

Internal warmup-point generator for RAVEN's own sampleACHR; raven-toolbox's random_sampling (already mapped from sampleACHR/sampleCHRR) handles warmup internally.

setRavenProgress

Sets a preference for how RAVEN reports progress in the MATLAB GUI or console; no equivalent concept in Python.

splitProbForConditioning

Improves LP numerical conditioning by splitting wide-ratio columns before solving; cobrapy and the solvers it wraps (through optlang) handle numerical scaling internally, with no equivalent public option.

standardizeModelFieldOrder

Orders the fields of a RAVEN MATLAB struct to a canonical layout; a cobra.Model has no comparable field-order concept.

writeExcel

Internal low-level .xlsx writer; the equivalent is inside export_to_excel, already mapped from exportToExcelFormat.