Skip to content

Commit

Permalink
corrections after CRAN first release submission
Browse files Browse the repository at this point in the history
  • Loading branch information
GuiFabre committed May 8, 2024
1 parent 0d99c61 commit ca1df17
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 49 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
^README.Rmd
^NEWS.Rmd
^cran-comments\.md$
^CRAN-SUBMISSION$
19 changes: 11 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ Authors@R:
role=c("ctb"),
email="twey@maelstrom-research.org"))
Maintainer: Guillaume Fabre <guijoseph.fabre@gmail.com>
Description: The goal of this package is to provide 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 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.
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/central-repository-for-banff-2019-resources-3/>.
License: GPL-3
Depends: R (>= 3.4)
URL: https://github.com/PersonalizedTransplantCare/banffIT
Expand Down
6 changes: 3 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ dictionary), assigns diagnoses, and creates a summary report.
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 working directory
by default). The output dataset comes with a report that summarizes
information about variable distributions and descriptive statistics.
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)

Expand Down
18 changes: 9 additions & 9 deletions R/02_banff_launcher.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
#' Launch the program
#'
#' @description
#' 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
#' 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 working directory by
#' default). The output dataset comes with a report that summarizes information
#' about variable distributions and descriptive statistics.
#' format file accessible in the output_folder specified. The output dataset
#' comes with a report that summarizes information about variable distributions
#' and descriptive statistics.
#'
#' @param input_file A character string identifying the path of the input file
#' (must be a CSV or a one sheet Excel file)
Expand Down Expand Up @@ -48,7 +48,7 @@
#' @export
banff_launcher <- function(
input_file,
output_folder = getwd(),
output_folder,
language = "label:en",
option_filter,
detail = FALSE){
Expand Down Expand Up @@ -92,7 +92,7 @@ Press [enter] to continue or [esc] to quit.

# check the folder (to be created if does not exists).
if(path_ext(output_folder) != "")
stop(call. = FALSE,"Please specify a valid directory name.")
stop(call. = FALSE,"Please specify a valid directory name (in quote).")
if(!dir.exists(output_folder)) dir_create(output_folder)

# names of objects to be generated in the folder. construct name and check previous existence.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ banffIT_website()
input_file = system.file("extdata", "example.xlsx", package = "banffIT")
banff_launcher(
input_file = input_file,
output_folder = 'folder_path/example',
output_folder = tempdir(), # 'folder_path/example'
language = 'label:en',
option_filter = adequacy == 1,
detail = TRUE)
Expand Down
13 changes: 13 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,16 @@
0 errors | 0 warnings | 1 note

* This is a new release.

### CRAN comments after first attempt of release

> Thanks, we see:
The Description field contains
https:https://banfffoundation ...
the "https:" part is doubled.
Please fix and resubmit.

<https:https://banfffoundation.org/central-repository-for-banff-2019-resources-3/>.

Done, Thanks for noticing it !

16 changes: 8 additions & 8 deletions man/banff_launcher.Rd

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

40 changes: 20 additions & 20 deletions vignettes/banffIT-vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ knitr::opts_chunk$set(
)
```

This package is designed 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).
This package is designed 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 following steps will guide you in this process of diagnosis assignment with
the package. To get your dataset ready and in a correct format, you must
The following steps will guide you in this process of diagnosis assignment with
the package. To get your dataset ready and in a correct format, you must
refer to the data dictionary provided with the package
<a href="https://PersonalizedTransplantCare.github.io/banffIT-documentation/templates/banff_dictionary.xlsx">here</a>
(or using the function `get_banff_dictionary()` in R). This data dictionary
contains metadata specifying how your input dataset should be formatted and what
(or using the function `get_banff_dictionary()` in R). This data dictionary
contains metadata specifying how your input dataset should be formatted and what
information it must contain.

# 1. Having your dataset ready
Expand All @@ -33,33 +33,33 @@ A template (available
<a href="https://PersonalizedTransplantCare.github.io/banffIT-documentation/templates/banff_template.xlsx" download class="external-link">here</a>
or `get_banff_template()` in R) as well as an example dataset (available
<a href="https://PersonalizedTransplantCare.github.io/banffIT-documentation/templates/banff_example.xlsx" download class="external-link">here</a>
or `get_banff_example()` in R) are also available with the package to help you
or `get_banff_example()` in R) are also available with the package to help you
construct and prepare your dataset.

# 2. Run the process with the main function

The main function `banff_launcher()` will go through 3 steps. It will:

a) Evaluate your input dataset (using `banff_dataset_evaluate()` internally).
If your input dataset is not in the correct format or is missing information,
a report will be saved in your output folder and will flag variables and
rows that are not formatted properly. The next step will not run if the input
a) Evaluate your input dataset (using `banff_dataset_evaluate()` internally).
If your input dataset is not in the correct format or is missing information,
a report will be saved in your output folder and will flag variables and
rows that are not formatted properly. The next step will not run if the input
dataset is not in the correct format.

b) Assign diagnosis to each observation (using `calculate_adequacy()` and
b) Assign diagnosis to each observation (using `calculate_adequacy()` and
`add_diagnoses()` internally).

c) Save the output dataset containing diagnoses,a summary report with
c) Save the output dataset containing diagnoses,a summary report with
descriptive statistics of your output dataset, and the data dictionary.


# 3. Use the example file

This command example runs the diagnosis assignment process on the dataset
This command example runs the diagnosis assignment process on the dataset
specified in the input_file path. The output files will be saved in
path_folder/example. The diagnoses will be displayed in English and only
observation with adequacy == 1 will be taken into consideration due to the
option_filter argument. Finally, the output dataset will contain variables
path_folder/example. The diagnoses will be displayed in English and only
observation with adequacy == 1 will be taken into consideration due to the
option_filter argument. Finally, the output dataset will contain variables
generated in the process due to the argument "detail" set to TRUE.

```{r, eval=FALSE}
Expand All @@ -75,7 +75,7 @@ banffIT_website()
input_file = system.file("extdata", "example.xlsx", package = "banffIT")
banff_launcher(
input_file = input_file,
output_folder = 'folder_path/example',
output_folder = tempdir(), # 'folder_path/example'
language = 'label:en',
option_filter = adequacy == 1,
detail = TRUE)
Expand Down

0 comments on commit ca1df17

Please sign in to comment.