Notes on Singular Value Decomposition (SVD):
Eigenvectors and eigenvalues:
An eigenvector of a matrix is A is a non-zero vector that satisfies the equation
Where λ is a scalar. λ is called an eigenvalue.
Any mxn matrix A can be factored as:
- U is an mXm orthogonal matrix where the columns are the eigenvectors of AAT
- V is an nXn orthogonal matrix where the columns are the eigenvectors of ATA
- is an mXn diagonal matrix where the r first diagona elements are the square roots of the eigenvalues of ATA, also called the singular values of A. Singular values are always real and positive.
For any SVD, the following facts apply:
- The rank of a matrix A equals the number of singular values of A.
- The column space of A is spanned by the first r columns of U.
- The null space of A is spanned by the last n − r columns of V.
- The row space of A is spanned by the first r columns of V.
- The null space of AT is spanned by the last m − r columns of U.
The columns of U are called the left singular vectors, and the columns of V theright singular vectors.
SVD in NumPy
To find the rank of a matrix A, assign u,s,vh = linalg.svd(A) and r = len(s)
Applications to metabolic networks
Given a metabolic network with stoichoimetric matrix S, the change in metabolite concentrations x as function of the reaction rates v is given by the equation:
The singular value decomposition of S is
Which can be written as:
The above expression defines a series of independent equations on the form
Svk = σkuk
Where vk are the column vectors of V (the right singular vectors), σk are the singular valus and uk are the column vectors of U (the left singular vectors).
Applying the SVD to S, we get:
The columns of U, called the left singular vectors and denoted Ui form linear combinations of the concentations variables. Similarly, columns of V, called the right singular vectors' and denoted Vi form linear combinations of the fluxes. Linear combinations of concentration variablesare called pools while linear combinations of fluxes are called pathways.
For each nonzero singular value σk there is a corresponding column uk in U and a row whose relationship is described by the equation
where the linar combination of metabolite concentrations
is being driven by the linear combination of metabolic fluxes
Each column uk of U thus defines an eigen-reaction or systemic metabolic reaction which can be expressed as
The elements of uk are called systemeic stoichiometric coefficients and the elements of vk are called systemeic participation numbers.
Attention: The right singular vectors vk should not be confused with the flux vector v.
Finding the null space of a matrix
Finding null space of matrix: http://www.math.odu.edu/~bogacki/cgi-bin/lat.cgi
A rational basis for the nullspace of a matrix with rational elements can be found using SymPy.
A SVD of N is
If N is a stoichiometric matrix, we find for the first eigenreaction:
A larger example is given below, using the stoichiometric matrix of the example metabolic network from Navid & Almaas 2012:
Simple SVD calculator: http://metamerist.com/excanvas/example23a.htm
Palsson, 2006. Systems Biology: Properties of reconstructed networks. Cambridge.
Famili & Palsson. Journal of theoretical biology 224 (2003) 87-96.