diff --git a/.Rbuildignore b/.Rbuildignore index 7693072decc9170150288623caf58a69b1e7ea4b..8ef5bf9acaad61632c0e620b861b2b83fb08762f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,3 +4,4 @@ ^\.Rproj\.user$ ^\.github$ ^LICENSE\.md$ +^cran-comments\.md$ diff --git a/DESCRIPTION b/DESCRIPTION index 73b4d468ea1ba4c6418b5b910d1f5b1b0aee1b8a..6355ffc2befa8f69e5051ea828480950a5125d33 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: DRUGSENS -Title: DRUGSENS is a R-package that allows users to automatically analyze QuPathâ„¢'s output data from imaging analysis. +Title: Allows users to automatically analyze QuPathâ„¢'s output data from imaging analysis. In addition, it will automatically extract metadata from the QuPath's data. Version: 0.1.0 BugReports: https://git.scicore.unibas.ch/ovca-research/DRUGSENS/issues diff --git a/R/change_data_format_to_longer.R b/R/change_data_format_to_longer.R index dbf103c610670f3dcdd6075e06772116ec31a081..80d3b19083a3743e9ff4294e60a562bf3f41ea56 100644 --- a/R/change_data_format_to_longer.R +++ b/R/change_data_format_to_longer.R @@ -10,8 +10,17 @@ #' @param additional_columns columns that can be additionally added to the longer formatted data.frame, "Defaults as c("Treatment", "PID", "Image_number", "Tissue", "Concentration", "DOC")" #' @param unique_name_row_identifier String that indicates the unique identifier for each image, defaults as "filter_image" #' @export -#' @example -#' change_data_format_to_longer(.data, pattern_column_markers = "_ratio_of_total_cells", additional_columns = TRUE) +#' @examples +#' 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")) +#' counts_dataframe <- make_count_dataframe(bind_data) +#' plotting_ready_dataframe <- +#' change_data_format_to_longer(counts_dataframe) + # adding the image number so to identify the distribution # pivot_longer diff --git a/R/data_binding.R b/R/data_binding.R index 2906a5e3f343525880b4ea3b3f8658217205c142..f49f746f6f1071cab456a743eb674063ceab59a6 100644 --- a/R/data_binding.R +++ b/R/data_binding.R @@ -1,4 +1,8 @@ # Get a list of all the files that are in a user-specified folder and get a list of full paths +#' @description +#' This function lists the content of a selected folder either recursively or not +#' @keywords internal +#' @returns list list_all_files <- function(define_path, extension, recursive_search) { list_listed_files <- list.files( path = define_path, @@ -17,6 +21,10 @@ list_all_files <- function(define_path, extension, recursive_search) { } # Helper function to read and process a single file +#' @description +#' This function returns a processed single file +#' @keywords internal +#' @returns dataframe process_file <- function(file_path, # relabeling_map, extension) { @@ -71,11 +79,11 @@ process_file <- function(file_path, #' @param path_to_the_projects_folder String/Path The path where the files coming out of QuPath are located #' @param files_extension_to_look_for String The extension of the file outputted from QuPath, (default is "csv") #' @param recursive_search Boolean, it defined the behavior of the file search, if recursive or not, (default is FALSE) -#' +#' @returns Returns a concatenated dataframe from all the files within the indicated one #' @export -#' @example -#' dataframe_output <- data_binding(path_to_the_projects_folder = "<USER_DEFINED_PATH>" -#' files_extension_to_look_for = "csv") +#' @examples +#' bind_data <- data_binding(path_to_the_projects_folder = system.file("extdata/to_merge/", +#' package = "DRUGSENS")) #' #This will return the dataframe of all the data in the folder # Main function to bind data from multiple files data_binding <- function(path_to_the_projects_folder, diff --git a/R/generate_qu_path_script.R b/R/generate_qu_path_script.R index 49725d0f63963736c737c3af3de25fdacc28342b..050661c3cf269e2149d1458fdce396a1b3c700aa 100644 --- a/R/generate_qu_path_script.R +++ b/R/generate_qu_path_script.R @@ -3,12 +3,11 @@ #' Generate a useful script to consistently save the output data from QuPath in .csv format following the naming conventions #' followed during the package development. #' -#' @return `script_for_qupath.txt in local dir`. +#' @return `script_for_qupath.txt` in local working directory. #' #' @export -#' @example +#' @examples #' generate_qupath_script() -#' script_for_qupath.txt # in the wd generate_qupath_script <- function() { write( x = paste0(' diff --git a/R/make_count_dataframe.R b/R/make_count_dataframe.R index 114379041a6b1adb678f8b719cd91aef5c27d6e6..202320c8fa665706c959031750ad1e21f28de8a3 100644 --- a/R/make_count_dataframe.R +++ b/R/make_count_dataframe.R @@ -7,6 +7,10 @@ #' @param unique_name_row_identifier The name of the column of the .data where the unique name can be used to counts (it defaults to "filter_image") #' @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 +#' bind_data <- data_binding(path_to_the_projects_folder = system.file("extdata/to_merge/", package = "DRUGSENS"), files_extension_to_look_for = "csv") +#' counts_dataframe <- make_count_dataframe(bind_data) +#' plotting_ready_dataframe <- change_data_format_to_longer(counts_dataframe) #' @example #' 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 diff --git a/R/parsers.R b/R/parsers.R index 79aadb17e35b5e182522f7b5b585c8ea0e1d1c42..7507a49b8fd17de077b01aab855ffcad6da11a2c 100644 --- a/R/parsers.R +++ b/R/parsers.R @@ -8,8 +8,15 @@ #' @importFrom stringr str_count #' @return A `dataframe`/`tibble`. #' @param .data dataframe with parsed metadata +#' @examples +#' 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) +#' +#' #' @example #' data.parsed <- string_parsing(.data) +#' #' #This will return the dataframe of all the data in the folder # Main function to bind data from multiple files string_parsing <- function(.data) { @@ -21,12 +28,8 @@ string_parsing <- function(.data) { multiple_drugs <- list() - # Idea I could add the configuration of the relative position of the various elements of the text by providing this configuration in the config file - # in the case of more complex scenario, in the config file, we offer the possibility to manually define the parsing values for more than 3 drugs - # https://bioconductor.org/packages/release/bioc/vignettes/GSVA/inst/doc/GSVA.html # extract information from the data .data$PID <- sapply(strsplit(.data$Image, "_"), `[`, 1, simplify = FALSE) |> unlist() - # .data$PID <- str_extract(.data$Image, "[A-Z0-9]+(?=_)") .data$Tissue <- sapply(strsplit(.data$Image, "_"), `[`, 2, simplify = FALSE) |> unlist() .data$Date1 <- str_extract(.data$Image, "\\d{4}.\\d{2}.\\d{2}") .data$DOC <- str_extract(.data$Image, "(?<=DOC)\\d{2,4}.\\d{2}.\\d{2,4}") diff --git a/README.md b/README.md index cc7841ff4f1d53feaafb8ec30e8fd5f567385542..139ce51d6ea0f61ea6805bd9cab45003da45fa6c 100644 --- a/README.md +++ b/README.md @@ -30,43 +30,104 @@ pak::pak("r-lib/devtools") You can have a look at it [devtools](https://github.com/r-lib/devtools) -# Usage - -## Example - -We recommend making a new project when working with `DRUGSENS`, to have clear and defined path. This will make the data analysis much easier and reproducible. -You can also set you working directory with `setwd()`. - -### QuPath script used - -To make the QuPath script locally available within the working directory, with the currents date: +### QuPath script +__This is the script used in the STAR protocol, regarding the QuPath imaging analysis.__ +``` groovy -``` r -library("DRUGSENS") -generate_qupath_script() +/** + * This QuPath script will take a full image as an annotation + * + * 1. Change path to export data, line 41 + * 2. Make sure that the channel order is DAPI, E-Cadherin, and Cleaved Caspase 3 + * a) if this is not the case, change line 38 (setChannelNames) accordingly + * 3. Your QuPath project must contain classifiers called "Cleaved Caspase 3" and "E-Cadherin" + * If you do not have them, you can download them from our repository, + * or create them yourself: + * i) In a image, create a selection of the full image (run lines 52-59) + * ii) Detect cells (run line 61) + * iii) In the Annotation tab, create new classification classes (Add class) called "Cleaved Caspase 3" and "E-Cadherin" + * iv) Create classifiers (from the menu Classify > Object Classification > Create single measurement classifier) + * v) Name the new classifier "Cleaved Caspase 3", and use following parameters + * Object filter = Detections (all) + * Channel filter = Cleaved Caspase 3 + * Measurement = Nucleus: Cleaved Caspase 3 mean + * Threshold = 200 (value may differ for your image) + * Above threshold = Cleaved Caspase 3 + * vi) Name the new classifier "E-Cadherin", and use following parameters + * Object filter = Detections (all) + * Channel filter = E-Cadherin + * Measurement = Nucleus: E-Cadherin mean + * Threshold = 180 (value may differ for your image) + * Above threshold = E-Cadherin + * 4. Select Run -> Run for project + * It will go through all images in the project, run segmentation + * & apply those 2 classifiers we set up before. + * + * Note: + * You are encouraged to check and adjust the classifier before you run them on your own images. + * For this, follow steps 3.i) - 3.vi) + */ + +import static qupath.lib.gui.scripting.QPEx.* + +// Define the path for data export +def path = '<USER_DEFINED_PATH>' + +setImageType('FLUORESCENCE'); +setChannelNames ('DAPI', 'E-Cadherin', 'Cleaved Caspase 3') + +def name = getProjectEntry().getImageName() + '.txt' +path = buildFilePath(path, '<PID>_<TISSUE>_',Sys.Date(),'_<SAMPLE_DOC>_<TREATMENT_INITIALS>_<CONCENTRATION>_<CONCENTRATION_UNITS>_<REPLICA_OR_NOT>_<TUMOR_MARKER>_<APOPTOTIC_MARKER>') +mkdirs(path) +path = buildFilePath(path, name) + +// Create a new rectangle annotation & add it to the hierarchy +import qupath.lib.roi.RectangleROI +import qupath.lib.objects.PathAnnotationObject +def x_dim = getCurrentImageData().getServer().getWidth() +def y_dim = getCurrentImageData().getServer().getHeight() +def roi = new RectangleROI(0, 0, x_dim, y_dim) +def annotation = new PathAnnotationObject(roi) +addObject(annotation) +setSelectedObject(annotation) + +runPlugin('qupath.imagej.detect.cells.WatershedCellDetection', '{"detectionImage": "DAPI", "requestedPixelSizeMicrons": 0.5, "backgroundRadiusMicrons": 8.0, "medianRadiusMicrons": 0.0, "sigmaMicrons": 2, "minAreaMicrons": 5.0, "maxAreaMicrons": 500.0, "threshold": 45.0, "watershedPostProcess": true, "cellExpansionMicrons": 7.5, "includeNuclei": true, "smoothBoundaries": true, "makeMeasurements": true}') +runObjectClassifier("Cleaved Caspase 3", "E-Cadherin") + +saveAnnotationMeasurements(path) +print 'Results exported to ' + path ``` -This function will generate a `script_for_qupath.txt` file with the code that one can copy/paste into the __QuPath's script manager__. All the sections that contain \<\> should be replaced with the user experimental information. The `columnsToInclude` in the script should also be user defined, depending on the markers used. - -It is very important that the file naming structure of the QuPath's output is maintained for `DRUGSENS` to work correctly. +And this script for exporting the data: ``` groovy -//This groovy snipped script was tested with QuPath 4 + +/** + * QuPath script to export measurements from all analysed images in a project + * + * 1. Define columns you would like to export (line 28) + * 2. In line 17, specify the path where to save your results + */ import qupath.lib.gui.tools.MeasurementExporter import qupath.lib.objects.PathCellObject import qupath.lib.objects.PathDetectionObject +import qupath.lib.objects.PathAnnotationObject +import qupath.lib.objects.PathRootObject + +// Choose your *full* output path +def outputPath = "<PID>_<TISSUE>_',Sys.Date(),'_<SAMPLE_DOC>_<TREATMENT_INITIALS>_<CONCENTRATION>_<CONCENTRATION_UNITS>_<REPLICA_OR_NOT>_<TUMOR_MARKER>_<APOPTOTIC_MARKER>.csv" // Get the list of all images in the current project def project = getProject() def imagesToExport = project.getImageList() -// Separate each measurement value in the output file with a tab ("\t") +// Separate each measurement value in the output file with "," def separator = "," // Choose the columns that will be included in the export -// Note: if columnsToInclude is empty, all columns will be included -def columnsToInclude = new String[]{"Image", "Name", "Class","Centroid X µm","Centroid Y µm","Nucleus: Area", "Nucleus: DAPI mean","Nucleus: E-Cadherin mean", "Nucleus: Cleaved caspase 3 mean", "Cell: Area","Cell: E-Cadherin mean", "Cell: Cleaved caspase 3 mean","Cytoplasm: E-Cadherin mean","Cytoplasm: Cleaved caspase 3 mean","Nucleus/Cell area ratio"} +// Note: if 'columnsToInclude' is empty, all columns will be included +def columnsToInclude = new String[]{"Image", "Name", "Class","Centroid X µm","Centroid Y µm","Nucleus: Area", "Nucleus: DAPI mean","Nucleus: E-Cadherin mean", "Nucleus: Cleaved Caspase 3 mean", "Cell: Area","Cell: E-Cadherin mean", "Cell: Cleaved Caspase 3 mean","Cytoplasm: E-Cadherin mean","Cytoplasm: Cleaved Caspase 3 mean","Nucleus/Cell area ratio"} // Choose the type of objects that the export will process // Other possibilities include: @@ -76,15 +137,7 @@ def columnsToInclude = new String[]{"Image", "Name", "Class","Centroid X µm","C // Note: import statements should then be modified accordingly def exportType = PathCellObject.class -// Choose your *full* output path -def outputPath = "<USER_DEFINED_PATH>/<PID>_<TISSUE>_',Sys.Date(),'_<SAMPLE_DOC>_<TREATMENT_INITIALS>_<CONCENTRATION>_<CONCENTRATION_UNITS>_<REPLICA_OR_NOT>_<TUMOR_MARKER>_<APOPTOTIC_MARKER>.csv" def outputFile = new File(outputPath) -// example <USER_DEFINED_PATH>/B39_Ascites_2023.11.10_DOC2023.10.05_Niraparib_1000_nM_Rep_EpCAM_Ecad_cCasp3_ QuPath will add (series 1, 2 ...etc) at the end of this line, to indicate the stack number -// example <USER_DEFINED_PATH>/B39_Ascites_2023.11.10_DOC2023.10.05_Niraparib_1000_nM_Rep_EpCAM_Ecad_cCasp3_(series 01).tif -//"PID.001_Ascites_2023-11-25_DOC2020-12-14_CarboplatinPaclitaxel_100_uM_10_nM_Ecad_cCasp3_(series 01).tif" -//"A8759_Spleen_2020.11.10_DOC2001.10.05_Compoundx34542_1000_uM_EpCAM_Ecad_cCasp3_(series 01).tif" -//"A8759_Spleen_2020.11.10_DOC2001.10.05_Compoundx34542_1000_uM_EpCAM_Ecad_cCasp3_(series 01).tif" -//"B38_Eye_2023.11.10_DOC2023.10.05_GentamicinePaclitaxel_100_uM_10_nM_EpCAM_Ecad_cCasp3_(series 01).tif" // Create the measurementExporter and start the export def exporter = new MeasurementExporter() @@ -92,11 +145,32 @@ def exporter = new MeasurementExporter() .separator(separator) // Character that separates values .includeOnlyColumns(columnsToInclude) // Columns are case-sensitive .exportType(exportType) // Type of objects to export - .exportMeasurements(outputFile) // Start the export process + .exportMeasurements(outputFile) // Start the export process print "Done!" ``` + +# Usage + +## Example + +We recommend making a new project when working with `DRUGSENS`, to have clear and defined path. This will make the data analysis much easier and reproducible. +You can also set you working directory with `setwd()`. + +### QuPath data in R + +To make the QuPath script locally available within the working directory, with the currents date: + +``` r +library("DRUGSENS") +generate_qupath_script() +``` + +This function will generate a `script_for_qupath.txt` file with the code that one can copy/paste into the __QuPath's script manager__. All the sections that contain \<\> should be replaced with the user experimental information. The `columnsToInclude` in the script should also be user defined, depending on the markers used. + +It is very important that the file naming structure of the QuPath's output is maintained for `DRUGSENS` to work correctly. + > ðŸ“**NOTE** >The column `Image` must be present in the data for DRUGSENS to parse the metadata correctly. Title style (This Is An Example) is fine, but if you have a drug combination refer to the formatting as described below [Handling drug combinations](#bind-qupath-files). @@ -126,7 +200,7 @@ system.file("extdata/to_merge/", package = "DRUGSENS") ``` ### Bind QuPath files -At first the data is a bunch of separate files which are difficult to make sense of; therefore as first step let's bind them together into a single R dataframe! This should take very little time. +At first the data is a bunch of separate files which are difficult to make sense of; therefore as first step let's bind them together into a single R dataframe! The example data can be bound together with this command: ``` r bind_data <- data_binding(path_to_the_projects_folder = system.file("extdata/to_merge/", package = "DRUGSENS"), files_extension_to_look_for = "csv") @@ -135,7 +209,7 @@ You will be now able to `View(bind_data)`. You should see all the image stacks f In this code snippets we show an example of mock data `unique(bind_data$PID)` with PIDs: `"A8759" "B36" "B37", "B38", "B39"` and tissue `"Spleen", "p.wash", "Ascites", "Eye"``. You will have all the metadata in one go and also for drug combinations! > âš ï¸ **WARNING**: As long as you keep the formatting as the above examples. -The dates should also be in the format **yyy-mm-dd**. For the double combinations the two drugs should be written together with each of the different drug capilized (**C**arboplatin**P**aclitaxel) and the rest lowercased letters. +The dates should also be in the format **yyy-mm-dd**. For the combinations of two drugs they should be written together with each of the different drug capilized (**C**arboplatin**P**aclitaxel) and the rest lowercased letters. For example **CarboplatinPaclitaxel_100_uM_10_nM**. This indicates a drug combination of Carboplatin 100_uM and Paclitaxel 10_nM. Each drug amount and each unit should always be separated by `_`. The first 100_uM belongs to the Carboplatin and the 10_nM belongs to the Paclitaxel. Those constrains are due to the parsing of the strings into useful metadata. If some of the data is not present, you can use a `.` separated by `_`. If you need additional data parsing, please let us know by filing an issue on GitLab [GitLab Issue]("https://git.scicore.unibas.ch/ovca-research/DRUGSENS/issues"). ### Counting the number of positiive cells for each marker in every image @@ -144,8 +218,8 @@ This function will take the previous step's generated dataframe and it will coun counts_dataframe <- make_count_dataframe(bind_data) ``` -### Some plotting -This function will take the previous step's generated dataframe (`bind_data`) and it will generate some plots for every cell marker and for some key features from the QuPath metadata, such as nucleus area of the markers and the mean of expression per maker. The script will generate separate folders for each PID in the dataset. There might be quite some plots, therefore you can isolate specific PID or specific treatment, if that is required. With `fill_color_variable` different variables present in the metadata can be tested to visualize the data. +### Plotting +This function will take the previous step's generated dataframe (`bind_data`) and it will generate some plots for every cell marker and for some key features from the QuPath metadata, such as nucleus area of cell and the mean of marker intensity. The script will generate separate folders for each PID in the dataset. There might be quite some plots, therefore you can isolate specific PID or specific treatment, if that is required. With `fill_color_variable` different variables present in the metadata can be tested to visualize the data. ``` r get_QC_plots_parsed_merged_data(bind_data, fill_color_variable = "Tissue", @@ -184,7 +258,7 @@ That follows the structure suggested in the QuPath script ``` "<USER_DEFINED_PATH>/<PID>_<TISSUE>_',Sys.Date(),'_<SAMPLE_DOC>_<TREATMENT_INITIALS>_<CONCENTRATION>_<CONCENTRATION_UNITS>_<REPLICA_OR_NOT>_<TUMOR_MARKER>_<APOPTOTIC_MARKER>.csv" ``` -> âš ï¸ **WARNING**: It is highly recommended to follow the recommended naming structure to obtain the correct output. The dates should also be in the format **yyy-mm-dd**. For the double combinations the two drugs should be wrote together with each of the different drug capilized (**C**arboplatin**P**aclitaxel) and the rest lowercased letters. +> âš ï¸ **WARNING**: It is highly recommended to follow the recommended naming structure to obtain the correct output. The dates should also be in the format **yyy-mm-dd**. For combinations of two drugs they should be written together with each of the different drug capilized (**C**arboplatin**P**aclitaxel) and the rest lowercased letters. For example **CarboplatinPaclitaxel_100_uM_10_nM**. This indicates a drug combination of Carboplatin 100_uM and Paclitaxel 10_nM. Each drug amount and each unit should always be separated by `_`. The first 100_uM belongs to the Carboplatin and the 10_nM belongs to the Paclitaxel. Those constrains are due to the parsing of the string into useful metadata. If some of the data is not present, you can use a `.` separated by `_`. ### Data Binding and Processing diff --git a/cran-comments.md b/cran-comments.md new file mode 100644 index 0000000000000000000000000000000000000000..858617db0debd387f531451160dd85fc7509cb1d --- /dev/null +++ b/cran-comments.md @@ -0,0 +1,5 @@ +## R CMD check results + +0 errors | 0 warnings | 1 note + +* This is a new release. diff --git a/man/change_data_format_to_longer.Rd b/man/change_data_format_to_longer.Rd index e8deb0977120168d446ef2bd3380a7963df548d0..d31477907a494637b90c493e062205b913f22180 100644 --- a/man/change_data_format_to_longer.Rd +++ b/man/change_data_format_to_longer.Rd @@ -26,3 +26,14 @@ A \code{dataframe}/\code{tibble}. \description{ This function gets the count data data.frame, that has a wider format and it returns a longer-formatted data.frame } +\examples{ +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")) +counts_dataframe <- make_count_dataframe(bind_data) +plotting_ready_dataframe <- +change_data_format_to_longer(counts_dataframe) +} diff --git a/man/data_binding.Rd b/man/data_binding.Rd index 896c379ccf86b08df86400d84dae6762e102900f..dc6401ce39a69e1eb2c18169f59219a0d08ad035 100644 --- a/man/data_binding.Rd +++ b/man/data_binding.Rd @@ -19,8 +19,15 @@ data_binding( } \value{ A \code{dataframe}/\code{tibble}. + +Returns a concatenated dataframe from all the files within the indicated one } \description{ This function try to guess the string patterns that are in the dataset and then fill the dataframe with that information. Finally the data is combined and combined them into one file } +\examples{ +bind_data <- data_binding(path_to_the_projects_folder = system.file("extdata/to_merge/", +package = "DRUGSENS")) +#This will return the dataframe of all the data in the folder +} diff --git a/man/generate_qupath_script.Rd b/man/generate_qupath_script.Rd index 2c04f250c320d8835970caf7a3e0fec9067577db..4e32a38406518db57c72c09a4476cfe6259c88d5 100644 --- a/man/generate_qupath_script.Rd +++ b/man/generate_qupath_script.Rd @@ -7,9 +7,12 @@ generate_qupath_script() } \value{ -\verb{script_for_qupath.txt in local dir}. +\code{script_for_qupath.txt} in local working directory. } \description{ Generate a useful script to consistently save the output data from QuPath in .csv format following the naming conventions followed during the package development. } +\examples{ +generate_qupath_script() +} diff --git a/man/make_count_dataframe.Rd b/man/make_count_dataframe.Rd index 8dd6c0d9b19607a549414097ea5b90d435ed87f9..bc758d1a8958055e25753984c15223af260eebe8 100644 --- a/man/make_count_dataframe.Rd +++ b/man/make_count_dataframe.Rd @@ -23,3 +23,8 @@ A \code{dataframe}/\code{tibble}. \description{ 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{ +bind_data <- data_binding(path_to_the_projects_folder = system.file("extdata/to_merge/", package = "DRUGSENS"), files_extension_to_look_for = "csv") +counts_dataframe <- make_count_dataframe(bind_data) +plotting_ready_dataframe <- change_data_format_to_longer(counts_dataframe) +} diff --git a/man/string_parsing.Rd b/man/string_parsing.Rd index 3e1923b0168d62a699064f052c8f8025dca101ed..1c002c6190b336c83147304dfdd7139494d3b790 100644 --- a/man/string_parsing.Rd +++ b/man/string_parsing.Rd @@ -16,3 +16,10 @@ A \code{dataframe}/\code{tibble}. This function will parse the data from the Image name and will return the metadata there contained The metadata will be then associated to the count file as well } +\examples{ + 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) + + +}