Skip to content

Commit

Permalink
Adding resolution input parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
AlicenJoyHenning committed Sep 1, 2024
1 parent b1b110c commit 60a33a8
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 51 deletions.
13 changes: 10 additions & 3 deletions R/limiric.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#' @param filtered_path Directory of filtered alignment output
#' @param seurat_input 'Seurat' object to be used as input over raw files. Default NULL
#' @param min_cells In how many cells should a gene be expressed to be kept
#' @param resolution Numeric between 0 and 1.6 describing cluster division. Default 1
#' @param soupx Perform ambient RNA correction, if TRUE raw_path must be given. Default is FALSE
#' @param raw_path Directory of unfiltered alignment output
#' @param droplet_qc Verify output with droplet_qc, if TRUE velocyto_path must be given. Default is FALSE
Expand All @@ -32,7 +33,7 @@
#' @importFrom utils globalVariables
#'
#' @examples
#'
#'
#' if (interactive()) {
#'
#' # Load example Seurat object from the limiric package
Expand Down Expand Up @@ -65,6 +66,7 @@ limiric <- function(
filtered_path = NULL,
seurat_input = NULL,
min_cells = NULL,
resolution = NULL,
soupx = NULL,
raw_path = NULL,
droplet_qc = NULL,
Expand All @@ -87,6 +89,7 @@ limiric <- function(
# Account for defaults
if (is.null(seurat_input)) {seurat_input = NULL}
if (is.null(min_cells)) {min_cells = 0}
if (is.null(resolution)) {resolution = 1}
if (is.null(soupx)) {soupx = FALSE}
if (is.null(droplet_qc)) {droplet_qc = FALSE}
if (is.null(filter_rbc)) {filter_rbc = TRUE}
Expand All @@ -101,6 +104,7 @@ limiric <- function(
filtered_path = filtered_path,
seurat_input = seurat_input,
min_cells = min_cells,
resolution = resolution,
soupx = soupx,
raw_path = raw_path,
droplet_qc = droplet_qc,
Expand Down Expand Up @@ -158,6 +162,7 @@ limiric <- function(
filtered_path <- sample$filtered_path
seurat_input <- sample$seurat_input
min_cells <- sample$min_cells
resolution <- sample$resolution
soupx <- sample$soupx
raw_path <- sample$raw_path
droplet_qc <- sample$droplet_qc
Expand All @@ -171,9 +176,10 @@ limiric <- function(
# Account for defaults
if (is.null(seurat_input)) {seurat_input = NULL}
if (is.null(min_cells)) {min_cells = 0}
if (is.null(resolution)) {resolution = 1}
if (is.null(soupx)) {soupx = FALSE}
if (is.null(droplet_qc)) {droplet_qc = FALSE}
if (is.null(filter_rbc)) {filter_rbc = TRUE}
if (is.null(filter_rbc)) {filter_rbc = TRUE}
if (is.null(isolate_cd45)) {isolate_cd45 = FALSE}
if (is.null(filter_output)) {filter_output = TRUE}
if (is.null(organism)) {organism = "Hsap"}
Expand All @@ -189,6 +195,7 @@ limiric <- function(
filtered_path = filtered_path,
seurat_input = seurat_input,
min_cells = min_cells,
resolution = resolution,
soupx = soupx,
raw_path = raw_path,
droplet_qc = droplet_qc,
Expand All @@ -197,7 +204,7 @@ limiric <- function(
isolate_cd45 = isolate_cd45,
filter_output = filter_output,
output_path = output_path,
organism = organism
organism = organism

)

Expand Down
4 changes: 3 additions & 1 deletion R/limiric_calculation.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#'
#' @param organism A string representing the organism ("Hsap", "Mmus").
#' @param Seurat A 'Seurat' object containing the single-cell RNA-seq data.
#' @param resolution Numeric between 0 and 1.6 describing cluster division. Default is 1.
#' @param annotations A data frame containing gene annotations.
#' @param initial_cells An integer representing the initial number of cells.
#' @param project_name A string representing the name of the project, used for plot titles.
Expand Down Expand Up @@ -52,6 +53,7 @@ utils::globalVariables(c("mt_plot", "complexity_plot", "rb_plot",

limiric_calculation <- function(organism,
Seurat,
resolution,
annotations,
initial_cells,
project_name,
Expand Down Expand Up @@ -111,7 +113,7 @@ limiric_calculation <- function(organism,
ScaleData(verbose = FALSE) %>%
RunPCA(verbose = FALSE) %>%
FindNeighbors(dims = 1:10, verbose = FALSE) %>%
FindClusters(resolution = 1, verbose = FALSE) %>%
FindClusters(resolution = resolution, verbose = FALSE) %>%
RunTSNE(dims = 1:10, verbose = FALSE, check_duplicates = FALSE)

# Calculate mitochondrial & ribosomal QC metrics ------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions R/limiric_core.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' @param filtered_path Directory of filtered alignment output
#' @param seurat_input Seurat object to be used as input over raw files. Default NULL
#' @param min_cells In how many cells should a gene be expressed to be kept
#' @param resolution Numeric between 0 and 1.6 describing cluster division. Default 1
#' @param soupx Perform ambient RNA correction, if TRUE raw_path must be given. Default is FALSE
#' @param raw_path Directory of unfiltered alignment output
#' @param droplet_qc Verify output with droplet_qc, if TRUE velocyto_path must be given. Default is FALSE
Expand Down Expand Up @@ -62,6 +63,7 @@ limiric_core <- function(
filtered_path,
seurat_input = NULL,
min_cells = 0,
resolution = 1,
soupx = FALSE,
raw_path = NULL,
droplet_qc = FALSE,
Expand Down
44 changes: 22 additions & 22 deletions limiric.Rproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
Version: 1.0
RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
AutoAppendNewline: Yes
StripTrailingWhitespace: Yes
LineEndingConversion: Posix
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
Version: 1.0

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes
LineEndingConversion: Posix

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
4 changes: 2 additions & 2 deletions man/assess_EM.Rd

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

4 changes: 2 additions & 2 deletions man/create_dropletqc_plot.Rd

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

2 changes: 1 addition & 1 deletion man/create_plot_grid.Rd

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

12 changes: 6 additions & 6 deletions man/dropletqc_calculation.Rd

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

2 changes: 1 addition & 1 deletion man/identify_empty_droplets.Rd

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

18 changes: 10 additions & 8 deletions man/limiric.Rd

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

12 changes: 7 additions & 5 deletions man/limiric_calculation.Rd

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

2 changes: 2 additions & 0 deletions man/limiric_core.Rd

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

0 comments on commit 60a33a8

Please sign in to comment.