Metabolomics clustering for the MyConnectome study.

Code available at: https://github.com/poldrack/myconnectome/blob/master/myconnectome/metabolomics/Metabolomics_clustering.Rmd

## 
## APResult object
## 
## Number of samples     =  106 
## Number of iterations  =  199 
## Input preference      =  0.05755201 
## Sum of similarities   =  53.38495 
## Sum of preferences    =  0.8632801 
## Net similarity        =  54.24823 
## Number of clusters    =  15 
## 
## Exemplars:
##    shikimic_acid serine parabanic_acid_NIST ornithine oleic_acid 
##    methionine_sulfoxide mannose leucine heptadecanoic_acid erythritol 
##    creatinine benzoic_acid arachidic_acid acetoacetate 
##    3-hydroxybutyric_acid
## Clusters:
##    Cluster 1, exemplar shikimic_acid:
##       tocopherol_gamma- tocopherol_alpha- threitol shikimic_acid 
##       pyrophosphate malic_acid isothreonic_acid indole-3-acetate 
##       fumaric_acid cholesterol 2-ketoisocaproic_acid
##    Cluster 2, exemplar serine:
##       trans-4-hydroxyproline threonine serine oxoproline myo-inositol 
##       hexitol glycine citric_acid aminomalonate alanine
##    Cluster 3, exemplar parabanic_acid_NIST:
##       parabanic_acid_NIST oxalic_acid nicotinic_acid glycolic_acid 
##       alloxanoic_acid_NIST 2,4-diaminobutyric_acid 2,3-dihydroxypyridine
##    Cluster 4, exemplar ornithine:
##       sucrose ornithine lysine histidine
##    Cluster 5, exemplar oleic_acid:
##       palmitoleic_acid oleic_acid linoleic_acid capric_acid 
##       arachidonic_acid
##    Cluster 6, exemplar methionine_sulfoxide:
##       urea phosphate methionine_sulfoxide hexuronic_acid
##    Cluster 7, exemplar mannose:
##       tyrosine mannose lactic_acid glucose 1,5-anhydroglucitol
##    Cluster 8, exemplar leucine:
##       valine pseudo_uridine N-methylalanine N-acetylornithine methionine 
##       leucine isoleucine indole-3-lactate hippuric_acid glyceric_acid 
##       glutamic_acid 2-hydroxyvaleric_acid
##    Cluster 9, exemplar heptadecanoic_acid:
##       stearic_acid palmitic_acid myristic_acid isoheptadecanoic_acid_NIST 
##       heptadecanoic_acid beta-alanine
##    Cluster 10, exemplar erythritol:
##       phenylalanine lyxitol hexonic_acid glycerol ethanolamine erythritol 
##       butane-2,3-diol_NIST 2-deoxytetronic_acid_NIST 2-deoxyerythritol
##    Cluster 11, exemplar creatinine:
##       tryptophan taurine proline phenylethylamine glutamine creatinine 
##       asparagine
##    Cluster 12, exemplar benzoic_acid:
##       xylulose_NIST xylose uridine pelargonic_acid p-cresol 
##       N-acetylmannosamine methanolphosphate lauric_acid hydroxylamine 
##       hydroxycarbamate_NIST glycerol-alpha-phosphate dehydroabietic_acid 
##       benzoic_acid
##    Cluster 13, exemplar arachidic_acid:
##       behenic_acid arachidic_acid
##    Cluster 14, exemplar acetoacetate:
##       uric_acid threonic_acid_ succinic_acid fructose cystine acetoacetate
##    Cluster 15, exemplar 3-hydroxybutyric_acid:
##       N-acetylglycine_NIST isocitric_acid 3-hydroxybutyric_acid 
##       3-hydroxybutanoic_acid 2-hydroxybutanoic_acid

We save the clustering data and pubchem IDs for each cluster, for later use in annotation with Impala (set save_data=TRUE and change directory location to enable this)

## [1] 1
## [1] 2
## [1] 3
## [1] 4
## [1] 5
## [1] 6
## [1] 7
## [1] 8
## [1] 9
## [1] 10
## [1] 11
## [1] 12
## [1] 13
## [1] 14
## [1] 15
## [1] 1
## [1] 2
## [1] 3
## [1] 4
## [1] 5
## [1] 6
## [1] 7
## [1] 8
## [1] 9
## [1] 10
## [1] 11
## [1] 12
## [1] 13
## [1] 14
## [1] 15