Skip to content

Commit

Permalink
Merge pull request opencobra#1057 from opencobra/develop
Browse files Browse the repository at this point in the history
Regular merge of develop
  • Loading branch information
syarra authored Dec 11, 2017
2 parents 813a1b4 + ccbf875 commit 19c1726
Show file tree
Hide file tree
Showing 1,195 changed files with 482,450 additions and 74,889 deletions.
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ octave-workspace
# specific extensions
*.pyc
*.mps
diary.txt

# logfiles
*.log
Expand Down Expand Up @@ -112,6 +113,24 @@ tutorials/ecoliCoreModel/*.xls
tutorials/steadyCom/POA/*.mat
SubNetworkRecon.mat
Test4Functions_diary.txt
CobraMILPSolver.log
GlycolysisAndTCACorrected.xml
fbaFlux.xml
fbaFluxDirectionality.xml
mapATPADPColoured.xml
mapATPADPRxnsColoured.xml
mapColouredProteins.xml
mapGlyATPADPRxnsAllColoured.xml
mapGlyMetColoured.xml
mapGlyNotes.xml
mapGlyRxnColoured.xml
mapGlySubsystemsColoured.xml
mapGlyUnified.xml
mapMitocartaHumanGenes.xml
mapMitocartaTransportColoured.xml
mapNodesArea.xml
mapPPIUnified.xml


# generated tutorial documentation
docs/source/_static/tutorials/*.html
Expand Down
2 changes: 1 addition & 1 deletion deprecated/_maps_old/drawFluxVariability.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
for i=1:length(model.rxns)
if minFlux(i)*maxFlux(i)>=0
%unidirectional
if model.rev(i)
if model.lb(i) < 0
%reversible
if minFlux(i)<0 || maxFlux(i)<0
%reverse direction: Cyan 0 255 255
Expand Down
7 changes: 7 additions & 0 deletions docs/source/modules/metabolicCartography.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _metabolicCartography:

MetabolicCartography
--------------------

.. automodule:: src.visualization.metabolicCartography
:members:
1 change: 1 addition & 0 deletions docs/source/modules/visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Visualization

cellDesigner
maps
metabolicCartography

.. automodule:: src.visualization
:members:
107 changes: 107 additions & 0 deletions docs/source/notes/fullMATLABStructure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Output description of the function `transformFullXML2Map`

### Specifics

To be able to modify maps containg Protein-Protein Interactions (PPI)
created in CellDesigner from MATLAB, they have to be first parsed using the
function "transformFullXML2Map". Compared to a simple Metabolic map, PPI maps
contain Proteins and Complexes and must therefore be stored accordingly.
When manipulating Metabolic only maps, please refer to the
[`transformXML2Map` function's output description](simpleMATLABStructure.md).

### Content

This function will extract the relevant annotations from the XML file
and create a particular structure containg these annotations, that would
be later modified using various functions from the COBRA Toolbox.
Using this function, the MATLAB structure contains the following fields:

1. Molecules information (specific to each node in the map)
2. Complexes information (specific to each entity in the map)
3. Included Species information (specific to each entity in the map)
4. Species information (specific to each entity in the map)
5. Reactions information (with their corresponding modifications)
6. Compartment information (if existing in the map)
7. Matrices (specific for the map and comparable with the model)


| **Field name** | **Dimension** | **Data Type** | **Field description** |
|:---:|:---:|:---:|:---:|
| **Molecules information** |
| `map.molAlias` | `a x 1` | cell of char | Alias of each molecules (no duplicates) |
| `map.molID` | `a x 1` | cell of char | ID of each molecules (duplicates) |
| `map.molCompartAlias` | `a x 1` | cell of char | Corresponding compartment alias of each molecules (EMPTY if no info) |
| `map.molXPos` | `a x 1` | cell of char or double | X position of each molecules (stored as string but can be changed to double) |
| `map.molYPos` | `a x 1` | cell of char or double | Y position of each molecules (stored as string but can be changed to double) |
| `map.molWidth` | `a x 1` | cell of char or double | Width of each molecules (stored as string but can be changed to double) |
| `map.molHeight` | `a x 1` | cell of char or double | Height of each molecules (stored as string but can be changed to double) |
| `map.molColor` | `a x 1` | cell of char | Color of each molecules (in "HTML" code with lowercases and "ff" instead of "#' at the beginning) |
| **Complexes information** |
| `map.complexAlias` | `c x 1` | cell of char | Alias of each complex (no duplicates) |
| `map.complexID` | `c x 1` | cell of char | ID of each complex (duplicates) |
| `map.complexCompartAlias` | `c x 1` | cell of char | Corresponding compartment alias of each complex (EMPTY if no info) |
| `map.complexXPos` | `c x 1` | cell of char or double | X position of each complex (stored as string but can be changed to double) |
| `map.complexYPos` | `c x 1` | cell of char or double | Y position of each complex (stored as string but can be changed to double) |
| `map.complexWidth` | `c x 1` | cell of char or double | Width of each complex (stored as string but can be changed to double) |
| `map.complexHeight` | `c x 1` | cell of char or double | Height of each complex (stored as string but can be changed to double) |
| `map.complexColor` | `c x 1` | cell of char | Color of each complex (in "HTML" code with lowercases and "ff" instead of "#' at the beginning) |
| **Included Species information** |
| `map.specIncID` | `i x 1` | cell of char | ID of each included species (no duplicates) |
| `map.specIncProtID` | `i x 1` | cell of char | Protein ID reference of each included species |
| `map.specIncCplxID` | `i x 1` | cell of char | Complex ID reference of each included species |
| `map.specIncName` | `i x 1` | cell of char | Name of each included species |
| `map.specIncType` | `i x 1` | cell of char | Type of each species (SIMPLE_MOLECULE/ION/PROTEIN...) |
| `map.specIncNotes` | `i x 1` | cell of char | Notes of each included species (EMPTY if no info) |
| **Species information** |
| `map.specID` | `s x 1` | cell of char | ID of each species (no duplicates) |
| `map.specMetaID` | `s x 1` | cell of char | MetaID of each species often related to ID (no ducplicates) |
| `map.specName` | `s x 1` | cell of char | Name of each species |
| `map.specType` | `s x 1` | cell of char | Type of each species (SIMPLE_MOLECULE/ION/PROTEIN...) |
| `map.specNotes` | `s x 1` | cell of char | Notes of each species (EMPTY if no info) |
| **Reactions information** |
| `map.rxnID` | `r x 1` | cell of char | ID of each reactions (no duplicates) |
| `map.rxnMetaID` | `r x 1` | cell of char | MetaID of each reactions |
| `map.rxnName` | `r x 1` | cell of char | Name of each reactions |
| `map.rxnType` | `r x 1` | cell of char | Type of each reactions |
| `map.rxnReversibility` | `r x 1` | cell of char | Reversibility of each reactions (false or true) |
| `map.rxnBaseReactantAlias` | `r x p x 1` | cell of cell of char | Alias of the base reactant(s) |
| `map.rxnBaseReactantID` | `r x p x 1` | cell of cell of char | ID of the base reactant(s) |
| `map.rxnBaseProductAlias` | `r x p x 1` | cell of cell of char | Alias of the base product(s) |
| `map.rxnBaseProductID` | `r x p x 1` | cell of cell of char | ID of the base product(s) |
| `map.rxnReactantAlias` | `r x p x 1` | cell of cell of char | Alias of reactant(s) (EMPTY if not present) |
| `map.rxnReactantID` | `r x p x 1` | cell of cell of char | ID of reactant(s) (EMPTY if not present) |
| `map.rxnReactantLineType` | `r x p x 1` | cell of cell of char | Type of the reactant's reaction line ('Curve' or 'Straight') |
| `map.rxnReactantLineColor` | `r x p x 1` | cell of cell of char | Color of the reactant's reaction line (in "HTML" code with lowercases and "ff" instead of "#' at the beginning) |
| `map.rxnReactantLineWidth` | `r x p x 1` | cell of cell of char or double | Width of the reactant's reaction line |
| `map.rxnProductAlias` | `r x p x 1` | cell of cell of char | Alias of product(s) (EMPTY if not present) |
| `map.rxnProductID` | `r x p x 1` | cell of cell of char | ID of product(s) (EMPTY if not present) |
| `map.rxnProductLineType` | `r x p x 1` | cell of cell of char | Type of the product's reaction line ('Curve' or 'Straight') |
| `map.rxnProductLineColor` | `r x p x 1` | cell of cell of char | Color of the product's reaction line (in "HTML" code with lowercases and "ff" instead of "#' at the beginning) |
| `map.rxnProductLineWidth` | `r x p x 1` | cell of cell of char or double | Width of the product's reaction line |
| `map.rxnModAlias` | `r x p x 1` | cell of cell of char | Alias of modifiers metabolites of each reactions |
| `map.rxnModID` | `r x p x 1` | cell of cell of char | ID of modifiers metabolites of each reactions |
| `map.rxnModType` | `r x p x 1` | cell of cell of char | Type of the modification by the metabolite of each reactions |
| `map.rxnModColor` | `r x p x 1` | cell of cell of char | Color of the modification line of each reactions |
| `map.rxnModWidth` | `r x p x 1` | cell of cell of char or double | Width of the modification line of each reactions |
| `map.rxnColor` | `r x 1` | cell of char | Color of the main reaction (in "HTML" code with lowercases and "ff" instead of "#' at the beginning) => later modified for the whole reaction's members |
| `map.rxnWidth` | `r x 1` | cell of char | Width of the main reaction (stored as string but can be changed to double) => later modified for the whole reaction's members |
| `map.rxnNotes` | `r x 1` | cell of char | Notes of each reactions (EMPTY if no info) |
| **Compartment information** |
| `map.compartAlias` | `c x 1` | cell of char | Alias of each compartments (EMPTY if no info) |
| `map.compartName` | `c x 1` | cell of char | Name of each compartments (EMPTY if no info) |
| **Matrices** |
| `map.sID` | `s x r` | logical | Logical matrix with rows = speciesID and columns = reactionsID |
| `map.sAlias` | `m x r` | logical | Logical matrix with rows = speciesAlias and columns = reactionsID |
| `map.idAlias` | `s x m` | logical | Logical matrix widh rows = speciesID and columns = speciesAlias |


### Note:

The dimension `p` is variable between reactions as each reaction can contain one
or more Base Reactants or Products and the same is possible for Reactants,
Products and Modifiers. Therefore, this value is not static and varies in all
reactions.

Please note also that logical matrices are disabled for the moment for PPI maps.
To be structured as the model and to be comparable, the access to entities has
to be adapted for such maps as the models do not contain Proteins at the moment.
83 changes: 83 additions & 0 deletions docs/source/notes/simpleMATLABStructure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Output description of the function `transformXML2Map`

### Specifics

To be able to modify metabolic maps created in CellDesigner from MATLAB,
they have to be first parsed using the function "transformXML2Map".
A metabolic map contains only Simple molecules, such as Ions, Metabolites...
When manipulating maps with Protein-Protein Interactions, please refer to the
[`transformXML2Map` function's output description](fullMATLABStructure.md).

### Content

This function will extract the relevant annotations from the XML file
and create a particular structure containg these annotations, that would
be later modified using various functions from the COBRA Toolbox.
Using this function, the MATLAB structure contains the following fields:

1. Molecules information (specific to each node in the map)
2. Species information (specific to each entity in the map)
3. Reactions information (with their corresponding modifications)
4. Compartment information (if existing in the map)
5. Matrices (specific for the map and comparable with the model)


| **Field name** | **Dimension** | **Data Type** | **Field description** |
|:---:|:---:|:---:|:---:|
| **Molecules information** |
| `map.molAlias` | `a x 1` | cell of char | Alias of each molecules (no duplicates) |
| `map.molID` | `a x 1` | cell of char | ID of each molecules (duplicates) |
| `map.molCompartAlias` | `a x 1` | cell of char | Corresponding compartment alias of each molecules (EMPTY if no info) |
| `map.molXPos` | `a x 1` | cell of char or double | X position of each molecules (stored as string but can be changed to double) |
| `map.molYPos` | `a x 1` | cell of char or double | Y position of each molecules (stored as string but can be changed to double) |
| `map.molWidth` | `a x 1` | cell of char or double | Width of each molecules (stored as string but can be changed to double) |
| `map.molHeight` | `a x 1` | cell of char or double | Height of each molecules (stored as string but can be changed to double) |
| `map.molColor` | `a x 1` | cell of char | Color of each molecules (in "HTML" code with lowercases and "ff" instead of "#' at the beginning) |
| **Species information** |
| `map.specID` | `s x 1` | cell of char | ID of each species (no duplicates) |
| `map.specMetaID` | `s x 1` | cell of char | MetaID of each species often related to ID (no ducplicates) |
| `map.specName` | `s x 1` | cell of char | Name of each species |
| `map.specType` | `s x 1` | cell of char | Type of each species (SIMPLE_MOLECULE/ION/PROTEIN...) |
| `map.specNotes` | `s x 1` | cell of char | Notes of each species (EMPTY if no info) |
| **Reactions information** |
| `map.rxnID` | `r x 1` | cell of char | ID of each reactions (no duplicates) |
| `map.rxnMetaID` | `r x 1` | cell of char | MetaID of each reactions |
| `map.rxnName` | `r x 1` | cell of char | Name of each reactions |
| `map.rxnType` | `r x 1` | cell of char | Type of each reactions |
| `map.rxnReversibility` | `r x 1` | cell of char | Reversibility of each reactions (false or true) |
| `map.rxnBaseReactantAlias` | `r x p x 1` | cell of cell of char | Alias of the base reactant(s) |
| `map.rxnBaseReactantID` | `r x p x 1` | cell of cell of char | ID of the base reactant(s) |
| `map.rxnBaseProductAlias` | `r x p x 1` | cell of cell of char | Alias of the base product(s) |
| `map.rxnBaseProductID` | `r x p x 1` | cell of cell of char | ID of the base product(s) |
| `map.rxnReactantAlias` | `r x p x 1` | cell of cell of char | Alias of reactant(s) (EMPTY if not present) |
| `map.rxnReactantID` | `r x p x 1` | cell of cell of char | ID of reactant(s) (EMPTY if not present) |
| `map.rxnReactantLineType` | `r x p x 1` | cell of cell of char | Type of the reactant's reaction line ('Curve' or 'Straight') |
| `map.rxnReactantLineColor` | `r x p x 1` | cell of cell of char | Color of the reactant's reaction line (in "HTML" code with lowercases and "ff" instead of "#' at the beginning) |
| `map.rxnReactantLineWidth` | `r x p x 1` | cell of cell of char or double | Width of the reactant's reaction line |
| `map.rxnProductAlias` | `r x p x 1` | cell of cell of char | Alias of product(s) (EMPTY if not present) |
| `map.rxnProductID` | `r x p x 1` | cell of cell of char | ID of product(s) (EMPTY if not present) |
| `map.rxnProductLineType` | `r x p x 1` | cell of cell of char | Type of the product's reaction line ('Curve' or 'Straight') |
| `map.rxnProductLineColor` | `r x p x 1` | cell of cell of char | Color of the product's reaction line (in "HTML" code with lowercases and "ff" instead of "#' at the beginning) |
| `map.rxnProductLineWidth` | `r x p x 1` | cell of cell of char or double | Width of the product's reaction line |
| `map.rxnModAlias` | `r x p x 1` | cell of cell of char | Alias of modifiers metabolites of each reactions |
| `map.rxnModID` | `r x p x 1` | cell of cell of char | ID of modifiers metabolites of each reactions |
| `map.rxnModType` | `r x p x 1` | cell of cell of char | Type of the modification by the metabolite of each reactions |
| `map.rxnModColor` | `r x p x 1` | cell of cell of char | Color of the modification line of each reactions |
| `map.rxnModWidth` | `r x p x 1` | cell of cell of char or double | Width of the modification line of each reactions |
| `map.rxnColor` | `r x 1` | cell of char | Color of the main reaction (in "HTML" code with lowercases and "ff" instead of "#' at the beginning) => later modified for the whole reaction's members |
| `map.rxnWidth` | `r x 1` | cell of char | Width of the main reaction (stored as string but can be changed to double) => later modified for the whole reaction's members |
| `map.rxnNotes` | `r x 1` | cell of char | Notes of each reactions (EMPTY if no info) |
| **Compartment information** |
| `map.compartAlias` | `c x 1` | cell of char | Alias of each compartments (EMPTY if no info) |
| `map.compartName` | `c x 1` | cell of char | Name of each compartments (EMPTY if no info) |
| **Matrices** |
| `map.sID` | `s x r` | logical | Logical matrix with rows = speciesID and columns = reactionsID |
| `map.sAlias` | `m x r` | logical | Logical matrix with rows = speciesAlias and columns = reactionsID |
| `map.idAlias` | `s x m` | logical | Logical matrix widh rows = speciesID and columns = speciesAlias |

*** Note:

The dimension `p` is variable between reactions as each reaction can contain one
or more Base Reactants or Products and the same is possible for Reactants,
Products and Modifiers. Therefore, this value is not static and varies in all
reactions.
7 changes: 5 additions & 2 deletions external/sparseNull.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function N = sparseNull(S, tol)
function [N,rankS] = sparseNull(S, tol)
% sparseNull returns computes the sparse Null basis of a matrix
%
% N = sparseNull(S, tol)
% [N,rankS] = sparseNull(S, tol)
%
% Computes a basis of the null space for a sparse matrix. For sparse
% matrixes this is much faster than using null. It does however have lower
Expand All @@ -11,11 +11,14 @@
% Jan Schellenberger 10/20/2009
% based on this:
% http://www.mathworks.com/matlabcentral/fileexchange/11120-null-space-of-a-sparse-matrix
% Modified Tomas Pfau -> The size of the U is exactly the rank of the
% matrix (up to the tolerance).
if nargin <2
tol = 1e-9;
end
[SpLeft, SpRight] = spspaces(S,2, tol);
N = SpRight{1}(:,SpRight{3});
rankS = numel(SpRight{2});
N(abs(N) < tol) = 0;


Expand Down
Loading

0 comments on commit 19c1726

Please sign in to comment.