Skip to content

Commit 2103a12

Browse files
initial commit
0 parents  commit 2103a12

25 files changed

+3812
-0
lines changed

.Rbuildignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
^voomCLR\.Rproj$
2+
^\.Rproj\.user$
3+
^dev$
4+
^LICENSE\.md$
5+
^README\.Rmd$
6+
^codecov\.yml$
7+
^\.github$

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/check-bioc.yml

Lines changed: 311 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,311 @@
1+
## Read more about GitHub actions the features of this GitHub Actions workflow
2+
## at https://lcolladotor.github.io/biocthis/articles/biocthis.html#use_bioc_github_action
3+
##
4+
## For more details, check the biocthis developer notes vignette at
5+
## https://lcolladotor.github.io/biocthis/articles/biocthis_dev_notes.html
6+
##
7+
## You can add this workflow to other packages using:
8+
## > biocthis::use_bioc_github_action()
9+
##
10+
## Using GitHub Actions exposes you to many details about how R packages are
11+
## compiled and installed in several operating system.s
12+
### If you need help, please follow the steps listed at
13+
## https://github.com/r-lib/actions#where-to-find-help
14+
##
15+
## If you found an issue specific to biocthis's GHA workflow, please report it
16+
## with the information that will make it easier for others to help you.
17+
## Thank you!
18+
19+
## Acronyms:
20+
## * GHA: GitHub Action
21+
## * OS: operating system
22+
23+
on:
24+
push:
25+
pull_request:
26+
27+
name: R-CMD-check-bioc
28+
29+
## These environment variables control whether to run GHA code later on that is
30+
## specific to testthat, covr, and pkgdown.
31+
##
32+
## If you need to clear the cache of packages, update the number inside
33+
## cache-version as discussed at https://github.com/r-lib/actions/issues/86.
34+
## Note that you can always run a GHA test without the cache by using the word
35+
## "/nocache" in the commit message.
36+
env:
37+
has_testthat: 'false'
38+
run_covr: 'false'
39+
run_pkgdown: 'false'
40+
has_RUnit: 'false'
41+
cache-version: 'cache-v1'
42+
run_docker: 'false'
43+
44+
jobs:
45+
build-check:
46+
runs-on: ${{ matrix.config.os }}
47+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
48+
container: ${{ matrix.config.cont }}
49+
## Environment variables unique to this job.
50+
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
config:
55+
- { os: ubuntu-latest, r: '4.2', bioc: '3.15', cont: "bioconductor/bioconductor_docker:RELEASE_3_15", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
56+
- { os: macOS-latest, r: '4.2', bioc: '3.15'}
57+
- { os: windows-latest, r: '4.2', bioc: '3.15'}
58+
## Check https://github.com/r-lib/actions/tree/master/examples
59+
## for examples using the http-user-agent
60+
env:
61+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
62+
RSPM: ${{ matrix.config.rspm }}
63+
NOT_CRAN: true
64+
TZ: UTC
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
67+
68+
steps:
69+
70+
## Set the R library to the directory matching the
71+
## R packages cache step further below when running on Docker (Linux).
72+
- name: Set R Library home on Linux
73+
if: runner.os == 'Linux'
74+
run: |
75+
mkdir /__w/_temp/Library
76+
echo ".libPaths('/__w/_temp/Library')" > ~/.Rprofile
77+
78+
## Most of these steps are the same as the ones in
79+
## https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
80+
## If they update their steps, we will also need to update ours.
81+
- name: Checkout Repository
82+
uses: actions/checkout@v2
83+
84+
## R is already included in the Bioconductor docker images
85+
- name: Setup R from r-lib
86+
if: runner.os != 'Linux'
87+
uses: r-lib/actions/setup-r@v2-branch
88+
with:
89+
r-version: ${{ matrix.config.r }}
90+
http-user-agent: ${{ matrix.config.http-user-agent }}
91+
92+
## pandoc is already included in the Bioconductor docker images
93+
- name: Setup pandoc from r-lib
94+
if: runner.os != 'Linux'
95+
uses: r-lib/actions/setup-pandoc@v2-branch
96+
97+
- name: Query dependencies
98+
run: |
99+
install.packages('remotes')
100+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
101+
shell: Rscript {0}
102+
103+
- name: Restore R package cache
104+
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os != 'Linux'"
105+
uses: actions/cache@v2
106+
with:
107+
path: ${{ env.R_LIBS_USER }}
108+
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_15-r-4.2-${{ hashFiles('.github/depends.Rds') }}
109+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_15-r-4.2-
110+
111+
- name: Cache R packages on Linux
112+
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os == 'Linux' "
113+
uses: actions/cache@v2
114+
with:
115+
path: /home/runner/work/_temp/Library
116+
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_15-r-4.2-${{ hashFiles('.github/depends.Rds') }}
117+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_15-r-4.2-
118+
119+
- name: Install Linux system dependencies
120+
if: runner.os == 'Linux'
121+
run: |
122+
sysreqs=$(Rscript -e 'cat("apt-get update -y && apt-get install -y", paste(gsub("apt-get install -y ", "", remotes::system_requirements("ubuntu", "20.04")), collapse = " "))')
123+
echo $sysreqs
124+
sudo -s eval "$sysreqs"
125+
126+
- name: Install macOS system dependencies
127+
if: matrix.config.os == 'macOS-latest'
128+
run: |
129+
## Enable installing XML from source if needed
130+
brew install libxml2
131+
echo "XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config" >> $GITHUB_ENV
132+
133+
## Required to install magick as noted at
134+
## https://github.com/r-lib/usethis/commit/f1f1e0d10c1ebc75fd4c18fa7e2de4551fd9978f#diff-9bfee71065492f63457918efcd912cf2
135+
brew install imagemagick@6
136+
137+
## For textshaping, required by ragg, and required by pkgdown
138+
brew install harfbuzz fribidi
139+
140+
## For installing usethis's dependency gert
141+
brew install libgit2
142+
143+
## Required for tcltk
144+
brew install xquartz --cask
145+
146+
- name: Install Windows system dependencies
147+
if: runner.os == 'Windows'
148+
run: |
149+
## Edit below if you have any Windows system dependencies
150+
shell: Rscript {0}
151+
152+
- name: Install BiocManager
153+
run: |
154+
message(paste('****', Sys.time(), 'installing BiocManager ****'))
155+
remotes::install_cran("BiocManager")
156+
shell: Rscript {0}
157+
158+
- name: Set BiocVersion
159+
run: |
160+
BiocManager::install(version = "${{ matrix.config.bioc }}", ask = FALSE, force = TRUE)
161+
shell: Rscript {0}
162+
163+
- name: Install dependencies pass 1
164+
run: |
165+
## Try installing the package dependencies in steps. First the local
166+
## dependencies, then any remaining dependencies to avoid the
167+
## issues described at
168+
## https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016675.html
169+
## https://github.com/r-lib/remotes/issues/296
170+
## Ideally, all dependencies should get installed in the first pass.
171+
172+
## Set the repos source depending on the OS
173+
## Alternatively use https://storage.googleapis.com/bioconductor_docker/packages/
174+
## though based on https://bit.ly/bioc2021-package-binaries
175+
## the Azure link will be the main one going forward.
176+
gha_repos <- if(
177+
.Platform$OS.type == "unix" && Sys.info()["sysname"] != "Darwin"
178+
) c(
179+
"AnVIL" = "https://bioconductordocker.blob.core.windows.net/packages/3.15/bioc",
180+
BiocManager::repositories()
181+
) else BiocManager::repositories()
182+
183+
## For running the checks
184+
message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****'))
185+
install.packages(c("rcmdcheck", "BiocCheck"), repos = gha_repos)
186+
187+
## Pass #1 at installing dependencies
188+
## This pass uses AnVIL-powered fast binaries
189+
## details at https://github.com/nturaga/bioc2021-bioconductor-binaries
190+
## The speed gains only apply to the docker builds.
191+
message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****'))
192+
remotes::install_local(dependencies = TRUE, repos = gha_repos, build_vignettes = FALSE, upgrade = TRUE)
193+
continue-on-error: true
194+
shell: Rscript {0}
195+
196+
- name: Install dependencies pass 2
197+
run: |
198+
## Pass #2 at installing dependencies
199+
## This pass does not use AnVIL and will thus update any packages
200+
## that have seen been updated in Bioconductor
201+
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****'))
202+
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE, force = TRUE)
203+
shell: Rscript {0}
204+
205+
- name: Install BiocGenerics
206+
if: env.has_RUnit == 'true'
207+
run: |
208+
## Install BiocGenerics
209+
BiocManager::install("BiocGenerics")
210+
shell: Rscript {0}
211+
212+
- name: Install covr
213+
if: github.ref == 'refs/heads/main' && env.run_covr == 'true' && runner.os == 'Linux'
214+
run: |
215+
remotes::install_cran("covr")
216+
shell: Rscript {0}
217+
218+
- name: Install pkgdown
219+
if: github.ref == 'refs/heads/main' && env.run_pkgdown == 'true' && runner.os == 'Linux'
220+
run: |
221+
remotes::install_cran("pkgdown")
222+
shell: Rscript {0}
223+
224+
- name: Session info
225+
run: |
226+
options(width = 100)
227+
pkgs <- installed.packages()[, "Package"]
228+
sessioninfo::session_info(pkgs, include_base = TRUE)
229+
shell: Rscript {0}
230+
231+
- name: Run CMD check
232+
env:
233+
_R_CHECK_CRAN_INCOMING_: false
234+
DISPLAY: 99.0
235+
run: |
236+
options(crayon.enabled = TRUE)
237+
rcmdcheck::rcmdcheck(
238+
args = c("--no-manual", "--no-vignettes", "--timings"),
239+
build_args = c("--no-manual", "--keep-empty-dirs", "--no-resave-data"),
240+
error_on = "error",
241+
check_dir = "check"
242+
)
243+
shell: Rscript {0}
244+
245+
## Might need an to add this to the if: && runner.os == 'Linux'
246+
- name: Reveal testthat details
247+
if: env.has_testthat == 'true'
248+
run: find . -name testthat.Rout -exec cat '{}' ';'
249+
250+
- name: Run RUnit tests
251+
if: env.has_RUnit == 'true'
252+
run: |
253+
BiocGenerics:::testPackage()
254+
shell: Rscript {0}
255+
256+
- name: Run BiocCheck
257+
env:
258+
DISPLAY: 99.0
259+
run: |
260+
BiocCheck::BiocCheck(
261+
dir('check', 'tar.gz$', full.names = TRUE),
262+
`quit-with-status` = TRUE,
263+
`no-check-R-ver` = TRUE,
264+
`no-check-bioc-help` = TRUE
265+
)
266+
shell: Rscript {0}
267+
268+
- name: Test coverage
269+
if: github.ref == 'refs/heads/main' && env.run_covr == 'true' && runner.os == 'Linux'
270+
run: |
271+
covr::codecov()
272+
shell: Rscript {0}
273+
274+
- name: Install package
275+
if: github.ref == 'refs/heads/main' && env.run_pkgdown == 'true' && runner.os == 'Linux'
276+
run: R CMD INSTALL .
277+
278+
- name: Build and deploy pkgdown site
279+
if: github.ref == 'refs/heads/main' && env.run_pkgdown == 'true' && runner.os == 'Linux'
280+
run: |
281+
git config --local user.name "$GITHUB_ACTOR"
282+
git config --local user.email "[email protected]"
283+
Rscript -e "pkgdown::deploy_to_branch(new_process = FALSE)"
284+
shell: bash {0}
285+
## Note that you need to run pkgdown::deploy_to_branch(new_process = FALSE)
286+
## at least one locally before this will work. This creates the gh-pages
287+
## branch (erasing anything you haven't version controlled!) and
288+
## makes the git history recognizable by pkgdown.
289+
290+
- name: Upload check results
291+
if: failure()
292+
uses: actions/upload-artifact@main
293+
with:
294+
name: ${{ runner.os }}-biocversion-RELEASE_3_15-r-4.2-results
295+
path: check
296+
297+
## Note that DOCKER_PASSWORD is really a token for your dockerhub
298+
## account, not your actual dockerhub account password.
299+
## This comes from
300+
## https://seandavi.github.io/BuildABiocWorkshop/articles/HOWTO_BUILD_WORKSHOP.html#6-add-secrets-to-github-repo
301+
## Check https://github.com/docker/build-push-action/tree/releases/v1
302+
## for more details.
303+
- uses: docker/build-push-action@v1
304+
if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && runner.os == 'Linux' "
305+
with:
306+
username: ${{ secrets.DOCKER_USERNAME }}
307+
password: ${{ secrets.DOCKER_PASSWORD }}
308+
repository: koenvandenberge/voomclr
309+
tag_with_ref: true
310+
tag_with_sha: true
311+
tags: latest

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
lint_results.txt
2+
.Rproj.user
3+
.Rhistory
4+
.RData
5+
.Ruserdata
6+
*.Rproj
7+
.Rdata
8+
.httr-oauth
9+
.DS_Store
10+
inst/doc

DESCRIPTION

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Package: voomCLR
2+
Title: Compositional analysis of cell count data.
3+
Version: 0.99.37
4+
Authors@R:
5+
person("Koen", "Van den Berge", , "[email protected]", role = c("aut", "cre"),
6+
comment = c(ORCID = "0000-0002-1833-8478"))
7+
Description: voomCLR allows for compositional analysis of cell (type/state) counts, taking
8+
into account heteroscedasticity and bias. It transforms cell count data using the
9+
centered-log-ratio (CLR) transformation, and estimates observation-level variances
10+
by leveraging the limma-voom framework and codebase or calculating them analytically.
11+
Residual variances are shrunken using the limma empirical Bayes technique.
12+
Finally, a bias correction is applied as recommended in Zhou et al. (2022),
13+
10.1186/s13059-022-02655-5. The uncertainty involved in estimating the bias term can be
14+
taken into account using bootstrapping.
15+
biocViews: software, single-cell.
16+
License: GPL (>= 3)
17+
Encoding: UTF-8
18+
Roxygen: list(markdown = TRUE)
19+
RoxygenNote: 7.2.3
20+
Imports:
21+
limma,
22+
methods,
23+
statmod,
24+
modeest,
25+
mixtools,
26+
edgeR
27+
Suggests:
28+
BiocStyle,
29+
covr,
30+
knitr,
31+
RefManageR,
32+
rmarkdown,
33+
sessioninfo,
34+
testthat (>= 3.0.0)
35+
Config/testthat/edition: 3
36+
VignetteBuilder: knitr
37+
Collate:
38+
'utils.R'
39+
'applyBiasCorrection.R'
40+
'plotBeta.R'
41+
'topTableBC.R'
42+
'voomALR.R'
43+
'voomCLR.R'

0 commit comments

Comments
 (0)