Import PyODAM modules
from PyODAM import Odam
import PyODAM_pca as pcapo
Get the data from ODAM
## API Call to retrieve data
po = Odam('https://pmb-bordeaux.fr','frim1')
d = po.getSubsetFromODAM('qNMR_metabo')
## Retrieve factors
d['factor']['Attribute']
# Matrix X
X = d['data'][d['numvars']] # .fillna(value=0)
# Choose 'DevStage' as Factor (index=1)
facname = d['factor'].Attribute[1]
Y = d['data'][facname]
# Factor levels
factorlevels = []
for f in Y:
if f not in factorlevels:
factorlevels.append(f)
factorlevels
Compute then plot PCA
# Compute PCA
res_pca = pcapo.PCA_compute(X, Y, n=3, scale=True)
# Factor level selection
FacLevSel = ['FF.01', 'FF.02', 'FF.04', 'FR.02', 'FR.04']
# To change, see with %matplotlib -l
%matplotlib inline
# Plot PCA Scores
pcapo.plotPCA(res_pca, 1, 3, FacLevSel)
# Explained Variance (%)
res_pca['EV']
0ct, 4 2019 - Daniel Jacob INRA UMR 1332 - MetaboHub Bordeaux
X