diff --git a/r/NAMESPACE b/r/NAMESPACE index 304a2878..55d4adef 100644 --- a/r/NAMESPACE +++ b/r/NAMESPACE @@ -7,6 +7,7 @@ S3method(svds,default) export("all_matrix_inputs<-") export("cellNames<-") export("chrNames<-") +export(Pipeline) export(add_cols) export(add_rows) export(all_matrix_inputs) @@ -40,8 +41,10 @@ export(convert_matrix_type) export(convert_to_fragments) export(discrete_palette) export(draw_trackplot_grid) +export(estimate) export(expm1_slow) export(extend_ranges) +export(fit) export(footprint) export(gene_region) export(gene_score_archr) @@ -85,6 +88,7 @@ export(plot_tf_footprint) export(plot_tss_profile) export(plot_tss_scatter) export(prefix_cell_names) +export(project) export(pseudobulk_matrix) export(qc_scATAC) export(range_distance_to_nearest) @@ -136,8 +140,17 @@ export(write_matrix_anndata_hdf5) export(write_matrix_dir) export(write_matrix_hdf5) export(write_matrix_memory) +exportClasses(Estimator) +exportClasses(PipelineBase) +exportClasses(PipelineStep) +exportClasses(Transformer) exportMethods(as.data.frame) exportMethods(as.matrix) +exportMethods(c) +exportMethods(estimate) +exportMethods(fit) +exportMethods(project) +exportMethods(show) exportMethods(t) importClassesFrom(Matrix,dgCMatrix) importFrom(Matrix,colMeans) diff --git a/r/R/matrix_pipelines.R b/r/R/matrix_pipelines.R new file mode 100644 index 00000000..ea43c7f5 --- /dev/null +++ b/r/R/matrix_pipelines.R @@ -0,0 +1,361 @@ +# Copyright 2024 BPCells contributors +# +# Licensed under the Apache License, Version 2.0 or the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + + +#' Pipeline Base Class +#' @slot fitted (logical) Whether the pipeline has been fitted +#' @name PipelineBase +#' @noRd +#' @export +setClass("PipelineBase", + contains = "VIRTUAL", + slots = list( + fitted = "logical" + ), + prototype = list( + fitted = FALSE + ) +) + +#' Fit a pipeline object to data +#' @param object (PipelineBase) The pipeline object to fit. +#' @param x (IterableMatrix) Input data to be fitted on. +#' @param y Optional output data to be fitted on. Required if the final step is a supervised Estimator, else ignored. +#' @return The fitted pipeline object. +#' @details The `fit()` method is used to fit a pipeline object to data and a potential label output. Within single estimators, the `fit()` method only +#' takes the input data to be fitted on. Within pipelines, the `fit()` method sequentially fits the transformers on each non-terminal step of the pipeline. More specifically, +#' The input data is transformed by each transformer, and used to fit the next transformer in the pipeline. If the final step is an estimator, the input IterableMatrix +#' and label (if supervised) are used to fit the estimator. +#' +#' The fitted pipeline object is returned, allowing for projection of new data. +#' @name fit(PipelineBase,IterableMatrix) +#' @export +setGeneric("fit", function(object, x, y = NULL, ...) standardGeneric("fit")) +#' @export +setMethod("fit", signature(object = "PipelineBase", x = "IterableMatrix"), function(object, x, y = NULL, ...) { + stop("fit() method not implemented for PipelineBase") +}) + +#' Project input data using a fitted pipeline or pipeline step. +#' @param object (PipelineBase) A fitted pipeline object +#' @param x (IterableMatrix) Input data to be transformed +#' @return (IterableMatrix) of data transformed by a fitted pipeline or pipeline step. +#' @details Projecting data using a pipeline or pipeline step requires the pipeline to be fitted to data first. Therefore, +#' the `fit()` method must be executed prior to projecting any data. +#' @name project(PipelineBase,IterableMatrix) +#' @export +setGeneric("project", function(object, x, ...) standardGeneric("project")) +#' @export +setMethod("project", signature(object = "PipelineBase", x = "IterableMatrix"), function(object, x, ...) { + stop("project() method not implemented for PipelineBase") +}) + +#' Estimate predictions on the output data using a fitted pipeline +#' @param object (PipelineBase) The fitted pipeline object. Either the final step is an Estimator, or the pipeline is a single Estimator. +#' @param x (IterableMatrix) Input data to be estimated on +#' @return Predicted output labels as an array. +#' @details Estimation of input data using a pipeline or pipeline step requires the pipeline to be fitted to data first. Therefore, +#' the `fit()` method must be executed prior to projecting any data. +#' @name estimate(PipelineBase,IterableMatrix) +#' @export +setGeneric("estimate", function(object, x, ...) standardGeneric("estimate")) +#' @export +setMethod("estimate", signature(object = "PipelineBase", x = "IterableMatrix"), function(object, x, ...) { + stop("estimate() method not implemented for PipelineBase") +}) + +#' Combine pipeline objects, to create a new pipeline object. +#' @param x (PipelineBase) The pipeline object to combine to. +#' @param ... (PipelineBase) The pipeline objects to combine from. +#' @name c(PipelineBase) +#' @export +setMethod("c", signature(x = "PipelineBase"), function(x, ...) { + stop("c() method not implemented for PipelineBase") +}) + +#' Print how to recreate the pipeline object. +#' @details Utilizes the `short_description()` method to print the steps of the pipeline object. +#' If the object is a pipeline, it will print the steps of the pipeline, demonstrating how to recreate the pipeline with a function call. +#' If the object is a pipeline step, it will print the step name. +#' @param object (PipelineBase) The pipeline object to describe. +setMethod("show", signature(object = "PipelineBase"), function(object) { + stop("show() method not implemented for PipelineBase") +}) + +#' S4 class for combining multiple pipeline steps into a single pipeline +#' @slot steps (list) List of pipeline steps to execute in order +#' @name Pipeline +setClass( + "Pipeline", + contains = "PipelineBase", + slots = list( + steps = "list" + ), + prototype = list( + steps = list() + ) +) + +#' Return a new Pipeline object. +#' @param steps A list of ordered steps of operations to be converted into a pipeline object. +#' @return A new Pipeline object. +#' @details Pipeline objects represent multiple pipeline steps that are to be executed on input data sequentially. +#' Creating a pipeline object can be done by passing a list of pipeline steps to the constructor. +#' Creation only expects that all steps make logical sense. i.e., the final step can be either an Estimator or a Transformer, +#' but each intermediate step cannot be an Estimator. +#' +#' If the steps are all previously fitted, then the overall pipeline is considered fit, and can be used to project/estimate on input data. +#' Otherwise, the pipeline must be fitted before projecting/estimating on input data. +#' @export +Pipeline <- function(steps = list()) { + # Check if all steps are transformers, with the final step being either an estimator or a transformer + for (i in seq_along(steps)) { + step <- steps[[i]] + # allow to fit with estimators as well + if (i < length(steps)) { + assert_is(step, "Transformer") + } else { + assert_is(step, "PipelineStep") + } + } + return(new("Pipeline", steps = steps)) +} + + +#' Check if all steps are transformers, with the final step being either an estimator or a transformer +#' @param object (Pipeline) The pipeline object to check +#' @keywords internal +check_pipeline_validity <- function(object) { + steps <- object@steps + for (i in seq_along(steps)) { + step <- steps[[i]] + # allow to fit with estimators as well + if (i < length(steps)) { + assert_is(step, "Transformer") + } else { + assert_is(step, c("PipelineStep")) + } + } +} + +#' Fit the pipeline object to data +#' @param object (Pipeline) The pipeline object to fit. +#' @param x (IterableMatrix) Input data to be fitted on. +#' @param y Optional output data to be fitted on. Required if the final step is an Estimator, else ignored. +#' @return The fitted pipeline object. +#' @noRd +#' @export +setMethod("fit", signature(object = "Pipeline", x = "IterableMatrix"), function(object, x, y = NULL, ...) { + check_pipeline_validity(object) + steps <- object@steps + # Fit every step in the pipeline + for (i in seq_along(steps)) { + step <- steps[[i]] + # allow to fit with estimators as well + if (i < length(steps) || is.null(y)) { + step <- fit(step, x, ...) + x <- project(step, x) + if (is(x, "dgCMatrix")) x <- as(x, "IterableMatrix") + } else { + step <- fit(step, x, y, ...) + } + steps[[i]] <- step + } + object@steps <- steps + object@fitted <- TRUE + return(object) +}) + + +#' Project input data using a fitted pipeline +#' @param object (Pipeline) The fitted pipeline object +#' @param x (IterableMatrix) Input data to be used by the pipeline to project new data. +#' @return Data projected by the pipeline +#' @noRd +#' @export +setMethod("project", signature(object = "Pipeline", x = "IterableMatrix"), function(object, x, ...) { + if (!object@fitted) stop("Pipeline must be fitted before projecting") + check_pipeline_validity(object) + # check if final step is an estimator + if (is(object@steps[[length(object@steps)]], "Estimator")) stop("The final step must be a transformer instead of an estimator. Please use the `estimate()` method instead.") + steps <- object@steps + for (step in steps) { + x <- project(step, x) + # Some actions convert matrices to a different type, + # so we need to convert back to IterableMatrix for following steps + if (is(x, "dgCMatrix")) x <- as(x, "IterableMatrix") + } + return(x) +}) + + +#' Estimate predictions on the output data using a fitted pipeline +#' @param object (Pipeline) The fitted pipeline object +#' @param x (IterableMatrix) Input data to be estimated on +#' @noRd +#' @export +setMethod("estimate", signature(object = "Pipeline", x = "IterableMatrix"), function(object, x, ...) { + if (!object@fitted) stop("Pipeline must be fitted before estimating") + check_pipeline_validity(object) + if (!is(object@steps[[length(object@steps)]], "Estimator")) stop("The final step must be an estimator with a estimate method. Please use the `project()` method instead.") + steps <- object@steps + for (i in seq_along(steps)) { + step <- steps[[i]] + if (i < n_steps) { + x <- project(step, x) + } else if (is(step, "Estimator")) { + y_pred <- estimate(step, x) + return(y_pred) + } else { + stop("The final step must be an estimator with a estimate method") + } + } +}) + +setMethod("short_description", "Pipeline", function(x) { + character(0) +}) + +#' Show the pipeline steps, demonstrating how to recreate the pipeline with a function call. +#' @param object (Pipeline) The pipeline object to show +#' @noRd +#' @export +setMethod("show", signature(object = "Pipeline"), function(object) { + fitted <- ifelse(object@fitted, "Fitted", "Unfitted") + cat(fitted, "Pipeline with steps:\n") + cat("Pipeline(\n") + for (i in seq_along(object@steps)) { + step <- object@steps[[i]] + cat(" ", short_description(step)) + if (i < length(object@steps)) { + cat(",") + } + cat("\n") + } + cat(")\n") +}) + +#' Add steps to a pipeline, where the first argument is the pipeline object and the rest are either pipeline steps, or full pipelines to add in order. +#' Requires for every additional step to be a pipeline object. +#' @param x (Pipeline) The PipelineBase object to add steps to. +#' @param ... (PipelineBase) The steps to add to the pipeline. +#' @noRd +#' @export +setMethod("c", signature(x = "Pipeline"), function(x, ...) { + pipelines <- list(...) + steps <- x@steps + for (pipe in pipelines) { + assert_is(pipe, "PipelineBase") + # If the step is a pipeline step, add the single step. Else, the step is a full pipeline and we want to move all the steps over. + if (is(pipe, "PipelineStep")) { + steps <- c(steps, pipe) + } else { + steps <- c(steps, pipe@steps) + } + } +<<<<<<< Updated upstream + +======= +>>>>>>> Stashed changes + # If all the steps are fitted, the pipeline overall is fitted. + # We trust the user to have fitted the pipelines with the same data + new_pipeline <- Pipeline(steps = steps) + check_pipeline_validity(new_pipeline) + fitted <- TRUE + for (step in steps) { + if (!step@fitted) { + fitted <- FALSE + } + } + new_pipeline@fitted <- fitted + return(new_pipeline) +}) + +#' PipelineBase representing a single step within a pipeline +#' @slot step_name (character) Name of the step +#' @slot fitted (logical) Whether the pipeline has been fitted +#' @name PipelineStep +#' @export +setClass("PipelineStep", + contains = "PipelineBase", + slots = list( + step_name = "character" + ), + prototype = list( + step_name = character(0) + ) +) + +#' Create a Pipeline out of pipeline steps. +#' @param x (PipelineStep) The initial pipeline step we want to add to the pipeline +#' @param ... (PipelineBase) The additional pipeline steps to add to the pipeline. These can be either PipelineStep or Pipeline objects. +#' @return A new Pipeline object with the steps added. +#' @noRd +#' @export +setMethod("c", signature(x = "PipelineStep"), function(x, ...) { + pipelines <- list(...) + steps <- list(x) + for (pipe in pipelines) { + assert_is(pipe, "PipelineBase") + if(is(pipe, "PipelineStep")) { + steps <- c(steps, pipe) + } else { + steps <- c(steps, pipe@steps) + } + } + new_pipeline <- Pipeline(steps = steps) + check_pipeline_validity(new_pipeline) + fitted <- TRUE + for (step in steps) { + if (!step@fitted) fitted <- FALSE + } + new_pipeline@fitted <- fitted + return(new_pipeline) +}) + + +setMethod("show", signature(object = "PipelineStep"), function(object) { + cat(short_description(object)) + cat("\n") +}) + + +#' PipelineStep representing an operation that transforms data, and holds fitted parameters +#' @slot step_name (character) Name of the step +#' @slot fitted (logical) Whether the pipeline has been fitted +#' @details Transformers represent single operations (derived from the PipelineStep class) that project data from an IterableMatrix to another IterableMatrix/dgCMatrix. +#' They can be fit to data within an IterableMatrix object, which will be used to hold the fitted parameters. +#' Using the `project()`` method on a fitted transformer will apply the transformation to the data and return +#' the projected data as an IterableMatrix object, or a dgCMatrix. +#' +#' These objects can be combined into a Pipeline object using the `c()` function, with other transformers, or estimators. +#' Transformers can also be combined with full pipelines, to create a new pipeline object. +#' Derived classes should implement the `fit()`, `project()`, and `short_description()` methods. +#' @name Transformer +#' @export +setClass("Transformer", + contains = "PipelineStep" +) + + +#' PipelineStep representing an operation that estimates data, and holds fitted parameters. +#' @slot step_name (character) Name of the step +#' @slot fitted (logical) Whether the pipeline has been fitted +#' @details Estimators represent single operations (derived from the PipelineStep class) that make predictions based on data given by an +#' IterableMatrix. Additionally, supervised estimators will require a target numeric, or character array to be provided during a `fit()` call. +#' Unsupervised estimators, on the other hand, do not require a target array. Following a `fit()` call, the estimator will hold the fitted parameters +#' such that data can be labeled using the `estimate()` method. +#' +#' Estimators can be combined into a Pipeline object using the `c()` function, with other transformers. Estimators are required to be the terminal step +#' within a pipeline. Estimators can also be combined with full pipelines, to create a new pipeline object. +#' Derived classes should implement the `fit()`, `estimate()`, and `short_description()` methods. +#' @name Estimator +#' @export +setClass("Estimator", + contains = "PipelineStep" +) \ No newline at end of file diff --git a/r/man/Estimator.Rd b/r/man/Estimator.Rd new file mode 100644 index 00000000..346fbc83 --- /dev/null +++ b/r/man/Estimator.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/matrix_pipelines.R +\docType{class} +\name{Estimator} +\alias{Estimator} +\title{PipelineStep representing an operation that estimates data, and holds fitted parameters.} +\description{ +PipelineStep representing an operation that estimates data, and holds fitted parameters. +} +\details{ +Estimators represent single operations (derived from the PipelineStep class) that make predictions based on data given by an +IterableMatrix. Additionally, supervised estimators will require a target numeric, or character array to be provided during a \code{fit()} call. +Unsupervised estimators, on the other hand, do not require a target array. Following a \code{fit()} call, the estimator will hold the fitted parameters +such that data can be labeled using the \code{estimate()} method. + +Estimators can be combined into a Pipeline object using the \code{c()} function, with other transformers. Estimators are required to be the terminal step +within a pipeline. Estimators can also be combined with full pipelines, to create a new pipeline object. +Derived classes should implement the \code{fit()}, \code{estimate()}, and \code{short_description()} methods. +} +\section{Slots}{ + +\describe{ +\item{\code{step_name}}{(character) Name of the step} + +\item{\code{fitted}}{(logical) Whether the pipeline has been fitted} +}} + diff --git a/r/man/Pipeline.Rd b/r/man/Pipeline.Rd new file mode 100644 index 00000000..efed722b --- /dev/null +++ b/r/man/Pipeline.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/matrix_pipelines.R +\docType{class} +\name{Pipeline} +\alias{Pipeline} +\title{S4 class for combining multiple pipeline steps into a single pipeline} +\usage{ +Pipeline(steps = list()) +} +\arguments{ +\item{steps}{A list of ordered steps to be executed in the pipeline.} +} +\value{ +A new Pipeline object. +} +\description{ +S4 class for combining multiple pipeline steps into a single pipeline + +Return a new Pipeline object. +} +\details{ +Creating a pipeline object can be done by passing a list of pipeline steps to the constructor. +Creation only expects that all steps make logical sense. i.e., the final step can be either an Estimator or a Transformer, +but each intermediate step cannot be an Estimator. +} +\section{Slots}{ + +\describe{ +\item{\code{steps}}{(list) List of pipeline steps to execute in order} +}} + diff --git a/r/man/PipelineStep.Rd b/r/man/PipelineStep.Rd new file mode 100644 index 00000000..a54db9ae --- /dev/null +++ b/r/man/PipelineStep.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/matrix_pipelines.R +\docType{class} +\name{PipelineStep} +\alias{PipelineStep} +\title{PipelineBase representing a single step within a pipeline} +\description{ +PipelineBase representing a single step within a pipeline +} +\section{Slots}{ + +\describe{ +\item{\code{step_name}}{(character) Name of the step} + +\item{\code{fitted}}{(logical) Whether the pipeline has been fitted} +}} + diff --git a/r/man/Transformer.Rd b/r/man/Transformer.Rd new file mode 100644 index 00000000..ce341fdf --- /dev/null +++ b/r/man/Transformer.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/matrix_pipelines.R +\docType{class} +\name{Transformer} +\alias{Transformer} +\title{PipelineStep representing an operation that transforms data, and holds fitted parameters} +\description{ +PipelineStep representing an operation that transforms data, and holds fitted parameters +} +\details{ +Transformers represent single operations (derived from the PipelineStep class) that project data from an IterableMatrix to another IterableMatrix/dgCMatrix. +They can be fit to data within an IterableMatrix object, which will be used to hold the fitted parameters. +Using the `project()`` method on a fitted transformer will apply the transformation to the data and return +the projected data as an IterableMatrix object, or a dgCMatrix. + +These objects can be combined into a Pipeline object using the \code{c()} function, with other transformers, or estimators. +Transformers can also be combined with full pipelines, to create a new pipeline object. +Derived classes should implement the \code{fit()}, \code{project()}, and \code{short_description()} methods. +} +\section{Slots}{ + +\describe{ +\item{\code{step_name}}{(character) Name of the step} + +\item{\code{fitted}}{(logical) Whether the pipeline has been fitted} +}} + diff --git a/r/man/c-open-paren-PipelineBase-close-paren.Rd b/r/man/c-open-paren-PipelineBase-close-paren.Rd new file mode 100644 index 00000000..09d8b7a7 --- /dev/null +++ b/r/man/c-open-paren-PipelineBase-close-paren.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/matrix_pipelines.R +\name{c(PipelineBase)} +\alias{c(PipelineBase)} +\title{Combine pipeline objects, to create a new pipeline object.} +\usage{ +\S4method{c}{PipelineBase}(x, ...) +} +\arguments{ +\item{x}{(PipelineBase) The pipeline object to combine to.} + +\item{...}{(PipelineBase) The pipeline objects to combine from.} +} +\description{ +Combine pipeline objects, to create a new pipeline object. +} diff --git a/r/man/call_macs_peaks.Rd b/r/man/call_macs_peaks.Rd new file mode 100644 index 00000000..5ad425c5 --- /dev/null +++ b/r/man/call_macs_peaks.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/atac_utils.R +\name{call_macs_peaks} +\alias{call_macs_peaks} +\title{Call peaks using MACS2/3} +\usage{ +call_macs_peaks(...) +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +This function has been renamed to \code{call_peaks_macs()} +} +\keyword{internal} diff --git a/r/man/check_pipeline_validity.Rd b/r/man/check_pipeline_validity.Rd new file mode 100644 index 00000000..4e314773 --- /dev/null +++ b/r/man/check_pipeline_validity.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/matrix_pipelines.R +\name{check_pipeline_validity} +\alias{check_pipeline_validity} +\title{Check if all steps are transformers, with the final step being either an estimator or a transformer} +\usage{ +check_pipeline_validity(object) +} +\arguments{ +\item{object}{(Pipeline) The pipeline object to check} +} +\description{ +Check if all steps are transformers, with the final step being either an estimator or a transformer +} +\keyword{internal} diff --git a/r/man/estimate-open-paren-PipelineBase-IterableMatrix-close-paren.Rd b/r/man/estimate-open-paren-PipelineBase-IterableMatrix-close-paren.Rd new file mode 100644 index 00000000..755e3fba --- /dev/null +++ b/r/man/estimate-open-paren-PipelineBase-IterableMatrix-close-paren.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/matrix_pipelines.R +\name{estimate(PipelineBase,IterableMatrix)} +\alias{estimate(PipelineBase,IterableMatrix)} +\title{Estimate predictions on the output data using a fitted pipeline} +\usage{ +estimate(object, x, ...) +} +\arguments{ +\item{object}{(PipelineBase) The fitted pipeline object. Either the final step is an Estimator, or the pipeline is a single Estimator.} + +\item{x}{(IterableMatrix) Input data to be estimated on} +} +\value{ +Predicted output labels +} +\description{ +Estimate predictions on the output data using a fitted pipeline +} diff --git a/r/man/fit-open-paren-PipelineBase-IterableMatrix-close-paren.Rd b/r/man/fit-open-paren-PipelineBase-IterableMatrix-close-paren.Rd new file mode 100644 index 00000000..c4faf066 --- /dev/null +++ b/r/man/fit-open-paren-PipelineBase-IterableMatrix-close-paren.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/matrix_pipelines.R +\name{fit(PipelineBase,IterableMatrix)} +\alias{fit(PipelineBase,IterableMatrix)} +\title{Fit a pipeline object to data} +\usage{ +fit(object, x, y = NULL, ...) +} +\arguments{ +\item{object}{(PipelineBase) The pipeline object to fit.} + +\item{x}{(IterableMatrix) Input data to be fitted on.} + +\item{y}{Optional output data to be fitted on. Required if the final step is a supervised Estimator, else ignored.} +} +\value{ +The fitted pipeline object. +} +\description{ +Fit a pipeline object to data +} +\details{ +The \code{fit()} method is used to fit a pipeline object to data and a potential label output. Within single estimators, the \code{fit()} method only +takes the input data to be fitted on. Within pipelines, the \code{fit()} method sequentially fits the transformers on each non-terminal step of the pipeline. More specifically, +The input data is transformed by each transformer, and used to fit the next transformer in the pipeline. If the final step is an estimator, the input IterableMatrix +and label (if supervised) are used to fit the estimator. + +The fitted pipeline object is returned, allowing for projection of new data. +} diff --git a/r/man/project-open-paren-PipelineBase-IterableMatrix-close-paren.Rd b/r/man/project-open-paren-PipelineBase-IterableMatrix-close-paren.Rd new file mode 100644 index 00000000..ffa6c5c4 --- /dev/null +++ b/r/man/project-open-paren-PipelineBase-IterableMatrix-close-paren.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/matrix_pipelines.R +\name{project(PipelineBase,IterableMatrix)} +\alias{project(PipelineBase,IterableMatrix)} +\title{Project input data using a fitted pipeline} +\usage{ +project(object, x, ...) +} +\arguments{ +\item{object}{(PipelineBase) A fitted pipeline object} + +\item{x}{(IterableMatrix) Input data to be transformed} +} +\value{ +Data projected by the pipeline +} +\description{ +Project input data using a fitted pipeline +} diff --git a/r/man/write_insertion_bed.Rd b/r/man/write_insertion_bed.Rd index e4e4a664..ad190e13 100644 --- a/r/man/write_insertion_bed.Rd +++ b/r/man/write_insertion_bed.Rd @@ -8,7 +8,7 @@ write_insertion_bed( fragments, path, cell_groups = rlang::rep_along(cellNames(fragments), "all"), - insertion_mode = c("start_only", "both", "end_only"), + insertion_mode = c("both", "start_only", "end_only"), verbose = FALSE, threads = 1 ) diff --git a/r/pkgdown/_pkgdown.yml b/r/pkgdown/_pkgdown.yml index c08f55f0..038b1cdb 100644 --- a/r/pkgdown/_pkgdown.yml +++ b/r/pkgdown/_pkgdown.yml @@ -173,3 +173,22 @@ reference: - discrete_palette - collect_features - rotate_x_labels + + +- title: "Matrix Projections and Predictions" + +- subtitle: "Pipeline S4 Classes" +- desc: Base class for pipeline objects +- contents: + - PipelineStep + - Pipeline + - Transformer + - Estimator + + +- subtitle: "Pipeline Methods" +- contents: + - fit(PipelineBase,IterableMatrix) + - estimate(PipelineBase,IterableMatrix) + - project(PipelineBase,IterableMatrix) + - c(PipelineBase)