Skip to content

Latest commit

 

History

History

met4j-core

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

met4j-core

Met4j module for basic manipulation of metabolic networks

Installation

cd met4j-core;
mvn clean install;

Using met4j-core in a maven project

Put this in the pom.xml file of your project:

<dependencies>
...
 <dependency>
  <groupId>fr.inrae.toulouse.metexplore</groupId>
   <artifactId>met4j-core</artifactId>
    <version>0.12.0</version>
 </dependency>
...
</dependencies>

Change the version number if needed.

Documentation

Examples can be found here : https://forgemia.inra.fr/metexplore/tutorialmet4j/blob/master/src/main/java/fr/inrae/toulouse/metexplore/tutorialmet4j/met4j_core

The BioEntity class

All the classes describing biological entities inherit from the BioEntity class. Each BioEntity has these fields:

  • id (String). The main field of a BioEntity is its id. This id is final, i.e. it can not be changed after the creation of the BioEntity. This ensures the consistency of the maps containing BioEntity, especially BioCollection instances. If during the construction of a BioEntity, the id is null or empty, a unique random id will be set. The id must not contain spaces.
  • name (String)
  • synonyms (Array of String)
  • comment (String)
  • A map of references (BioRef)
  • A map of attributes (Object)

The BioCollection class

The collections of biological entities are handled by the BioCollection class. The most important rule of a BioCollection is that we can not add an entity if an entity with the same id already exists in the BioCollection.

The BioNetwork class

The BioNetwork class is the essential class of met4j.

It contains and links all the entities composing a metabolic network (metabolites, reactions, pathways, genes, proteins, enzymes, compartments).

BioNetwork content BioNetwork content

All the links between biological entities are handled by methods in the BioNetwork class.

Creation of a BioNetwork

From scratch:

BioNetwork network = new BioNetwork("myBioNetwork");

Read the met4j-io documentation to see how create a BioNetwork from SBML, TSV or KEGG.

The BioMetabolite class

The BioMetabolite class has these additional fields:

Creation of a BioMetabolite
BioMetabolite m = new BioMetabolite("m", "myMetabolite");
Add a BioMetabolite in a BioNetwork
network.add(m);
Remove a BioMetabolite from a BioNetwork
network.removeOnCascade(m);

Removing a metabolite causes the removal of other entities linked to it in the network.

Cascade of removals after removing a BioMetabolite from a BioNetwork Cascade of removals after removing a BioMetabolite from a BioNetwork

Get the list of BioMetabolite
BioCollection<BioMetabolite> metabolites = network.getMetabolitesView();

The returned BioCollection is in fact a copy of the list of BioMetabolite present in the BioNetwork so that operations on this BioCollection does not affect the BioNetwork itself.

The BioCompartment class

A BioCompartment contains a BioCollection of BioEntity (most often BioMetabolite). This list is private, the only way to add BioEntity in a BioCompartment is to use BioNetwork methods.

Creation of a BioCompartment
BioCompartment c = new BioCompartment("c", "cytosol");
Add a BioCompartment in a BioNetwork

Only empty compartments can be added to a BioNetwork.

network.add(c);
Add a BioMetabolite in a BioCompartment
network.affectToCompartment(c, m);
Add several BioMetabolite in a BioCompartment
network.affectToCompartment(c, m1, m2, m3);

or

BioCollection<BioMetabolite> metabolites = new BioCollection<>;
metabolites.add(m1, m2, m3);
network.affectToCompartment(c, metabolites);
Remove a BioCompartment from a BioNetwork
network.removeOnCascade(c);

Removing a BioCompartment causes the removal of other entities linked to it in the network.

Cascade of removals after removing a BioCompartment from a BioNetwork

Cascade of removals after removing a BioCompartment from a BioNetwork

Get the list of BioCompartment
BioCollection<BioCompartment> compartments = network.getCompartmentsView();

The returned BioCollection is in fact a copy of the list of BioCompartment present in the BioNetwork so that operations on this BioCollection does not affect the BioNetwork itself.

The BioReaction class

The BioReaction has these additional parameters:

  • spontaneous (Boolean)
  • ecNumber (String) :Enzyme Commission Number
  • reversible (Boolean)
  • left : a BioCollection of BioReactant
  • right : a BioCollection of BioReactant
  • enzymes : a BioCollection of BioEnzyme
Create a BioReaction
BioReaction r = new BioReaction("r", "myReaction");
Add a BioReaction in a BioNetwork

Only reactions without left nor right reactants nor enzymes can be added to a BioNetwork.

network.add(r);
Add a reactant in a BioReaction

A reactant is a triplet BioMetabolite-stoichiometry-BioCompartment. The BioCompartment and the BioMetabolite must be present in the BioNetwork and the BioMetabolite must be present in the BioCompartment.

network.affectLeft(r, 1.0, c, m1);
network.affectRight(r, 2.0, c, m2);
Add several reactants in a BioReaction

It's possible to add several reactants in a BioReaction if they are in the same compartment and they have the same stroichiometry.

network.affectLeft(r, 1.0, c, m1, m2, m3);
Remove a BioReaction from a BioNetwork
network.removeOnCascade(r);

Removing a BioReaction causes the removal of other entities linked to it in the network.

Cascade of removals after removing a BioReaction from a BioNetwork

Cascade of removals after removing a BioReaction from a BioNetwork

Get the list of BioReaction
BioCollection<BioReaction> reactions = network.getReactionsView();

The returned BioCollection is in fact a copy of the list of BioReaction present in the BioNetwork so that operations on this BioCollection does not affect the BioNetwork itself.

The BioGene class

Create a BioGene
BioGene g = new BioGene("g");
Add a BioGene in a BioNetwork
network.add(g);
Remove a BioGene from a BioNetwork
network.removeOnCascade(g);

Removing a BioGene causes the removal of other entities linked to it in the network.

Cascade of removals after removing a BioGene from a BioNetwork

Cascade of removals after removing a BioGene from a BioNetwork

Get the list of BioGene
BioCollection<BioGene> genes = network.getGenesView();

The returned BioCollection is in fact a copy of the list of BioGene present in the BioNetwork so that operations on this BioCollection does not affect the BioNetwork itself.

The BioProtein class

A BioProtein has only one additional parameter: a BioGene. Indeed, in met4j, a BioProtein corresponds to only one BioGene but a BioGene can code for different BioProtein (e.g. splicing event).

Create a BioProtein
BioProtein p = new BioProtein("p", "myProtein");
Add a BioProtein in a BioNetwork

The protein must not be linked to a BioGene to be added to a BioNetwork.

network.add(p);
Affect a BioGene to a BioProtein

Both BioProtein and BioGene must be present in the BioNetwork.

network.affectGeneProduct(p, g);
Remove a BioProtein from a BioNetwork
network.removeOnCascade(p);

Removing a BioProtein causes the removal of other entities linked to it in the network.

Cascade of removals after removing a BioProtein from a BioNetwork

Cascade of removals after removing a BioProtein from a BioNetwork

Get the list of BioProtein
BioCollection<BioProtein> proteins = network.getProteinsView();

The returned BioCollection is in fact a copy of the list of BioProtein present in the BioNetwork so that operations on this BioCollection does not affect the BioNetwork itself.

The BioEnzyme class

A BioEnzyme can be composed by several BioEnzymeParticipant which are a pair of a BioProtein (or a BioMetabolite) and a stroichiometry.

Create a BioEnzyme
BioEnzyme e = new BioEnzyme("e", "myEnzyme");
Add a BioEnzyme to a BioNetwork

The BioEnzyme must not contain BioEnzymeParticipant.

network.add(e);
Add a BioProtein (or a BioMetabolite) to a BioNetwork

Both BioEnzyme and BioProtein must be present in the BioNetwork.

network.affectSubUnit(e, 1.0, p);
Add several BioProtein (or BioMetabolite) to a BioNetwork
network.affectSubUnit(e, 1.0, p, m);
Affect an enzyme to a reaction

Both BioEnzyme and BioReaction must be present in the BioNetwork.

network.affectEnzyme(r, e);
Affect several enzymes to a reaction
network.affectEnzyme(r, e1, e2);

or

BioCollection<BioEnzyme> enzymes = new BioCollection<>();
enzymes.add(e1, e2)
network.affectEnzyme(r, enzymes);
Get the list of BioEnzyme
BioCollection<BioEnzyme> enzymes = network.getEnzymesView();

The returned BioCollection is in fact a copy of the list of BioEnzyme present in the BioNetwork so that operations on this BioCollection does not affect the BioNetwork itself.

Remove a BioEnzyme from a BioNetwork
network.removeOnCascade(e);

Removing a BioEnzyme causes the removal of other entities linked to it in the network.

Cascade of removals after removing a BioEnzyme from a BioNetwork

Cascade of removals after removing a BioEnzyme from a BioNetwork

The BioPathway class

A BioPathway contains several BioReaction.

Creation of a BioPathway
BioPathway p = new BioPathway("p", "myProtein");
Add a BioReaction in a BioPathway
network.affectToPathway(p, r);
Add several BioReaction in a BioPathway
network.affectToPathway(p, r1, r2, r3);

or

BioCollection<BioReaction> reactions = new BioCollection<>();
network.affectToPathway(p, reactions);
Remove a BioPathway from a BioNetwork
network.removeOnCascade(p);
Get the list of BioPathway
BioCollection<BioPathway> pathways = network.getPathwaysView();

The returned BioCollection is in fact a copy of the list of BioPathway present in the BioNetwork so that operations on this BioCollection does not affect the BioNetwork itself.