Skip to content

Commit

Permalink
added doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristian Peters committed Feb 1, 2024
1 parent 0ad5348 commit 73cf1ad
Show file tree
Hide file tree
Showing 10 changed files with 2,867 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
.Rhistory
.RData
.Ruserdata
/doc/
/Meta/
269 changes: 269 additions & 0 deletions doc/data_integration.R

Large diffs are not rendered by default.

435 changes: 435 additions & 0 deletions doc/data_integration.Rmd

Large diffs are not rendered by default.

687 changes: 687 additions & 0 deletions doc/data_integration.html

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions doc/marchantiales.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## ----include=FALSE------------------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)

## -----------------------------------------------------------------------------
#devtools::install_github("https://github.com/ipb-halle/iESTIMATE")
library(iESTIMATE)

## ----message=FALSE, fig.width=8, fig.height=6, out.width=800, out.height=600----
suppressWarnings(
sel_pls <- select_features_pls(feat_matrix=marchantiales$comp_list, sel_factor=as.factor(marchantiales$metadata$species), sel_colors=marchantiales$metadata$color, components=(nlevels(as.factor(marchantiales$metadata$species))-1))
)
heatmap.selected_features(feat_list=marchantiales$comp_list, sel_feat=sel_pls$`_selected_variables_`, sample_colors=marchantiales$colors, plot_width=10, plot_height=10, filename=NULL, main="PLS")

## ----fig.width=16, fig.height=16, out.width=800, out.height=800---------------
sunBurstPlotFromSubstanceClasses(rownames(marchantiales$div_classes), marchantiales$div_classes$frequency, colorStart=0.0, colorAlpha=0.6)

## ----eval=FALSE---------------------------------------------------------------
# f.export_maf(cbind(ms1_def_neg, t(feat_list_neg)), "data/metabolites_maf_neg.tsv")
# f.annotate_maf_classes(maf_input="data/metabolites_maf_neg.tsv", maf_output="data/metabolites_maf_neg_classes.tsv")
# f.annotate_maf_compounds(maf_input="data/metabolites_maf_neg_classes.tsv", maf_output="data/m_MTBLS2239_LC-MS_negative_reverse-phase_metabolite_profiling_v2_maf.tsv", polarity="neg", xcms_id=rownames(ms1_def_neg), pol_mode=rep("neg",nrow(ms1_def_neg)), smiles=ms1_def_neg$smiles, names=ms1_def_neg$name)

## ----eval=FALSE---------------------------------------------------------------
# f.export_maf(cbind(ms1_def_pos, t(feat_list_pos)), "data/metabolites_maf_pos.tsv")
# f.annotate_maf_classes(maf_input="data/metabolites_maf_pos.tsv", maf_output="data/metabolites_maf_pos_classes.tsv")
# f.annotate_maf_compounds(maf_input="data/metabolites_maf_pos_classes.tsv", maf_output="data/m_MTBLS2239_LC-MS_positive_reverse-phase_metabolite_profiling_v2_maf.tsv", polarity="pos", xcms_id=rownames(ms1_def_pos), pol_mode=rep("pos",nrow(ms1_def_pos)), smiles=ms1_def_pos$smiles, names=ms1_def_pos$name)

59 changes: 59 additions & 0 deletions doc/marchantiales.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: "Marchantiales"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Marchantiales}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

# Setup

Installing and loading our package

```{r}
#devtools::install_github("https://github.com/ipb-halle/iESTIMATE")
library(iESTIMATE)
```

# Examplary analyses

## PLS-DA

```{r, message=FALSE, fig.width=8, fig.height=6, out.width=800, out.height=600}
suppressWarnings(
sel_pls <- select_features_pls(feat_matrix=marchantiales$comp_list, sel_factor=as.factor(marchantiales$metadata$species), sel_colors=marchantiales$metadata$color, components=(nlevels(as.factor(marchantiales$metadata$species))-1))
)
heatmap.selected_features(feat_list=marchantiales$comp_list, sel_feat=sel_pls$`_selected_variables_`, sample_colors=marchantiales$colors, plot_width=10, plot_height=10, filename=NULL, main="PLS")
```

## Sunburst plot

```{r, fig.width=16, fig.height=16, out.width=800, out.height=800}
sunBurstPlotFromSubstanceClasses(rownames(marchantiales$div_classes), marchantiales$div_classes$frequency, colorStart=0.0, colorAlpha=0.6)
```

# Export peak tables for MetaboLights

Annotate peak tables in negative ion mode.

```{r, eval=FALSE}
f.export_maf(cbind(ms1_def_neg, t(feat_list_neg)), "data/metabolites_maf_neg.tsv")
f.annotate_maf_classes(maf_input="data/metabolites_maf_neg.tsv", maf_output="data/metabolites_maf_neg_classes.tsv")
f.annotate_maf_compounds(maf_input="data/metabolites_maf_neg_classes.tsv", maf_output="data/m_MTBLS2239_LC-MS_negative_reverse-phase_metabolite_profiling_v2_maf.tsv", polarity="neg", xcms_id=rownames(ms1_def_neg), pol_mode=rep("neg",nrow(ms1_def_neg)), smiles=ms1_def_neg$smiles, names=ms1_def_neg$name)
```

Annotate peak tables in positive ion mode.

```{r, eval=FALSE}
f.export_maf(cbind(ms1_def_pos, t(feat_list_pos)), "data/metabolites_maf_pos.tsv")
f.annotate_maf_classes(maf_input="data/metabolites_maf_pos.tsv", maf_output="data/metabolites_maf_pos_classes.tsv")
f.annotate_maf_compounds(maf_input="data/metabolites_maf_pos_classes.tsv", maf_output="data/m_MTBLS2239_LC-MS_positive_reverse-phase_metabolite_profiling_v2_maf.tsv", polarity="pos", xcms_id=rownames(ms1_def_pos), pol_mode=rep("pos",nrow(ms1_def_pos)), smiles=ms1_def_pos$smiles, names=ms1_def_pos$name)
```
Loading

0 comments on commit 73cf1ad

Please sign in to comment.