Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,29 @@ Package: dsCodaClient
Title: DataSHIELD client-side functions for compositional data analysis
Description: DataSHIELD client functions for compositional data analysis using the compositions package.
Version: 0.2.0
Author: Xavier Escriba Montagut and Stuart Wheater
Maintainer: Xavier Escriba Montagut and Stuart Wheater <stuart.wheater@arjuna.com>
Authors@R: c(
person("Xavier", "Escribà-Montagut", email = "xavier.escriba.montagut@gmail.com", role = "aut"),
person("Stuart", "Wheater", email = "stuart.wheater@arjuna.com", role = c("aut", "cre")),
person("DataSHIELD community", role = c("cph", "fnd"))
)
License: GPL-3
URL: https://github.com/datashield/dsCodaClient
BugReports: https://github.com/datashield/dsCodaClient/issues
Depends:
R (>= 4.1.0),
DSI (>= 1.8.0)
Suggests:
knitr,
rmarkdown,
testthat,
httr
httr,
DSLite,
dsBase,
dsBaseClient,
dsCoda,
dsTidyverseClient,
compositions,
zCompositions
Encoding: UTF-8
VignetteBuilder: knitr
VignetteBuilder: knitr
Config/roxygen2/version: 8.1.0
71 changes: 70 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,71 @@
# dsCodaClient
Cora DataSHIELD client site base functions

DataSHIELD client-side functions for compositional data analysis (CoDa).
Compositional data are vectors of parts that sum to a constant, such as
the 24-hour movement behaviour composition (sleep, sedentary behaviour and
physical activity intensities) studied in the ProPASS consortium.
`dsCodaClient` drives the server-side package
[dsCoda](https://github.com/datashield/dsCoda), which wraps the
[compositions](https://cran.r-project.org/package=compositions) and
[zCompositions](https://cran.r-project.org/package=zCompositions) packages,
so that closure, zero replacement, log-ratio transforms and downstream
analysis run across DataSHIELD servers without individual records leaving
them.

## Functions

| Function | What it does |
|---|---|
| `ds.lrEM()` | Replace zeros / values below detection limit with `zCompositions::lrEM()` (server-side object). |
| `ds.acomp()` | Create a closed Aitchison composition with `compositions::acomp()` (server-side object). |
| `ds.ilr()` | Compute isometric log-ratio coordinates, optionally with a user-supplied basis `V` (server-side object). |
| `ds.meanComp()` | Pooled geometric-mean composition across all servers, returned to the client. |
| `build_sequential_ilr_V()` | Build the ILR basis for a sequential binary partition, for use with `ds.ilr()`. |

## Installation

```r
# install.packages("remotes")
remotes::install_github("datashield/dsCodaClient")
```

`dsCodaClient` needs `DSI` (>= 1.8.0) and `dsBaseClient`;
`ds.meanComp()` additionally uses `dsTidyverseClient` and `compositions`
on the client. Once the package is published on the DataSHIELD CRAN
mirror it will also be installable with
`install.packages("dsCodaClient", repos = c("https://cran.obiba.org", "https://cloud.r-project.org"))`.

Every DataSHIELD server you connect to must have
[dsBase](https://github.com/datashield/dsBase),
[dsCoda](https://github.com/datashield/dsCoda) and, for the regression
workflow in the vignette,
[dsTidyverse](https://github.com/molgenis/ds-tidyverse) installed.

## Quick start

```r
library(DSI)
library(dsBaseClient)
library(dsCodaClient)

# conns <- DSI::datashield.login(logindata, assign = TRUE, symbol = "D")

parts <- c("vpa", "mpa", "lipa", "sleep", "sb")

ds.acomp(X = "D", parts = parts, objectname = "comp", datasources = conns)

V <- build_sequential_ilr_V(length(parts), parts)
ds.ilr(X = "comp", V = V, objectname = "ilr_sbp", datasources = conns)

ds.meanComp("comp", datasources = conns)
```

The vignette walks through the full workflow, including zero replacement
and a pooled regression on the ILR coordinates, using
[DSLite](https://cran.r-project.org/package=DSLite) so no Opal server is
needed: `vignette("dsCodaClient")` or the
[package site](https://datashield.github.io/dsCodaClient/).

## License

GPL-3. Developed by the ProPASS consortium and the DataSHIELD community.
27 changes: 25 additions & 2 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
template:
package: dstemplate
bootstrap: 5
params:
bootswatch: simplex

url: https://github.com/datashield/dsCodaClient/

authors:
Xavier Escribà-Montagut:
href: https://github.com/ESCRI11
Stuart Wheater:
href: https://github.com/StuartWheater

reference:
- title: Server-side assignment
desc: Create objects on the servers; nothing is returned to the client.
contents:
- ds.lrEM
- ds.acomp
- ds.ilr
- title: Client-side helpers
contents:
- ds.meanComp
- build_sequential_ilr_V

articles:
- title: Tutorials
contents:
- dsCodaClient
33 changes: 17 additions & 16 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 14 additions & 15 deletions docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading