scran
C++ library for basic single-cell RNA-seq analyses
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
scran::FilterCells Class Reference

Filter out low-quality cells. More...

#include <FilterCells.hpp>

Classes

struct  Defaults
 Default choices for all parameters. More...
 

Public Member Functions

FilterCellsset_retain ()
 
FilterCellsset_discard (bool d=Defaults::discard)
 
FilterCellsset_intersect (bool i=Defaults::intersect)
 
template<class MAT , typename IDX = int, typename X = uint8_t>
std::shared_ptr< MAT > run (std::shared_ptr< MAT > mat, const X *filter)
 
template<class MAT , typename IDX = int, typename X = uint8_t>
std::shared_ptr< MAT > run (std::shared_ptr< MAT > mat, const std::vector< X * > &filters)
 

Detailed Description

Filter out low-quality cells.

This class removes low-quality cells from the input matrix by subsetting on the columns, typically using the filters defined in PerCellRnaQcFilters and/or PerCellAdtQcFilters. It is effectively a wrapper around the tatami::make_DelayedSubset function.

Member Function Documentation

◆ set_retain()

FilterCells & scran::FilterCells::set_retain ( )
inline

Indicate that the filtering vector specifies the cells to retain.

Returns
A reference to this FilterCells object.

◆ set_discard()

FilterCells & scran::FilterCells::set_discard ( bool  d = Defaults::discard)
inline

Indicate that the filtering vector specifies the cells to discard.

Returns
A reference to this FilterCells object.

◆ set_intersect()

FilterCells & scran::FilterCells::set_intersect ( bool  i = Defaults::intersect)
inline
Parameters
iWhether to take the intersection or union of the filtering vectors, if multiple filtering vectors are supplied.
Returns
A reference to this FilterCells object.

◆ run() [1/2]

template<class MAT , typename IDX = int, typename X = uint8_t>
std::shared_ptr< MAT > scran::FilterCells::run ( std::shared_ptr< MAT >  mat,
const X *  filter 
)
inline

Filter out low-quality cells by subsetting on the columns on the input matrix. This is done in a delayed manner to avoid creating a copy of the matrix - see the DelayedSubset class in the tatami library for details.

Template Parameters
MATA matrix class, typically a tatami::Matrix.
IDXIntegral type to use for the subsetting indices.
XBoolean type for the filtering vector.
Parameters
matPointer to the input matrix to be subsetted.
filterPointer to a filtering vector of length equal to the number of columns in mat.
Returns
A pointer to the submatrix.

◆ run() [2/2]

template<class MAT , typename IDX = int, typename X = uint8_t>
std::shared_ptr< MAT > scran::FilterCells::run ( std::shared_ptr< MAT >  mat,
const std::vector< X * > &  filters 
)
inline

Filter out low-quality cells by subsetting on the columns on the input matrix, taking the intersection or union of multiple filtering vectors according to set_intersect(). The intersection is defined by setting the filtering value to 1 for a cell if the corresponding values across all supplied vectors are also 1, and zero otherwise; the union is defined by setting the filtering value to 1 for a cell if any corresponding value for any supplied vector is 1, and zero otherwise. The actual effect of filtering is determined by set_discard().

Template Parameters
MATA matrix class, typically a tatami::Matrix.
IDXIntegral type to use for the subsetting indices.
XBoolean type for the filtering vector.
Parameters
matPointer to the input matrix to be subsetted.
filtersPointers to filtering vectors. Each vector should be of length equal to the number of columns in mat.
Returns
A pointer to the submatrix.

The documentation for this class was generated from the following file: