Skip to content

Commit

Permalink
grammar, spelling and comas fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Fersoil authored and Fersoil committed Oct 17, 2024
1 parent fef033e commit 29840c0
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 84 deletions.
4 changes: 2 additions & 2 deletions R/classes-model.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#'
#' After the model is fitted to the data, the RAU values can be predicted using the `predict` method.
#' The RAU value is simply a predicted dilution value (using the standard curve) for a given MFI
#' multiplied by 1 000 000 in order to have a more readable value.
#' multiplied by 1,000 000 to have a more readable value.
#' For more information about the differences between dilution, RAU and MFI values, please see the
#' "Normalization" section in the "Basic PvSTATEM functionalities" vignette.
#' "Normalisation" section in the "Basic PvSTATEM functionalities" vignette.
#'
#'
#' @examples
Expand Down
5 changes: 3 additions & 2 deletions R/generate_report.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#' Generate a report for a plate.
#'
#' This function generates a report for a plate. The report is generated using
#' the `plate_report_template.Rmd` template.
#' @description
#' This function generates a report for a plate. The report contains all the necessary information about the plate, from the general plate parameters, such as examination date, to the breakdown of the analytes' plots.
#' The report is generated using the `plate_report_template.Rmd` template.
#'
#' @param plate A plate object.
#' @param use_model (`logical(1)`) A logical value indicating whether the model should be used in the report.
Expand Down
18 changes: 9 additions & 9 deletions R/get-nmfi.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
#' @description
#' The function calculates the normalised MFI (nMFI) values for each of the analytes in the plate.
#'
#' The nMFI values are calculated as the ratio of the MFI values of test samples to the MFI values of the standard curve samples with the target dilution.
#' The nMFI values are calculated as the ratio of the MFI values of test samples' MFI values to the standard curve samples with the target dilution.
#'
#'
#'
#' **When nMFI could be used?**
#' In general it is preferred to use Relative Antibody Unit (RAU) values for any kind of analysis.
#' However, in some cases it is impossible to fit a model to the standard curve samples.
#' In general, it is preferred to use Relative Antibody Unit (RAU) values for any analysis.
#' However, it is sometimes impossible to fit a model to the standard curve samples.
#' This may happen if the MFI values of test samples are much higher than the MFI of standard curve samples.
#' Then, the prediction would require large data extrapolation, that could lead to unreliable results.
#' Then, the prediction would require significant data extrapolation, which could lead to unreliable results.
#'
#' In such cases, the nMFI values could be used as a proxy for RAU values, if we want, for instance, to account for plate-to-plate variation.
#' In such cases, the nMFI values could be used as a proxy for RAU values if we want, for instance, to account for plate-to-plate variation.
#'
#' @param plate (`Plate()`) a plate object for which to calculate the nMFI values
#' @param reference_dilution (`numeric(1) or character(1)`) the dilution value of the standard curve sample
#' to use as a reference for normalisation. Default is `1/400`.
#' to use as a reference for normalisation. The default is `1/400`.
#' It should refer to a dilution of a standard curve sample in the given plate object.
#' This parameter could be either a numeric value or a string.
#' In case it is a character string, it should have format `1/d+`, where `d+` is any positive integer.
#' @param data_type (`character(1)`) type of data to use for the computation. Median is the default
#' @param verbose (`logical(1)`) print additional information. Default is `TRUE`
#' @param data_type (`character(1)`) type of data for the computation. Median is the default
#' @param verbose (`logical(1)`) print additional information. The default is `TRUE`
#'
#' @return nmfi (`data.frame`) a data frame with normalised MFI values for each of the analytes in the plate and all test samples.
#' @return nmfi (`data.frame`) a data frame with normalised MFI values for each analyte in the plate and all test samples.
#'
#' @examples
#'
Expand Down
30 changes: 15 additions & 15 deletions R/plots-plate.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#' Plot a 96-well plate with colored wells
#' Plot a 96-well plate with coloured wells
#'
#' It is a generic function to plot a 96-well plate with colored wells
#' It is a generic function to plot a 96-well plate with coloured wells
#' used by other functions in this package, mainly to plot layout and counts.
#' The function uses a background image of a 96-well plate and
#' plots the colors in the wells using ggplot2.
#' This function is not intended to be used directly by the user.
#' Rather, it is used by other functions, specified in this file.
#' plots the colours in the wells using ggplot2.
#' This function is not intended for the user to use directly.
#' Rather, it is used by other functions specified in this file.
#'
#' @param colors A vector with 96 colors that will be used to color the wells, order is from left to right and top to bottom
#' @param colours A vector with 96 colours will be used to colour the wells; the order is from left to right and top to bottom
#' @param plot_numbers Logical value indicating if the well numbers should be plotted, default is `FALSE`
#' @param numbers An optional vector with 96 numbers, plotted on the wells. Order is from left to right and top to bottom, must have the same length as colors. It could be used, for instance, to plot the bead count of each well. Must be provided in case the `plot_numbers` parameters is set to `TRUE`
#' @param numbers An optional vector with 96 numbers plotted on the wells. Order is from left to right and top to bottom and must have the same length as colours. It could be used, for instance, to plot the bead count of each well. Must be provided in case the `plot_numbers` parameters are set to `TRUE`
#' @param plot_title The title of the plot (default is "Plate")
#' @param plot_legend Logical value indicating if the legend should be plotted, default is `FALSE`
#' @param legend_mapping A named vector with the colors mapping used to create the legend
#' @param legend_mapping A named vector with the colour mapping used to create the legend
#'
#' @return A ggplot object
#'
Expand Down Expand Up @@ -111,10 +111,10 @@ plot_plate <- function(colors, plot_numbers = FALSE, numbers = NULL, plot_title

#' Plot counts in a 96-well plate
#'
#' This is a function used to plot counts in a 96-well plate using a color to represent the count ranges.
#' There is possibility to plot exact counts in each well. \cr \cr
#' If plot window is resized, it's best to re-run the function to adjust the scaling.
#' Sometimes when legend is plotted, whole layout may be shifted, then it's best to stretch the window, and everything will be adjusted automatically.
#' This function plots counts in a 96-well plate using a colour to represent the count ranges.
#' There is a possibility of plotting exact counts in each well. \cr \cr
#' If the plot window is resized, it's best to re-run the function to adjust the scaling.
#' Sometimes, when a legend is plotted, the whole layout may be shifted. It's best to stretch the window, and everything will be adjusted automatically.
#'
#' @param plate The plate object with the counts data
#' @param analyte_name The name of the analyte
Expand Down Expand Up @@ -202,9 +202,9 @@ plot_counts <- function(plate, analyte_name, plot_counts = TRUE, plot_legend = F
#' Plot layout of a 96-well plate
#'
#' @description
#' This is a function used to plot the layout of a 96-well plate using a color to represent the sample types. \cr \cr
#' If plot window is resized, it's best to re-run the function to adjust the scaling.
#' Sometimes when legend is plotted, whole layout may be shifted, then it's best to stretch the window, and everything will be adjusted automatically.
#' This function plots the layout of a 96-well plate using a colour to represent the sample types. \cr \cr
#' If the plot window is resized, it's best to re-run the function to adjust the scaling.
#' Sometimes, the whole layout may be shifted when a legend is plotted. It's best to stretch the window, and everything will be adjusted automatically.
#'
#'
#' @param plate The plate object with the layout information
Expand Down
14 changes: 7 additions & 7 deletions R/process-plate.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ is_valid_normalisation_type <- function(normalisation_type) {
#' **RAU** is the default normalisation type.
#'
#'
#' The behavior of the function, in case of RAU normalisation type, can be summarized as follows:
#' The behaviour of the function, in the case of RAU normalisation type, can be summarised as follows:
#' 1. Adjust blanks if not already done.
#' 2. Fit a model to each analyte using standard curve samples.
#' 3. Compute RAU values for each analyte using the corresponding model.
Expand All @@ -35,19 +35,19 @@ is_valid_normalisation_type <- function(normalisation_type) {
#'
#' @param plate (`Plate()`) a plate object
#' @param output_path (`character(1)`) path to save the computed RAU values.
#' If not provided the file will be saved in the working directory with the name `{normalisation_type}_{plate_name}.csv`.
#' If not provided, the file will be saved in the working directory with the name `{normalisation_type}_{plate_name}.csv`.
#' Where the `{plate_name}` is the name of the plate.
#' @param normalisation_type (`character(1)`) type of normalisation to use. Available options are:
#' \cr \code{c(`r toString(VALID_NORMALISATION_TYPES)`)}.
#' In case
#' @param data_type (`character(1)`) type of data to use for the computation. Median is the default
#' @param adjust_blanks (`logical(1)`) adjust blanks before computing RAU values. Default is `FALSE`
#' @param verbose (`logical(1)`) print additional information. Default is `TRUE`
#' @param reference_dilution (`numeric(1)`) target dilution to use as reference for the nMFI normalisation. Ignored in case of RAU normalisation.
#' @param data_type (`character(1)`) type of data for the computation. Median is the default
#' @param adjust_blanks (`logical(1)`) adjust blanks before computing RAU values. The default is `FALSE`
#' @param verbose (`logical(1)`) print additional information. The default is `TRUE`
#' @param reference_dilution (`numeric(1)`) target dilution for reference for the nMFI normalisation. Ignored in case of RAU normalisation.
#' Default is `1/400`.
#' It should refer to a dilution of a standard curve sample in the given plate object.
#' This parameter could be either a numeric value or a string.
#' In case it is a character string, it should have format `1/d+`, where `d+` is any positive integer.
#' In case it is a character string, it should have the format `1/d+`, where `d+` is any positive integer.
#' @param ... Additional arguments to be passed to the fit model function (`create_standard_curve_model_analyte`)
#'
#' @examples
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


## Overview
This package is a simple tool that handles various formats of raw data produced in Multiplex Bead Assay (MBA). In short, it reads the unstructured, raw data from, e.g., the Luminex device and outputs normalised and well-structured data, which can be used later in more advanced downstream analysis.
This package is a simple tool that handles various raw data formats produced in Multiplex Bead Assay (MBA). In short, it reads the unstructured, raw data from, e.g., the Luminex device and outputs normalised and well-structured data, which can be used later in more advanced downstream analysis.

The package includes three main steps for preprocessing the data:

Expand All @@ -20,8 +20,7 @@ The package includes three main steps for preprocessing the data:

### 🟡 *Semi-release* version

The package is still in a *semi-release* version and new functionalities are being added. We plan to finish this stage of development by the end of 2024, by adding summary reports, quality control tools comparing multiple plates, and different normalisation methods.

The package is still in a *semi-release* version, and new functionalities are being added. We plan to finish this stage of development by the end of 2024 by adding summary reports, quality control tools comparing multiple plates, and different normalisation methods.

## Installation

Expand All @@ -42,17 +41,17 @@ install_github("mini-pw/PvSTATEM")
require(PvSTATEM) # load the installed package
```

The first command loads the `devtools` library (you might need to install it first - using command `install_packages("devtools")`), and the second one sources the git repository with the code of our package and automatically installs it.
The first command loads the `devtools` library (you might need to install it first - using the command `install_packages("devtools")`), and the second one sources the git repository with the code of our package and automatically installs it.

## Examples and instructions

The example use of the package and its functionalities can be found in [the vignettes](https://mini-pw.github.io/PvSTATEM/articles/example_script.html).
For more detailed documentation of the package, check [the package website](https://mini-pw.github.io/PvSTATEM).
For more detailed documentation, check [the package website](https://mini-pw.github.io/PvSTATEM).


## Contributing and issues

As a project in the development phase, we are open to any suggestions, bug reports, and contributions. If you have any ideas or issues, please report them in the [Issues](https://github.com/mini-pw/PvSTATEM/issues) section. Our team of developers will try to address them as soon as possible.
As a project in the development phase, we are open to any suggestions, bug reports, and contributions. If you have any ideas or issues, please report them in the [Issues](https://github.com/mini-pw/PvSTATEM/issues) section. Our team of developers will address them as soon as possible.



Expand Down
Loading

0 comments on commit 29840c0

Please sign in to comment.