Skip to content

Commit

Permalink
Merge pull request #2 from PersonalizedTransplantCare/testing
Browse files Browse the repository at this point in the history
Testing
  • Loading branch information
GuiFabre committed May 10, 2024
2 parents aa2e24e + 6f02287 commit 691b9e9
Show file tree
Hide file tree
Showing 34 changed files with 2,326 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
^.*\.Rproj$
^\.Rproj\.user$
^data-raw$
^docs$
^test$
^_pkgdown\.yml$
^pkgdown$
^doc$
^Meta$
^\.github$
^README.Rmd
^NEWS.Rmd
^cran-comments\.md$
^CRAN-SUBMISSION$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
50 changes: 50 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master, testing]
pull_request:
branches: [main, master, testing]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
.RData
.Ruserdata
banffIT.Rproj
docs/
tests/
docs
inst/doc
/doc/
/Meta/
README.Rmd
NEWS.Rmd
61 changes: 61 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Package: banffIT
Type: Package
Title: Automatize Diagnosis Standardized Assignation Using the Banff Classification
Version: 1.0.0
Authors@R:
c(person(given = "Guillaume",
family = "Fabre",
role = c("aut","cre"),
email = "guijoseph.fabre@gmail.com",
comment = c(ORCID = "0000-0002-0124-9970")),
person(given = "Ruth",
family = "Sapir-Pichhadze",
role=c("fnd","cph","ctb"),
email="ruth.sapir-pichhadze@mcgill.ca"),
person(given = "Samuel",
family = "El Bouzaïdi Tiali",
role=c("ctb"),
email="sbtiali@maelstrom-research.org"),
person(given = "Jérôme",
family = "Laforme",
role=c("ctb"),
email="jlaforme@maelstrom-research.org"),
person(given = "Tina",
family = "Wey",
role=c("ctb"),
email="twey@maelstrom-research.org"))
Maintainer: Guillaume Fabre <guijoseph.fabre@gmail.com>
Description: Assigns standardized diagnoses using the Banff Classification
(Category 1 to 6 diagnoses, including Acute and Chronic active T-cell
mediated rejection as well as Active, Chronic active, and Chronic antibody
mediated rejection). The main function considers a minimal dataset
containing biopsies information in a specific format (described by a data
dictionary), verifies its content and format (based on the data dictionary),
assigns diagnoses, and creates a summary report. The package is developed on
the reference guide to the Banff classification of renal allograft pathology
Roufosse C, Simmonds N, Clahsen-van Groningen M, et al. A (2018) <doi:10.1097/TP.0000000000002366>.
The full description of the Banff classification is available at <https://banfffoundation.org/>.
License: GPL-3
Depends: R (>= 3.4)
URL: https://github.com/PersonalizedTransplantCare/banffIT
BugReports: https://github.com/PersonalizedTransplantCare/banffIT/issues
Roxygen: list(markdown = TRUE)
Imports: dplyr (>= 1.1.0),
rlang,
tools,
utils,
crayon,
stringr,
fs,
lubridate,
tidyr,
fabR,
madshapR
Suggests:
knitr,
rmarkdown,
usethis
VignetteBuilder: knitr
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.2.3
26 changes: 26 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by roxygen2: do not edit by hand

export(add_diagnoses)
export(banffIT_website)
export(banff_dataset_evaluate)
export(banff_launcher)
export(calculate_adequacy)
export(dataset_cat_as_labels)
export(dataset_summarize)
export(get_banff_dictionary)
export(get_banff_example)
export(get_banff_template)
import(dplyr)
import(fabR)
import(fs)
import(madshapR)
import(stringr)
import(tidyr)
importFrom(crayon,bold)
importFrom(lubridate,is.POSIXt)
importFrom(madshapR,dataset_cat_as_labels)
importFrom(madshapR,dataset_summarize)
importFrom(rlang,":=")
importFrom(rlang,.data)
importFrom(tools,file_ext)
importFrom(utils,browseURL)
59 changes: 59 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

# banffIT 1.0.0

The banffIT package provides functions to assign standardized diagnoses
using the Banff Classification (Category 1 to 6 diagnoses, including
Acute and Chronic active T-cell mediated rejection as well as Active,
Chronic active, and Chronic antibody mediated rejection). The main
function `banff_launcher()`considers a minimal dataset containing
biopsies information in a specific format (described by a data
dictionary), verifies its content and format (based on the data
dictionary), assigns diagnoses, and creates a summary report.

## Main functionality

- `banff_launcher()` This function takes a path string identifying the
input file path. The function internally runs a series of tests that
assess the input dataset. If any of these tests fails, the user gets
information allowing them to correct the input dataset and rerun the
process. Once all tests pass, the dataset is given as an output with a
diagnosis for each observation (using the function `add_diagnoses()`
internally). The output dataset, along with its associated labels
(“label:en” by default) are provided to the user in an Excel format
file accessible in the output_folder specified. The output dataset
comes with a report that summarizes information about variable
distributions and descriptive statistics.

## Additional functions (used in the main function, but can be used separately)

- `banff_dataset_evaluate()` This function takes a dataset and evaluates
its format and content based on the accepted format specified in the
data dictionary.

- `calculate_adequacy()` A tibble object with two variables: the
calculated adequacy (adequacy_calculated) and the adequacy specified
in input (adequacy_input).

- `add_diagnoses()` This function takes a dataset and returns a
diagnosis for each observation. For the function to run, the dataset
must not contain any errors that `banff_launcher()`would have
detected. Please prefer using `banff_launcher()` to run additional
tests.

## Helper functions

- `get_banff_dictionary()`, `get_banff_example()`,
`get_banff_template()` This function gets the data dictionary used to
control the consistency of the input dataset, a example dataset and a
template.

- function `banffIT_website()` This function sends the user to the
online documentation for the package, which includes a description of
the latest version of the package, vignettes, user guides, and a
reference list of functions and help pages.

## Imported functions from madshapR

- [dataset_cat_as_labels()](https://maelstrom-research.github.io/madshapR-documentation/reference/dataset_cat_as_labels.html)

- [dataset_summarize()](https://maelstrom-research.github.io/madshapR-documentation/reference/dataset_summarize.html)
13 changes: 13 additions & 0 deletions R/00-import-from-fabR.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#' @importFrom madshapR dataset_cat_as_labels
#' @name dataset_cat_as_labels
#' @rdname dataset_cat_as_labels
#' @keywords imported
#' @export
madshapR::dataset_cat_as_labels

#' @importFrom madshapR dataset_summarize
#' @name dataset_summarize
#' @rdname dataset_summarize
#' @keywords imported
#' @export
madshapR::dataset_summarize
Loading

0 comments on commit 691b9e9

Please sign in to comment.