Skip to content

Commit

Permalink
Build fix: remove R packages not utilized, remove unnecessary files i…
Browse files Browse the repository at this point in the history
…n Docker build (#571)
  • Loading branch information
TuomasBorman authored Jul 21, 2024
1 parent 4e80d2f commit 988a78c
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 70 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/biocbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
packages: write

steps:

- name: 🧾 Checkout repository
uses: actions/checkout@v3

Expand All @@ -26,12 +25,20 @@ jobs:
run: |
docker system prune --all --force --volumes
- name: 🧹 Additional disk space cleanup
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/lib/android/sdk
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
- name: 🐳 Set up QEMU
uses: docker/setup-qemu-action@v2

- name: 🐳 Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: 📦 Cache Docker layers
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -81,7 +88,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
build-args: |
BIOC_VERSION=${{ github.ref_name }}
- name: 🚀 Push local Docker image to ghcr.io
uses: docker/build-push-action@v4
with:
Expand All @@ -93,7 +100,7 @@ jobs:
build-args: |
BIOC_VERSION=${{ github.ref_name }}
- name: 📚 Recover pkg artifacts generated during build in local Docker container (pkg bundle and book)
- name: 📚 Recover pkg artifacts generated during build in local Docker container (pkg bundle and book)
env:
IMG: ${{ steps.docker.outputs.ImageID }}
run: |
Expand All @@ -110,10 +117,10 @@ jobs:
- name: 🚀 Deploy book to Github Pages on versioned branch
uses: JamesIves/[email protected]
with:
folder: ${{ env.book_path }}/
target-folder: docs/${{ env.target_folder }}/
folder: ${{ env.book_path }}/
target-folder: docs/${{ env.target_folder }}/
branch: gh-pages
clean: false
clean: false

- name: 💾 Upload package bundle artifact
uses: actions/upload-artifact@v3
Expand All @@ -125,4 +132,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: book
path: ${{ env.book_path }}
path: ${{ env.book_path }}
69 changes: 31 additions & 38 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,73 +28,71 @@ Depends:
R (>= 4.0.0)
Imports:
Suggests:
ALDEx2,
ANCOMBC,
ape,
biclust,
ALDEx2,
ANCOMBC,
ape,
biclust,
BiocBook,
BiocManager,
BiocParallel,
Biostrings,
bluster,
Biostrings,
bluster,
caret,
circlize,
circlize,
cluster,
cobiclust,
ComplexHeatmap,
cobiclust,
ComplexHeatmap,
corpcor,
cowplot,
curatedMetagenomicData,
curatedMetagenomicData,
dada2,
dendextend,
dendextend,
devtools,
DirichletMultinomial,
dplyr,
dplyr,
DT,
factoextra,
forcats,
fido,
ggplot2,
ggplot2,
ggpubr,
ggtree,
glmnet,
glue,
glmnet,
glue,
grid,
gsEasy,
gtools,
GUniFrac,
igraph,
kableExtra,
knitr,
igraph,
kableExtra,
knitr,
Maaslin2,
mia,
miaTime,
miaViz,
microbiome,
miaViz,
microbiome,
microbiomeDataSets,
MicrobiomeStat,
mikropml,
MLeval,
mikropml,
MMUPHin,
MOFA2,
multiview,
NetCoMi,
NbClust,
NMF,
patchwork,
pheatmap,
phyloseq,
plotly,
purrr,
randomcoloR,
phyloseq,
plotly,
purrr,
qgraph,
RColorBrewer,
rebook,
reshape2,
reticulate,
rgl,
ROCR,
ROCR,
scales,
scater,
sechm,
scater,
sechm,
sessioninfo,
shadowtext,
SpiecEasi,
SPRING,
stats,
Expand All @@ -104,11 +102,6 @@ Suggests:
topGO,
vegan,
WGCNA,
NMF,
qgraph,
MOFA2,
shadowtext,
plotROC,
xgboost
Remotes:
github::microbiome/mia,
Expand Down
6 changes: 2 additions & 4 deletions inst/pages/exercises.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -1392,8 +1392,6 @@ named `tse`.
#| code-summary: "Show solution"
library(mia)
library(GUniFrac)
data("peerj13075", package = "mia")
tse <- peerj13075
```
Expand Down Expand Up @@ -1484,7 +1482,7 @@ whether the difference of certain taxa was statistically significant.
boxplot & jitterplot.

Useful functions: wilcox.test, kruskal.test, ggplot2::ggplot,
pheatmap::pheatmap, ComplexHeatMap::Heatmap, ANCOMBC::ancombc2,
ComplexHeatmap::pheatmap, ComplexHeatMap::Heatmap, ANCOMBC::ancombc2,
ALDEx2::aldex, Maaslin2::Maaslin2, agglomerateByRank, transformAssay,
subsetByPrevalent

Expand Down Expand Up @@ -1719,7 +1717,7 @@ sample types).
```{r, eval = FALSE}
# Load necessary libraries
library(SummarizedExperiment)
library(pheatmap)
library(ComplexHeatmap)
# Example data creation
# Assuming enterotype is a SummarizedExperiment object with sample metadata
Expand Down
2 changes: 1 addition & 1 deletion inst/pages/extra_material.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ clusters$classification
Next we can plot clusters. Annotated heatmap is a common choice.

```{r cobiclust_3a, fig.width=14, fig.height=12}
library(pheatmap)
library(ComplexHeatmap)
# z-transform for heatmap
mae[[1]] <- transformAssay(
mae[[1]], assay.type = "rclr", MARGIN = "features", method = "z",
Expand Down
2 changes: 1 addition & 1 deletion inst/pages/extra_material/24_biclustering.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Next we can plot clusters. Commonly used plot is heatmap with annotations.

```{r cobiclust_3, fig.width=14, fig.height=18}
library(pheatmap)
library(ComplexHeatmap)
# standardize-transform for heatmap
mae[[1]] <- transformAssay(mae[[1]], assay.type = "rclr",
Expand Down
2 changes: 1 addition & 1 deletion inst/pages/extra_material/add-comm-typing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ The community composition can be visualised with a heatmap where one axis repres
Here, the CLR + Z-transformed abundances are shown.

```{r, message=FALSE, warning=FALSE}
library(pheatmap)
library(ComplexHeatmap)
library(grid)
library(RColorBrewer)
# Agglomerate to phylum level
Expand Down
23 changes: 8 additions & 15 deletions inst/pages/machine_learning.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -211,21 +211,14 @@ technique for binary classification problems.
```{r}
#| label: ROC
library(plotROC)
# Add observation as binary
res[["obs_binary"]] <- 0
res[["obs_binary"]][ res[["obs"]] == "healthy" ] <- 1
roc_plot <- ggplot(res, aes(m = .data[["healthy"]], d = .data[["obs_binary"]])) +
geom_roc(labels = FALSE, n.cuts = 0) +
labs(x = "False Positive Rate", y = "True Positive Rate")
# Add AUC
p <- roc_plot +
geom_rocci(fill="pink", sig.level = 0.05) +
geom_text(aes(
0.5, 0.5, label = paste0("AUC = ", round(calc_auc(roc_plot)$AUC, 3))
)) +
theme(legend.position="none")
library(ROCR)
# Get positive class
pos_class <-levels(res[["obs"]])[[1]]
# Create ROC plot
pred <- prediction(res[[pos_class]], ifelse(res[["obs"]] == pos_class, 1, 0))
perf <- performance(pred, measure = "tpr", x.measure = "fpr")
p <- plot(perf)
p
```

Expand Down
4 changes: 2 additions & 2 deletions inst/pages/visualization.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ includes the following packages:
* _patchwork_, _cowplot_, _ggpubr_ and _gridExtra_: plot layouts and multi-panel plotting
* _miaViz_: specific visualization tools for `TreeSummaizedExperiment` objects
* _scater_: specific visualization tools for `SingleCellExperiment` objects
* _ggplot2_, _pheatmap_, _ggtree_, _sechm_: composition heatmaps
* _ggplot2_, _ComplexHeatmap_, _ggtree_, _sechm_: composition heatmaps
* _ANCOMBC_, _ALDEx2_ and _Maaslin2_: visual differential abundance
* _fido_: tree-based methods for differential abundance
* _plotly_: animated and 3D plotting
Expand All @@ -51,7 +51,7 @@ library(patchwork)
library(miaViz)
library(sechm)
library(reshape2)
library(pheatmap)
library(ComplexHeatmap)
library(ape)
library(ggtree)
# essential data
Expand Down

0 comments on commit 988a78c

Please sign in to comment.