Skip to content
Snippets Groups Projects
Commit 4d6e7b6d authored by Flavio Lombardo's avatar Flavio Lombardo :goal:
Browse files

Fix directives for test examples

- README update2
parent 0f5cd512
No related branches found
No related tags found
No related merge requests found
......@@ -12,16 +12,24 @@
#' @param unique_name_row_identifier String that indicates the unique identifier for each image, defaults as "filter_image"
#' @export
#' @examples
#' \dontrun{
#' list_of_relabeling =list( "PathCellObject" = "onlyDAPIPositve",
#' "cCasp3" = "cCASP3", "E-Cadherin: cCASP3" = "E-Cadherin and cCASP3",
#' "EpCAM_E-Cadherin" = "E-Cadherin",
#' "EpCAM_E-Cadherin and cCASP3" = "E-Cadherin and cCASP3")
#' bind_data <- data_binding(path_to_the_projects_folder =
#' system.file("extdata/to_merge/", package = "drugsens"))
#' \donttest{
#' # Set up relabeling list
#' list_of_relabeling <- list(
#' "PathCellObject" = "onlyDAPIPositve",
#' "cCasp3" = "cCASP3",
#' "E-Cadherin: cCASP3" = "E-Cadherin and cCASP3",
#' "EpCAM_E-Cadherin" = "E-Cadherin",
#' "EpCAM_E-Cadherin and cCASP3" = "E-Cadherin and cCASP3"
#' )
#'
#' # Load and process example data
#' bind_data <- data_binding(
#' path_to_the_projects_folder = system.file("extdata/to_merge/", package = "drugsens")
#' )
#' counts_dataframe <- make_count_dataframe(bind_data)
#' plotting_ready_dataframe <-
#' change_data_format_to_longer(counts_dataframe)
#'
#' # Convert to long format
#' plotting_ready_dataframe <- change_data_format_to_longer(counts_dataframe)
#' }
# pivot_longer
......
......@@ -7,6 +7,13 @@
#' @importFrom utils read.csv
#' @importFrom stats setNames
#' @import roxygen2
#' @examples
#' \donttest{
#' # Load example data from package
#' bind_data <- data_binding(
#' path_to_the_projects_folder = system.file("extdata/to_merge/", package = "drugsens")
#' )
#' }
# list all the files
list_all_files <- function(define_path, extension, recursive_search) {
......
......@@ -16,7 +16,7 @@
#' @importFrom dplyr filter
#' @return Invisibly returns NULL, but saves plots to disk if save_plots is TRUE
#' @examples
#' \dontrun{
#' \donttest{
#' # First process example data
#' example_path <- system.file("extdata/to_merge/", package = "drugsens")
#' raw_data <- data_binding(path_to_the_projects_folder = example_path)
......
......@@ -20,7 +20,7 @@
#' @importFrom ggplot2 ggplot aes geom_violin geom_boxplot facet_wrap theme element_text labs
#' geom_jitter position_jitter stat_summary aes_string
#' @examples
#' \dontrun{
#' \donttest{
#' # First load and process example data
#' example_path <- system.file("extdata/to_merge/", package = "drugsens")
#' raw_data <- data_binding(path_to_the_projects_folder = example_path)
......
......@@ -8,21 +8,28 @@
#' @param name_of_the_markers_column The name of the column of the .data where the marker names are expressed (ie E-Caderin, DAPI), "Defaults as Name"
#' @export
#' @examples
#' \dontrun{
#' \donttest{
#' # First load example data
#' pkg_path <- system.file("extdata/to_merge/", package = "drugsens")
#' bind_data <- data_binding(
#' path_to_the_projects_folder = pkg_path,
#' files_extension_to_look_for = "csv"
#' )
#'
#' # Process the data
#' counts_dataframe <- make_count_dataframe(bind_data)
#' plotting_ready_dataframe <- change_data_format_to_longer(
#' counts_dataframe
#'
#' # Convert to plotting format
#' plotting_ready_dataframe <- change_data_format_to_longer(counts_dataframe)
#' }
#'
#' \donttest{
#' # Example with custom parameters
#' make_count_dataframe(
#' bind_data,
#' name_of_the_markers_column = "Name",
#' unique_name_row_identifier = "filter_image"
#' )
# make_count_dataframe(
#' data,
#' name_of_the_markers_column = "Name",
#' unique_name_row_identifier = "filter_image"
#' )
#' }
# adding the image number so to identify the distribution
......
# In make_run_config.R:
#' Generates and use a config txt file
#' @description
#' When this function run the first time, it will generated a config.txt file in the user working directory.
......@@ -10,8 +8,9 @@
#' @export
#' @return A `dataframe`/`tibble`.
#' @examples
#' \dontrun{
#' make_run_config()
#' \donttest{
#' # Generate config in temporary directory
#' make_run_config(forcePath = tempdir())
#' }
make_run_config <- function(overwrite_config = FALSE, forcePath = NULL) {
......
......@@ -10,12 +10,15 @@
#' @param .data dataframe with parsed metadata
#' @export
#' @examples
#' # Basic example with sample data
#' input_data <- data.frame(
#' Image = "B516_Ascites_2023-11-25_DOC2020-12-14_dmso_rep_Ecad_cCasp3_(series 01).tif"
#' )
#' test <- drugsens::string_parsing(input_data)
#' \dontrun{
#' data.parsed <- string_parsing(.data)
#'
#' \donttest{
#' # Example with actual data processing
#' data.parsed <- string_parsing(input_data)
#' }
# Main function to bind data from multiple files
......
![](https://img.shields.io/badge/R-%3E%3D%204.0.0-blue)
![](https://www.r-pkg.org/badges/version/drugsens)
# Overview
......@@ -10,6 +12,10 @@ This package is complementary to the STAR protocol: [*Protocol for quantifying d
# Installation
``` r
Install from CRAN
install.packages("drugsens")
# Or for the latest changes:
devtools::install_git("https://git.scicore.unibas.ch/ovca-research/drugsens")
# OR
devtools::install_github("https://github.com/flalom/drugsens") # this is the GitLab's mirroring repo
......
......@@ -30,15 +30,23 @@ This function gets the count data data.frame, that has a wider format and it ret
Reformat the counts data in longer format
}
\examples{
\dontrun{
list_of_relabeling =list( "PathCellObject" = "onlyDAPIPositve",
"cCasp3" = "cCASP3", "E-Cadherin: cCASP3" = "E-Cadherin and cCASP3",
"EpCAM_E-Cadherin" = "E-Cadherin",
"EpCAM_E-Cadherin and cCASP3" = "E-Cadherin and cCASP3")
bind_data <- data_binding(path_to_the_projects_folder =
system.file("extdata/to_merge/", package = "drugsens"))
\donttest{
# Set up relabeling list
list_of_relabeling <- list(
"PathCellObject" = "onlyDAPIPositve",
"cCasp3" = "cCASP3",
"E-Cadherin: cCASP3" = "E-Cadherin and cCASP3",
"EpCAM_E-Cadherin" = "E-Cadherin",
"EpCAM_E-Cadherin and cCASP3" = "E-Cadherin and cCASP3"
)
# Load and process example data
bind_data <- data_binding(
path_to_the_projects_folder = system.file("extdata/to_merge/", package = "drugsens")
)
counts_dataframe <- make_count_dataframe(bind_data)
plotting_ready_dataframe <-
change_data_format_to_longer(counts_dataframe)
# Convert to long format
plotting_ready_dataframe <- change_data_format_to_longer(counts_dataframe)
}
}
......@@ -39,7 +39,7 @@ through make_count_dataframe() and change_data_format_to_longer() to ensure the
data structure for plotting.
}
\examples{
\dontrun{
\donttest{
# First process example data
example_path <- system.file("extdata/to_merge/", package = "drugsens")
raw_data <- data_binding(path_to_the_projects_folder = example_path)
......
......@@ -58,7 +58,7 @@ This function creates quality control plots and calculates basic statistics for
The plots provide visual insights into marker expression patterns and data quality.
}
\examples{
\dontrun{
\donttest{
# First load and process example data
example_path <- system.file("extdata/to_merge/", package = "drugsens")
raw_data <- data_binding(path_to_the_projects_folder = example_path)
......
......@@ -24,19 +24,27 @@ A \code{dataframe}/\code{tibble}.
This function counts every single marker present in the "Name" column of the data.frame and return a dataframe of the counts per marker
}
\examples{
\dontrun{
\donttest{
# First load example data
pkg_path <- system.file("extdata/to_merge/", package = "drugsens")
bind_data <- data_binding(
path_to_the_projects_folder = pkg_path,
files_extension_to_look_for = "csv"
)
# Process the data
counts_dataframe <- make_count_dataframe(bind_data)
plotting_ready_dataframe <- change_data_format_to_longer(
counts_dataframe
# Convert to plotting format
plotting_ready_dataframe <- change_data_format_to_longer(counts_dataframe)
}
\donttest{
# Example with custom parameters
make_count_dataframe(
bind_data,
name_of_the_markers_column = "Name",
unique_name_row_identifier = "filter_image"
)
data,
name_of_the_markers_column = "Name",
unique_name_row_identifier = "filter_image"
)
}
}
......@@ -20,7 +20,8 @@ It will import the data config file into the use environment. This data will be
of the imported dataset and change the name of the markers that is often incorrectly exported.
}
\examples{
\dontrun{
make_run_config()
\donttest{
# Generate config in temporary directory
make_run_config(forcePath = tempdir())
}
}
......@@ -17,11 +17,14 @@ This function will parse the data from the Image name and will return the metada
The metadata will be then associated to the count file as well
}
\examples{
# Basic example with sample data
input_data <- data.frame(
Image = "B516_Ascites_2023-11-25_DOC2020-12-14_dmso_rep_Ecad_cCasp3_(series 01).tif"
)
test <- drugsens::string_parsing(input_data)
\dontrun{
data.parsed <- string_parsing(.data)
\donttest{
# Example with actual data processing
data.parsed <- string_parsing(input_data)
}
}
......@@ -10,4 +10,12 @@ list_all_files(define_path, extension, recursive_search)
\description{
This file contains internal utility functions for file handling and processing
}
\examples{
\donttest{
# Load example data from package
bind_data <- data_binding(
path_to_the_projects_folder = system.file("extdata/to_merge/", package = "drugsens")
)
}
}
\keyword{internal}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment