From 0cd61935a8f3836f2f9dd8eb57c7c5cb35b6cabd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Feb 2026 17:29:58 +0000 Subject: [PATCH 1/5] Initial plan From a8807397f3789f676cd09fe4400c29b2b6a5e4eb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Feb 2026 17:36:37 +0000 Subject: [PATCH 2/5] Update multiomics function documentation and run devtools::document() Co-authored-by: MVesuviusC <5831817+MVesuviusC@users.noreply.github.com> --- DESCRIPTION | 2 +- R/multiomics.R | 210 +++++++++++++++++++++++++---------- man/add_nucleosome_signal.Rd | 17 ++- man/annotate_atac.Rd | 20 +++- man/calc_frip.Rd | 29 +++-- man/merge_atac.Rd | 35 ++++-- man/merge_gex_atac.Rd | 35 ++++-- man/process_seurat.Rd | 11 -- man/process_seurat_atac.Rd | 32 ++++-- man/r_dim_plot.Rd | 6 - man/r_feature_plot.Rd | 16 --- man/tss_enrichment.Rd | 17 ++- 12 files changed, 286 insertions(+), 144 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4dbac79..ef576e0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -10,7 +10,7 @@ Description: This is a set of utility functions designed for single cell License: MIT + file LICENSE Encoding: UTF-8 LazyData: true -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 Imports: magrittr, ggplot2, diff --git a/R/multiomics.R b/R/multiomics.R index d332bed..835dd94 100644 --- a/R/multiomics.R +++ b/R/multiomics.R @@ -1,20 +1,35 @@ #' Merge multiple ATAC-seq samples into a single Seurat object #' -#' FUNCTION_DESCRIPTION -#' -#' @param peak_beds DESCRIPTION. -#' @param min_peak_width DESCRIPTION. -#' @param max_peak_width DESCRIPTION. -#' @param frag_paths DESCRIPTION. -#' @param cell_ids DESCRIPTION. -#' @param n_regions_simul DESCRIPTION. -#' @param threads Number of threads to use. +#' Reads peak BED files, reduces overlapping peaks, and creates a merged +#' Seurat object with ATAC-seq data from multiple samples. +#' +#' @param peak_beds Character vector of paths to BED files containing peak +#' regions for each sample. +#' @param min_peak_width Minimum width (in base pairs) for peaks to be +#' included in the analysis. Default is 20. +#' @param max_peak_width Maximum width (in base pairs) for peaks to be +#' included in the analysis. Default is 10000. +#' @param frag_paths Character vector of paths to fragment files (one per +#' sample). +#' @param cell_ids Character vector of sample identifiers to prepend to cell +#' barcodes. Must be in the same order as frag_paths. +#' @param n_regions_simul Number of regions to process simultaneously when +#' building the feature matrix. Default is 2000. +#' @param threads Number of threads to use for parallel processing. Default +#' is 1. #' #' @export #' -#' @return RETURN_DESCRIPTION +#' @return A Seurat object with a merged ATAC assay containing data from all +#' samples. #' @examples -#' # ADD_EXAMPLES_HERE +#' \dontrun{ +#' merged_obj <- merge_atac( +#' peak_beds = c("sample1_peaks.bed", "sample2_peaks.bed"), +#' frag_paths = c("sample1_fragments.tsv.gz", "sample2_fragments.tsv.gz"), +#' cell_ids = c("sample1", "sample2") +#' ) +#' } merge_atac <- function(peak_beds, min_peak_width = 20, max_peak_width = 10000, @@ -72,16 +87,26 @@ merge_atac <- function(peak_beds, #' Add annotation to ATAC data in a Seurat object #' -#' FUNCTION_DESCRIPTION +#' Creates genomic annotations from a GTF file and adds them to the ATAC +#' assay in a Seurat object. The function extracts transcript information, +#' gene biotypes, and gene identifiers from the GTF file. #' -#' @param sobject Seurat object to be processed -#' @param gtf String of path to a gtf file. +#' @param sobject Seurat object containing ATAC data to be annotated. The +#' default assay should be set to "ATAC" or "peaks" before calling this +#' function. +#' @param gtf Character string specifying the path to a GTF file containing +#' genomic annotations. #' #' @export #' -#' @return RETURN_DESCRIPTION +#' @return A Seurat object with genomic annotations added to the ATAC assay. #' @examples -#' # ADD_EXAMPLES_HERE +#' \dontrun{ +#' atac_obj <- annotate_atac( +#' sobject = atac_seurat, +#' gtf = "path/to/genes.gtf" +#' ) +#' } annotate_atac <- function(sobject, gtf) { if (is.null(gtf)) { @@ -135,16 +160,23 @@ annotate_atac <- function(sobject, #' Add nucleosome signal to ATAC data in a Seurat object #' -#' FUNCTION_DESCRIPTION +#' Calculates nucleosome signal for each cell using Signac and adds it as +#' metadata. Also creates a categorical grouping variable based on the +#' specified cutoff. #' -#' @param sobject Seurat object to be processed -#' @param cutoff DESCRIPTION. +#' @param sobject Seurat object containing ATAC data to be processed. +#' @param cutoff Numeric value for the nucleosome signal cutoff. Cells with +#' nucleosome signal above this value are grouped as "NS > cutoff" and +#' cells below are grouped as "NS < cutoff". Default is 4. #' #' @export #' -#' @return RETURN_DESCRIPTION +#' @return A Seurat object with nucleosome signal added as metadata in the +#' nucleosome_signal and nucleosome_group columns. #' @examples -#' # ADD_EXAMPLES_HERE +#' \dontrun{ +#' atac_obj <- add_nucleosome_signal(sobject = atac_seurat, cutoff = 4) +#' } add_nucleosome_signal <- function(sobject, cutoff = 4) { sobject <- Signac::NucleosomeSignal(sobject) @@ -156,16 +188,23 @@ add_nucleosome_signal <- function(sobject, #' Calculate TSS enrichment for a Seurat object #' -#' FUNCTION_DESCRIPTION +#' Calculates transcription start site (TSS) enrichment scores for each cell +#' using Signac. Also creates a categorical variable indicating high or low +#' TSS enrichment based on the specified cutoff. #' -#' @param sobject Seurat object to be processed -#' @param cutoff DESCRIPTION. +#' @param sobject Seurat object containing ATAC data to be processed. +#' @param cutoff Numeric value for the TSS enrichment cutoff. Cells with TSS +#' enrichment above this value are classified as "High" and cells below +#' are classified as "Low". Default is 2. #' #' @export #' -#' @return RETURN_DESCRIPTION +#' @return A Seurat object with TSS enrichment added as metadata in the +#' TSS.enrichment and high_tss columns. #' @examples -#' # ADD_EXAMPLES_HERE +#' \dontrun{ +#' atac_obj <- tss_enrichment(sobject = atac_seurat, cutoff = 2) +#' } tss_enrichment <- function(sobject, cutoff = 2) { sobject <- Signac::TSSEnrichment(sobject, fast = FALSE) @@ -177,18 +216,33 @@ tss_enrichment <- function(sobject, #' Calculate FRiP for a Seurat object #' -#' FUNCTION_DESCRIPTION +#' Calculates the fraction of reads in peaks (FRiP) metric for each cell in +#' an ATAC-seq Seurat object. This function counts fragments from the +#' provided fragment files and calculates quality metrics including total +#' fragments, mononucleosomal fragments, nucleosome-free fragments, and FRiP. #' -#' @param sobject Seurat object to be processed -#' @param frag_files Named list of fragment files. The names should be the -#' string to be prepended to the cell barcodes. -#' @param verbose Should functions be verbose? +#' @param sobject Seurat object containing ATAC data to be processed. +#' @param frag_files Named list of paths to fragment files. The names should +#' correspond to sample identifiers that will be prepended to cell +#' barcodes (with an underscore separator). If providing a single +#' unnamed fragment file, cell names must follow standard CellRanger +#' format (e.g., "ATGC-1"). +#' @param verbose Logical indicating whether functions should produce +#' detailed output messages. Default is FALSE. #' #' @export #' -#' @return RETURN_DESCRIPTION +#' @return A Seurat object with FRiP and fragment count metadata added. If +#' there is a mismatch between cells in the object and fragment files, a +#' data frame of fragment counts is returned instead for inspection. #' @examples -#' # ADD_EXAMPLES_HERE +#' \dontrun{ +#' atac_obj <- calc_frip( +#' sobject = atac_seurat, +#' frag_files = list(sample1 = "path/to/fragments1.tsv.gz", +#' sample2 = "path/to/fragments2.tsv.gz") +#' ) +#' } calc_frip <- function(sobject, frag_files, verbose = FALSE) { @@ -284,20 +338,34 @@ add_atac_metadata <- function(sobject, #' Process a Seurat object with ATAC data #' -#' FUNCTION_DESCRIPTION -#' -#' @param sobject Seurat object to be processed -#' @param assay Assay that has the ATAC data -#' @param verbose Should functions be verbose? -#' @param umap_dims PCA dimensions to use for UMAP -#' @param resolution Resolution to be used in FindClusters -#' @param reduction What reduction to be used to generate umap +#' Performs standard ATAC-seq processing workflow including TF-IDF +#' normalization, feature selection, dimensionality reduction using singular +#' value decomposition (SVD/LSI), clustering, and UMAP generation. +#' +#' @param sobject Seurat object containing ATAC data to be processed. +#' @param assay Name of the assay containing the ATAC data. Default is +#' "ATAC". +#' @param verbose Logical indicating whether processing functions should +#' produce detailed output messages. Default is FALSE. +#' @param umap_dims Integer vector specifying which LSI dimensions to use +#' for UMAP calculation. Default is 2:30 (dimensions 2 through 30). +#' @param resolution Numeric value for clustering resolution passed to +#' FindClusters. Higher values result in more clusters. Default is 0.3. +#' @param reduction Character string specifying which dimensionality +#' reduction to use for clustering and UMAP. Default is "lsi". #' #' @export #' -#' @return A processed Seurat object +#' @return A processed Seurat object with LSI reduction, UMAP coordinates +#' (stored as "umap_atac"), and cluster assignments. The original active +#' assay is restored after processing. #' @examples -#' # ADD_EXAMPLES_HERE +#' \dontrun{ +#' processed_atac <- process_seurat_atac( +#' sobject = atac_seurat, +#' resolution = 0.5 +#' ) +#' } process_seurat_atac <- function(sobject, assay = "ATAC", verbose = FALSE, @@ -313,7 +381,9 @@ process_seurat_atac <- function(sobject, Signac::FindTopFeatures(min.cutoff = "q0", verbose = verbose) %>% Signac::RunSVD(verbose = verbose) %>% Seurat::FindNeighbors(reduction = reduction, verbose = verbose) %>% - Seurat::FindClusters(algorithm = 3, verbose = verbose, resolution = resolution) %>% + Seurat::FindClusters(algorithm = 3, + verbose = verbose, + resolution = resolution) %>% Seurat::RunUMAP(reduction = reduction, dims = umap_dims, verbose = verbose, @@ -342,26 +412,45 @@ process_seurat_atac <- function(sobject, #' Merge GEX and ATAC data #' -#' FUNCTION_DESCRIPTION -#' -#' @param gex_sobj Seurat object with GEX data to be processed -#' @param atac_sobj Seurat object with ATAC data to be processed -#' @param atac_assay_name Name of the assay in atac_sobj that has the ATAC data -#' @param gex_pca_dims GEX PCA dimensions to use for UMAP -#' @param atac_pca_dims ATAC PCA dimensions to use for UMAP -#' @param verbose Should functions be verbose? +#' Combines gene expression (GEX) and ATAC-seq data from separate Seurat +#' objects into a single multimodal object. Performs joint dimensionality +#' reduction and clustering using weighted nearest neighbor (WNN) analysis. +#' +#' @param gex_sobj Seurat object containing gene expression data. Should +#' have PCA reduction already computed. +#' @param atac_sobj Seurat object containing ATAC-seq data. Should have LSI +#' reduction already computed. +#' @param atac_assay_name Character string specifying the name of the ATAC +#' assay in atac_sobj. Default is "ATAC". +#' @param gex_pca_dims Integer vector specifying which PCA dimensions to use +#' from the GEX data. Default uses all available PCA dimensions. +#' @param atac_pca_dims Integer vector specifying which LSI dimensions to +#' use from the ATAC data. Default uses all available LSI dimensions. +#' @param verbose Logical indicating whether processing functions should +#' produce detailed output messages. Default is FALSE. #' #' @export #' -#' @return A processed Seurat object +#' @return A Seurat object containing both RNA and ATAC assays with joint +#' UMAP coordinates and WNN-based cluster assignments. Only cells present +#' in both input objects are retained. #' @examples -#' # ADD_EXAMPLES_HERE +#' \dontrun{ +#' multimodal_obj <- merge_gex_atac( +#' gex_sobj = gex_seurat, +#' atac_sobj = atac_seurat, +#' gex_pca_dims = 1:30, +#' atac_pca_dims = 2:30 +#' ) +#' } merge_gex_atac <- function(gex_sobj, atac_sobj, atac_assay_name = "ATAC", - gex_pca_dims = 1:dim(Seurat::Embeddings(gex_sobj))[2], - atac_pca_dims = 1:dim(Seurat::Embeddings(atac_sobj, - reduction = "lsi"))[2], + gex_pca_dims = + 1:dim(Seurat::Embeddings(gex_sobj))[2], + atac_pca_dims = + 1:dim(Seurat::Embeddings(atac_sobj, + reduction = "lsi"))[2], verbose = FALSE) { # Make seurat object from GEX keeping only cells present in ATAC merged_data <- @@ -385,9 +474,10 @@ merge_gex_atac <- function(gex_sobj, # Make joint UMAP merged_data <- merged_data %>% - Seurat::FindMultiModalNeighbors(reduction.list = list("pca", "lsi"), - dims.list = list(gex_pca_dims, atac_pca_dims), - verbose = verbose) + Seurat::FindMultiModalNeighbors( + reduction.list = list("pca", "lsi"), + dims.list = list(gex_pca_dims, atac_pca_dims), + verbose = verbose) # build a joint UMAP visualization merged_data <- diff --git a/man/add_nucleosome_signal.Rd b/man/add_nucleosome_signal.Rd index d8a0ddf..135f1a8 100644 --- a/man/add_nucleosome_signal.Rd +++ b/man/add_nucleosome_signal.Rd @@ -7,16 +7,23 @@ add_nucleosome_signal(sobject, cutoff = 4) } \arguments{ -\item{sobject}{Seurat object to be processed} +\item{sobject}{Seurat object containing ATAC data to be processed.} -\item{cutoff}{DESCRIPTION.} +\item{cutoff}{Numeric value for the nucleosome signal cutoff. Cells with +nucleosome signal above this value are grouped as "NS > cutoff" and +cells below are grouped as "NS < cutoff". Default is 4.} } \value{ -RETURN_DESCRIPTION +A Seurat object with nucleosome signal added as metadata in the + nucleosome_signal and nucleosome_group columns. } \description{ -FUNCTION_DESCRIPTION +Calculates nucleosome signal for each cell using Signac and adds it as +metadata. Also creates a categorical grouping variable based on the +specified cutoff. } \examples{ -# ADD_EXAMPLES_HERE +\dontrun{ +atac_obj <- add_nucleosome_signal(sobject = atac_seurat, cutoff = 4) +} } diff --git a/man/annotate_atac.Rd b/man/annotate_atac.Rd index 3a1fc29..361cc6f 100644 --- a/man/annotate_atac.Rd +++ b/man/annotate_atac.Rd @@ -7,16 +7,26 @@ annotate_atac(sobject, gtf) } \arguments{ -\item{sobject}{Seurat object to be processed} +\item{sobject}{Seurat object containing ATAC data to be annotated. The +default assay should be set to "ATAC" or "peaks" before calling this +function.} -\item{gtf}{String of path to a gtf file.} +\item{gtf}{Character string specifying the path to a GTF file containing +genomic annotations.} } \value{ -RETURN_DESCRIPTION +A Seurat object with genomic annotations added to the ATAC assay. } \description{ -FUNCTION_DESCRIPTION +Creates genomic annotations from a GTF file and adds them to the ATAC +assay in a Seurat object. The function extracts transcript information, +gene biotypes, and gene identifiers from the GTF file. } \examples{ -# ADD_EXAMPLES_HERE +\dontrun{ +atac_obj <- annotate_atac( + sobject = atac_seurat, + gtf = "path/to/genes.gtf" +) +} } diff --git a/man/calc_frip.Rd b/man/calc_frip.Rd index a349eeb..d489bff 100644 --- a/man/calc_frip.Rd +++ b/man/calc_frip.Rd @@ -7,19 +7,34 @@ calc_frip(sobject, frag_files, verbose = FALSE) } \arguments{ -\item{sobject}{Seurat object to be processed} +\item{sobject}{Seurat object containing ATAC data to be processed.} -\item{frag_files}{Named list of fragment files. The names should be the -string to be prepended to the cell barcodes.} +\item{frag_files}{Named list of paths to fragment files. The names should +correspond to sample identifiers that will be prepended to cell +barcodes (with an underscore separator). If providing a single +unnamed fragment file, cell names must follow standard CellRanger +format (e.g., "ATGC-1").} -\item{verbose}{Should functions be verbose?} +\item{verbose}{Logical indicating whether functions should produce +detailed output messages. Default is FALSE.} } \value{ -RETURN_DESCRIPTION +A Seurat object with FRiP and fragment count metadata added. If + there is a mismatch between cells in the object and fragment files, a + data frame of fragment counts is returned instead for inspection. } \description{ -FUNCTION_DESCRIPTION +Calculates the fraction of reads in peaks (FRiP) metric for each cell in +an ATAC-seq Seurat object. This function counts fragments from the +provided fragment files and calculates quality metrics including total +fragments, mononucleosomal fragments, nucleosome-free fragments, and FRiP. } \examples{ -# ADD_EXAMPLES_HERE +\dontrun{ +atac_obj <- calc_frip( + sobject = atac_seurat, + frag_files = list(sample1 = "path/to/fragments1.tsv.gz", + sample2 = "path/to/fragments2.tsv.gz") +) +} } diff --git a/man/merge_atac.Rd b/man/merge_atac.Rd index b8b5cc0..a82fcf0 100644 --- a/man/merge_atac.Rd +++ b/man/merge_atac.Rd @@ -15,26 +15,41 @@ merge_atac( ) } \arguments{ -\item{peak_beds}{DESCRIPTION.} +\item{peak_beds}{Character vector of paths to BED files containing peak +regions for each sample.} -\item{min_peak_width}{DESCRIPTION.} +\item{min_peak_width}{Minimum width (in base pairs) for peaks to be +included in the analysis. Default is 20.} -\item{max_peak_width}{DESCRIPTION.} +\item{max_peak_width}{Maximum width (in base pairs) for peaks to be +included in the analysis. Default is 10000.} -\item{frag_paths}{DESCRIPTION.} +\item{frag_paths}{Character vector of paths to fragment files (one per +sample).} -\item{cell_ids}{DESCRIPTION.} +\item{cell_ids}{Character vector of sample identifiers to prepend to cell +barcodes. Must be in the same order as frag_paths.} -\item{n_regions_simul}{DESCRIPTION.} +\item{n_regions_simul}{Number of regions to process simultaneously when +building the feature matrix. Default is 2000.} -\item{threads}{Number of threads to use.} +\item{threads}{Number of threads to use for parallel processing. Default +is 1.} } \value{ -RETURN_DESCRIPTION +A Seurat object with a merged ATAC assay containing data from all + samples. } \description{ -FUNCTION_DESCRIPTION +Reads peak BED files, reduces overlapping peaks, and creates a merged +Seurat object with ATAC-seq data from multiple samples. } \examples{ -# ADD_EXAMPLES_HERE +\dontrun{ +merged_obj <- merge_atac( + peak_beds = c("sample1_peaks.bed", "sample2_peaks.bed"), + frag_paths = c("sample1_fragments.tsv.gz", "sample2_fragments.tsv.gz"), + cell_ids = c("sample1", "sample2") +) +} } diff --git a/man/merge_gex_atac.Rd b/man/merge_gex_atac.Rd index 883f80a..ee1ef98 100644 --- a/man/merge_gex_atac.Rd +++ b/man/merge_gex_atac.Rd @@ -14,24 +14,41 @@ merge_gex_atac( ) } \arguments{ -\item{gex_sobj}{Seurat object with GEX data to be processed} +\item{gex_sobj}{Seurat object containing gene expression data. Should +have PCA reduction already computed.} -\item{atac_sobj}{Seurat object with ATAC data to be processed} +\item{atac_sobj}{Seurat object containing ATAC-seq data. Should have LSI +reduction already computed.} -\item{atac_assay_name}{Name of the assay in atac_sobj that has the ATAC data} +\item{atac_assay_name}{Character string specifying the name of the ATAC +assay in atac_sobj. Default is "ATAC".} -\item{gex_pca_dims}{GEX PCA dimensions to use for UMAP} +\item{gex_pca_dims}{Integer vector specifying which PCA dimensions to use +from the GEX data. Default uses all available PCA dimensions.} -\item{atac_pca_dims}{ATAC PCA dimensions to use for UMAP} +\item{atac_pca_dims}{Integer vector specifying which LSI dimensions to +use from the ATAC data. Default uses all available LSI dimensions.} -\item{verbose}{Should functions be verbose?} +\item{verbose}{Logical indicating whether processing functions should +produce detailed output messages. Default is FALSE.} } \value{ -A processed Seurat object +A Seurat object containing both RNA and ATAC assays with joint + UMAP coordinates and WNN-based cluster assignments. Only cells present + in both input objects are retained. } \description{ -FUNCTION_DESCRIPTION +Combines gene expression (GEX) and ATAC-seq data from separate Seurat +objects into a single multimodal object. Performs joint dimensionality +reduction and clustering using weighted nearest neighbor (WNN) analysis. } \examples{ -# ADD_EXAMPLES_HERE +\dontrun{ +multimodal_obj <- merge_gex_atac( + gex_sobj = gex_seurat, + atac_sobj = atac_seurat, + gex_pca_dims = 1:30, + atac_pca_dims = 2:30 +) +} } diff --git a/man/process_seurat.Rd b/man/process_seurat.Rd index 5bddb59..2b8c1cd 100644 --- a/man/process_seurat.Rd +++ b/man/process_seurat.Rd @@ -21,22 +21,11 @@ process_seurat( \arguments{ \item{sobject}{A Seurat object} -\item{verbose}{Controls verbosity} - \item{pca_npcs}{Number of principal components to use in RunPCA(). Passed to npcs argument} \item{run_umap_dims}{Number of PCA dimensions to use in RunUMAP() and FindNeighbors()} -\item{assay}{Assay to pull data for when using \code{features}, or assay used to construct Graph -if running UMAP on a Graph} - -\item{resolution}{Value of the resolution parameter, use a value above -(below) 1.0 if you want to obtain a larger (smaller) number of communities.} - -\item{reduction}{Which dimensional reduction (PCA or ICA) to use for the -UMAP input. Default is PCA} - \item{graph_name}{Name of graph to use for the clustering algorithm in FindClusters()} \item{neighbor_k_param}{Number of neighbors (k.param) to use in FindNeighbors()} diff --git a/man/process_seurat_atac.Rd b/man/process_seurat_atac.Rd index ec7e4d5..75fa86e 100644 --- a/man/process_seurat_atac.Rd +++ b/man/process_seurat_atac.Rd @@ -14,24 +14,38 @@ process_seurat_atac( ) } \arguments{ -\item{sobject}{Seurat object to be processed} +\item{sobject}{Seurat object containing ATAC data to be processed.} -\item{assay}{Assay that has the ATAC data} +\item{assay}{Name of the assay containing the ATAC data. Default is +"ATAC".} -\item{verbose}{Should functions be verbose?} +\item{verbose}{Logical indicating whether processing functions should +produce detailed output messages. Default is FALSE.} -\item{umap_dims}{PCA dimensions to use for UMAP} +\item{umap_dims}{Integer vector specifying which LSI dimensions to use +for UMAP calculation. Default is 2:30 (dimensions 2 through 30).} -\item{resolution}{Resolution to be used in FindClusters} +\item{resolution}{Numeric value for clustering resolution passed to +FindClusters. Higher values result in more clusters. Default is 0.3.} -\item{reduction}{What reduction to be used to generate umap} +\item{reduction}{Character string specifying which dimensionality +reduction to use for clustering and UMAP. Default is "lsi".} } \value{ -A processed Seurat object +A processed Seurat object with LSI reduction, UMAP coordinates + (stored as "umap_atac"), and cluster assignments. The original active + assay is restored after processing. } \description{ -FUNCTION_DESCRIPTION +Performs standard ATAC-seq processing workflow including TF-IDF +normalization, feature selection, dimensionality reduction using singular +value decomposition (SVD/LSI), clustering, and UMAP generation. } \examples{ -# ADD_EXAMPLES_HERE +\dontrun{ +processed_atac <- process_seurat_atac( + sobject = atac_seurat, + resolution = 0.5 +) +} } diff --git a/man/r_dim_plot.Rd b/man/r_dim_plot.Rd index d930740..58be7d8 100644 --- a/man/r_dim_plot.Rd +++ b/man/r_dim_plot.Rd @@ -14,14 +14,8 @@ r_dim_plot( ) } \arguments{ -\item{object}{Seurat object} - \item{title}{Title to use for plot} -\item{label}{Whether to label the clusters} - -\item{pt.size}{Adjust point size for plotting} - \item{pt_alpha}{Transparency of points (should be between 0 and 1)} \item{...}{Other arguments to pass to Seurat::DimPlot} diff --git a/man/r_feature_plot.Rd b/man/r_feature_plot.Rd index d843b3d..7706fdf 100644 --- a/man/r_feature_plot.Rd +++ b/man/r_feature_plot.Rd @@ -7,24 +7,8 @@ r_feature_plot(object, features, title = NULL, pt.size = 1, order = TRUE, ...) } \arguments{ -\item{object}{Seurat object} - -\item{features}{Vector of features to plot. Features can come from: -\itemize{ - \item An \code{Assay} feature (e.g. a gene name - "MS4A1") - \item A column name from meta.data (e.g. mitochondrial percentage - - "percent.mito") - \item A column name from a \code{DimReduc} object corresponding to the - cell embedding values (e.g. the PC 1 scores - "PC_1") -}} - \item{title}{Title to use for plot} -\item{pt.size}{Adjust point size for plotting} - -\item{order}{Boolean determining whether to plot cells in order of expression. Can be useful if -cells expressing given feature are getting buried.} - \item{...}{Other arguments to pass to Seurat::FeaturePlot} } \value{ diff --git a/man/tss_enrichment.Rd b/man/tss_enrichment.Rd index f19f809..c491a07 100644 --- a/man/tss_enrichment.Rd +++ b/man/tss_enrichment.Rd @@ -7,16 +7,23 @@ tss_enrichment(sobject, cutoff = 2) } \arguments{ -\item{sobject}{Seurat object to be processed} +\item{sobject}{Seurat object containing ATAC data to be processed.} -\item{cutoff}{DESCRIPTION.} +\item{cutoff}{Numeric value for the TSS enrichment cutoff. Cells with TSS +enrichment above this value are classified as "High" and cells below +are classified as "Low". Default is 2.} } \value{ -RETURN_DESCRIPTION +A Seurat object with TSS enrichment added as metadata in the + TSS.enrichment and high_tss columns. } \description{ -FUNCTION_DESCRIPTION +Calculates transcription start site (TSS) enrichment scores for each cell +using Signac. Also creates a categorical variable indicating high or low +TSS enrichment based on the specified cutoff. } \examples{ -# ADD_EXAMPLES_HERE +\dontrun{ +atac_obj <- tss_enrichment(sobject = atac_seurat, cutoff = 2) +} } From 88c0a4184bb08ea5b0c9457c90525d305f070dea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Feb 2026 17:38:00 +0000 Subject: [PATCH 3/5] Revert unintended changes to non-multiomics documentation files Co-authored-by: MVesuviusC <5831817+MVesuviusC@users.noreply.github.com> --- man/process_seurat.Rd | 11 +++++++++++ man/r_dim_plot.Rd | 6 ++++++ man/r_feature_plot.Rd | 16 ++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/man/process_seurat.Rd b/man/process_seurat.Rd index 2b8c1cd..5bddb59 100644 --- a/man/process_seurat.Rd +++ b/man/process_seurat.Rd @@ -21,11 +21,22 @@ process_seurat( \arguments{ \item{sobject}{A Seurat object} +\item{verbose}{Controls verbosity} + \item{pca_npcs}{Number of principal components to use in RunPCA(). Passed to npcs argument} \item{run_umap_dims}{Number of PCA dimensions to use in RunUMAP() and FindNeighbors()} +\item{assay}{Assay to pull data for when using \code{features}, or assay used to construct Graph +if running UMAP on a Graph} + +\item{resolution}{Value of the resolution parameter, use a value above +(below) 1.0 if you want to obtain a larger (smaller) number of communities.} + +\item{reduction}{Which dimensional reduction (PCA or ICA) to use for the +UMAP input. Default is PCA} + \item{graph_name}{Name of graph to use for the clustering algorithm in FindClusters()} \item{neighbor_k_param}{Number of neighbors (k.param) to use in FindNeighbors()} diff --git a/man/r_dim_plot.Rd b/man/r_dim_plot.Rd index 58be7d8..d930740 100644 --- a/man/r_dim_plot.Rd +++ b/man/r_dim_plot.Rd @@ -14,8 +14,14 @@ r_dim_plot( ) } \arguments{ +\item{object}{Seurat object} + \item{title}{Title to use for plot} +\item{label}{Whether to label the clusters} + +\item{pt.size}{Adjust point size for plotting} + \item{pt_alpha}{Transparency of points (should be between 0 and 1)} \item{...}{Other arguments to pass to Seurat::DimPlot} diff --git a/man/r_feature_plot.Rd b/man/r_feature_plot.Rd index 7706fdf..d843b3d 100644 --- a/man/r_feature_plot.Rd +++ b/man/r_feature_plot.Rd @@ -7,8 +7,24 @@ r_feature_plot(object, features, title = NULL, pt.size = 1, order = TRUE, ...) } \arguments{ +\item{object}{Seurat object} + +\item{features}{Vector of features to plot. Features can come from: +\itemize{ + \item An \code{Assay} feature (e.g. a gene name - "MS4A1") + \item A column name from meta.data (e.g. mitochondrial percentage - + "percent.mito") + \item A column name from a \code{DimReduc} object corresponding to the + cell embedding values (e.g. the PC 1 scores - "PC_1") +}} + \item{title}{Title to use for plot} +\item{pt.size}{Adjust point size for plotting} + +\item{order}{Boolean determining whether to plot cells in order of expression. Can be useful if +cells expressing given feature are getting buried.} + \item{...}{Other arguments to pass to Seurat::FeaturePlot} } \value{ From a943d12b8bdfd6ec0bf10dd07214c13cd8fe8592 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Feb 2026 17:59:17 +0000 Subject: [PATCH 4/5] Use @inheritParams to reduce duplication in multiomics documentation Co-authored-by: MVesuviusC <5831817+MVesuviusC@users.noreply.github.com> --- R/multiomics.R | 17 ++++++++--------- man/add_atac_metadata.Rd | 16 ++++++++++++---- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/R/multiomics.R b/R/multiomics.R index 835dd94..de21919 100644 --- a/R/multiomics.R +++ b/R/multiomics.R @@ -192,7 +192,7 @@ add_nucleosome_signal <- function(sobject, #' using Signac. Also creates a categorical variable indicating high or low #' TSS enrichment based on the specified cutoff. #' -#' @param sobject Seurat object containing ATAC data to be processed. +#' @inheritParams add_nucleosome_signal #' @param cutoff Numeric value for the TSS enrichment cutoff. Cells with TSS #' enrichment above this value are classified as "High" and cells below #' are classified as "Low". Default is 2. @@ -221,7 +221,7 @@ tss_enrichment <- function(sobject, #' provided fragment files and calculates quality metrics including total #' fragments, mononucleosomal fragments, nucleosome-free fragments, and FRiP. #' -#' @param sobject Seurat object containing ATAC data to be processed. +#' @inheritParams add_nucleosome_signal #' @param frag_files Named list of paths to fragment files. The names should #' correspond to sample identifiers that will be prepended to cell #' barcodes (with an underscore separator). If providing a single @@ -311,12 +311,12 @@ calc_frip <- function(sobject, #' #' Add nucleosome signal, TSS enrichment, and FRiP to a Seurat object #' -#' @param sobject Seurat object to be processed -#' @param gtf String of path to a gtf file. +#' @inheritParams annotate_atac +#' @inheritParams add_nucleosome_signal +#' @inheritParams tss_enrichment +#' @inheritParams calc_frip #' @param nucl_cutoff Cutoff for nucleosome signal #' @param tss_cutoff Cutoff for TSS enrichment -#' @param frag_files Named list of paths to fragment files. -#' @param verbose Should functions be verbose? #' #' @export #' @@ -342,7 +342,7 @@ add_atac_metadata <- function(sobject, #' normalization, feature selection, dimensionality reduction using singular #' value decomposition (SVD/LSI), clustering, and UMAP generation. #' -#' @param sobject Seurat object containing ATAC data to be processed. +#' @inheritParams add_nucleosome_signal #' @param assay Name of the assay containing the ATAC data. Default is #' "ATAC". #' @param verbose Logical indicating whether processing functions should @@ -426,8 +426,7 @@ process_seurat_atac <- function(sobject, #' from the GEX data. Default uses all available PCA dimensions. #' @param atac_pca_dims Integer vector specifying which LSI dimensions to #' use from the ATAC data. Default uses all available LSI dimensions. -#' @param verbose Logical indicating whether processing functions should -#' produce detailed output messages. Default is FALSE. +#' @inheritParams process_seurat_atac #' #' @export #' diff --git a/man/add_atac_metadata.Rd b/man/add_atac_metadata.Rd index 52b7c87..4a479e2 100644 --- a/man/add_atac_metadata.Rd +++ b/man/add_atac_metadata.Rd @@ -14,17 +14,25 @@ add_atac_metadata( ) } \arguments{ -\item{sobject}{Seurat object to be processed} +\item{sobject}{Seurat object containing ATAC data to be annotated. The +default assay should be set to "ATAC" or "peaks" before calling this +function.} -\item{gtf}{String of path to a gtf file.} +\item{gtf}{Character string specifying the path to a GTF file containing +genomic annotations.} \item{nucl_cutoff}{Cutoff for nucleosome signal} \item{tss_cutoff}{Cutoff for TSS enrichment} -\item{frag_files}{Named list of paths to fragment files.} +\item{frag_files}{Named list of paths to fragment files. The names should +correspond to sample identifiers that will be prepended to cell +barcodes (with an underscore separator). If providing a single +unnamed fragment file, cell names must follow standard CellRanger +format (e.g., "ATGC-1").} -\item{verbose}{Should functions be verbose?} +\item{verbose}{Logical indicating whether functions should produce +detailed output messages. Default is FALSE.} } \value{ A Seurat object From 50bfc6f3f6e220821cb81abc927b7c5dfdfb9452 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Feb 2026 18:00:29 +0000 Subject: [PATCH 5/5] Remove redundant @inheritParams directives Co-authored-by: MVesuviusC <5831817+MVesuviusC@users.noreply.github.com> --- R/multiomics.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/R/multiomics.R b/R/multiomics.R index de21919..2d981e7 100644 --- a/R/multiomics.R +++ b/R/multiomics.R @@ -312,8 +312,6 @@ calc_frip <- function(sobject, #' Add nucleosome signal, TSS enrichment, and FRiP to a Seurat object #' #' @inheritParams annotate_atac -#' @inheritParams add_nucleosome_signal -#' @inheritParams tss_enrichment #' @inheritParams calc_frip #' @param nucl_cutoff Cutoff for nucleosome signal #' @param tss_cutoff Cutoff for TSS enrichment