Skip to content

Commit

Permalink
CRAN submission checks
Browse files Browse the repository at this point in the history
  • Loading branch information
AlicenJoyHenning committed Aug 18, 2024
1 parent fd6d7a1 commit 2d63b54
Show file tree
Hide file tree
Showing 31 changed files with 361 additions and 699 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Description:
The core limiric function processes raw scRNA-seq alignment files to predict
which barcodes correspond to damaged cells and outputs these
predictions in a csv file alongside a filtered Seurat object.
License: GPL-3
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Expand Down
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2024
COPYRIGHT HOLDER: Alicen Henning
21 changes: 0 additions & 21 deletions LICENSE-MIT.md

This file was deleted.

616 changes: 21 additions & 595 deletions LICENSE.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions LICENSE.note
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The `limiric` package is licensed under the MIT license.

This package also includes code derived from the DropletQC package, which is licensed under the MIT license.
The relevant code is clearly marked in the source files. The full text of the MIT license can be found in the file `LICENSE.md`.

Users of the package must comply with the terms of the MIT license.
5 changes: 0 additions & 5 deletions LICENSE.note.txt

This file was deleted.

1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(assess_EM)
export(create_dropletqc_plot)
export(create_imc_plot)
export(create_plot_grid)
Expand Down
12 changes: 12 additions & 0 deletions R/assess_EM.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@
#' @importFrom utils data write.csv
#'
#' @keywords internal
#'
#' @examplesIf interactive()
#' # Example usage:
#' # Assuming `em_result` is the result of an EM model on log10(UMI counts) and nf
#' # and you have set thresholds for UMI and nuclear fraction.
#' em_result <- Mclust(data = your_data) # Replace `your_data` with actual data
#' umi_threshold <- 30
#' nf_threshold <- 0.1
#' result <- assess_EM(em_result, umi_threshold, nf_threshold)
#' print(result)
#'
#' @export

utils::globalVariables(c("nf_means", "umi_means", "nf_check",
"umi_check", "check_1", "check_2",
Expand Down
23 changes: 22 additions & 1 deletion R/create_dropletqc_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @param damaged_percent A numeric value representing the percentage of damaged cells.
#' @param initial_cells An integer representing the initial number of cells.
#'
#' @return A list containing the Seurat object and the limiric object.
#' @return None. The function saves the plots as PNG files.
#'
#' @import cowplot
#' @importFrom dplyr %>% pull group_by summarise mutate arrange slice case_when
Expand All @@ -25,6 +25,27 @@
#' @export
#'
#' @keywords internal
#'
#' @examples
#' \dontrun{
#' # Assuming `seurat_obj` is a Seurat object
#' # and `limiric_obj` is a Seurat object
#'
#' # Define inputs
#' seurat_obj <- CreateSeuratObject(counts = your_counts)
#' limiric_obj <- CreateSeuratObject(counts = your_lim_counts)
#' output_path <- "path/to/save/plots"
#' project_name <- "MyProject"
#' damaged_percent <- 5.0
#' initial_cells <- 1000
#'
#' create_dropletqc_plot(seurat_obj,
#' limiric_obj,
#' output_path,
#' project_name,
#' damaged_percent,
#' initial_cells)
#' }

utils::globalVariables(c("QC", "nf", "nCount_RNA"))

Expand Down
15 changes: 15 additions & 0 deletions R/create_imc_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
#' @export
#'
#' @keywords internal
#'
#' @examples
#' \dontrun{
#' # Example usage:
#' # Assuming `imc_data` is a data frame containing the immune cell data.
#' imc_data <- data.frame(
#' nCount_RNA = runif(100, min = 500, max = 10000),
#' nFeature_RNA = runif(100, min = 200, max = 3000),
#' IMC = sample(c("IMC", "non-IMC"), 100, replace = TRUE)
#' )
#' project_name <- "ImmuneFeatureQC"
#' IMC_percent <- 25.0
#' plot <- create_imc_plot(imc_data, project_name, IMC_percent)
#' print(plot)
#' }

utils::globalVariables(c("IMC", "nCount_RNA", "nFeature_RNA"))

Expand Down
15 changes: 15 additions & 0 deletions R/create_plot_grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
#' @export
#'
#' @keywords internal
#'
#' @examples
#' \dontrun{
#' # Example usage:
#' # Assuming `plot_list` is a list of ggplot objects.
#' plot_list <- list(
#' ggplot(mtcars, aes(x = mpg, y = wt)) + geom_point(),
#' ggplot(mtcars, aes(x = hp, y = qsec)) + geom_point(),
#' ggplot(mtcars, aes(x = drat, y = wt)) + geom_point()
#' )
#' file_path <- "path/to/save/plot_grid.png"
#' nrow <- 2
#' ncol <- 2
#' create_plot_grid(plot_list, file_path, nrow, ncol)
#' }

create_plot_grid <- function(plots, file_path, nrow, ncol = 5) {
plot_grid <- plot_grid(plotlist = plots, ncol = ncol, nrow = nrow)
Expand Down
16 changes: 16 additions & 0 deletions R/create_rbc_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@
#' @export
#'
#' @keywords internal
#'
#' @examples
#' \dontrun{
#' # Assuming `rbc_data` is a data frame containing the RBC data.
#' rbc_data <- data.frame(
#' hemo.percent = runif(100, min = 0, max = 100),
#' ptprc.percent = runif(100, min = 0, max = 100),
#' RBC = sample(c("RBC", "non-RBC"), 100, replace = TRUE)
#' )
#' project_name <- "RBC Contamination Analysis"
#' RBC_percent <- 15.0
#' initial_cells <- 1000
#'
#' plot <- create_rbc_plot(rbc_data, project_name, RBC_percent, initial_cells)
#' print(plot)
#' }

utils::globalVariables(c("RBC"))

Expand Down
9 changes: 9 additions & 0 deletions R/dropletqc_calculation.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
#' @export
#'
#' @keywords internal
#'
#' @examples
#' \dontrun{
#' # Example usage:
#' # Assuming `seurat_obj` is a Seurat object containing the single-cell RNA-seq data.
#' seurat_obj <- CreateSeuratObject(counts = your_counts) # Replace `your_counts` with actual data
#' updated_seurat_obj <- dropletqc_calculation(seurat_obj)
#' print(updated_seurat_obj)
#' }

utils::globalVariables(c("nf", "nCount_RNA", "cell_status"))

Expand Down
17 changes: 17 additions & 0 deletions R/identify_damage_cells.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@
#' @import stats
#'
#' @keywords internal
#'
#' @examples
#' \dontrun{
#' # Example usage:
#' # Assuming `nf_umi_ed_ct` is a data frame with the required structure.
#' nf_umi_ed_ct <- data.frame(
#' nf = runif(100, min = 0, max = 1),
#' umi = sample(100:10000, 100, replace = TRUE),
#' ed = sample(c("cell", "empty_droplet"), 100, replace = TRUE),
#' ct = sample(c("type1", "type2"), 100, replace = TRUE)
#' )
#' nf_sep <- 0.15
#' umi_sep_perc <- 50
#' verbose <- TRUE
#' result <- identify_damage_cells(nf_umi_ed_ct, nf_sep, umi_sep_perc, verbose)
#' print(result)
#' }

utils::globalVariables(c("nf_umi"))

Expand Down
26 changes: 26 additions & 0 deletions R/identify_empty_droplets.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,32 @@
#' @export
#'
#' @keywords internal
#'
#' @examples
#' \dontrun{
#' # Assuming `nf_umi` is a data frame with the required structure.
#' nf_umi <- data.frame(
#' nf = runif(100, min = 0, max = 1),
#' umi = sample(100:10000, 100, replace = TRUE)
#' )
#' nf_rescue <- 0.05
#' umi_rescue <- 1000
#' plot_name <- "empty_droplets_plot"
#' plot_path <- "path/to/save/plot"
#' plot_width <- 18
#' plot_height <- 13
#' pdf_png <- "png"
#'
#' result <- identify_empty_droplets(nf_umi,
#' nf_rescue,
#' umi_rescue,
#' plot_name,
#' plot_path,
#' plot_width,
#' plot_height,
#' pdf_png)
#' print(result)
#' }

utils::globalVariables(c("umi", "nf", "non_integer_examples", "kdde_0", "kdde_1", "gradient_sign", "nf_cutoff"))

Expand Down
21 changes: 21 additions & 0 deletions R/limiric_calculation.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@
#' @export
#'
#' @keywords internal
#'
#' @examples
#' \dontrun{
#' # Assuming `seurat_obj` is a Seurat object
#' seurat_obj <- CreateSeuratObject(counts = your_counts)
#' annotations <- data.frame(
#' gene_name = c("MT-CO1", "RPS3", "RPL5"),
#' gene_biotype = c("protein_coding", "protein_coding", "protein_coding"))
#' organism <- "Hsap"
#' initial_cells <- 1000
#' project_name <- "MyProject"
#' output_path <- "path/to/save/plots"
#'
#' result <- limiric_calculation(organism,
#' seurat_obj,
#' annotations,
#' initial_cells,
#' project_name,
#' output_path)
#' print(result)
#' }

utils::globalVariables(c("mt_plot", "complexity_plot", "rb_plot",
"cluster_plot", "logo", "limiric", "Cells"))
Expand Down
12 changes: 12 additions & 0 deletions R/soupx_calculation.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
#' @export
#'
#' @keywords internal
#'
#' @examples
#' \dontrun{
#' # Assuming `raw_path` is the path to the raw data and `table_of_counts` is a matrix of counts.
#' raw_path <- "path/to/raw/data"
#' table_of_counts <- matrix(sample(0:100, 100, replace = TRUE), nrow = 10)
#' min_cells <- 3
#' project_name <- "SoupX_Project"
#'
#' result <- soupx_calculation(raw_path, table_of_counts, min_cells, project_name)
#' print(result)
#' }

utils::globalVariables(c("SeuratSoup", "meta_data", "umap_embedding", "adj_matrix", "Seurat"))

Expand Down
22 changes: 0 additions & 22 deletions R/test_data.R

This file was deleted.

Binary file removed data/test_data.rda
Binary file not shown.
12 changes: 12 additions & 0 deletions man/assess_EM.Rd

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

23 changes: 22 additions & 1 deletion man/create_dropletqc_plot.Rd

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

15 changes: 15 additions & 0 deletions man/create_imc_plot.Rd

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

Loading

0 comments on commit 2d63b54

Please sign in to comment.