BASiCS_Filter {BASiCS} | R Documentation

## Filter for input datasets

### Description

`BASiCS_Filter` indicates which transcripts and cells pass a pre-defined inclusion criteria. The output of this function used to generate a `SingleCellExperiment` object required to run BASiCS. For more systematic tools for quality control, please refer to the `scater` Bioconductor package.

### Usage

    BASiCS_Filter(
      Counts,
      Tech = rep(FALSE, nrow(Counts)),
      SpikeInput = NULL,
      BatchInfo = NULL,
      MinTotalCountsPerCell = 2,
      MinTotalCountsPerGene = 2,
      MinCellsWithExpression = 2,
      MinAvCountsPerCellsWithExpression = 2
    )

### Arguments

`Counts` | Matrix of dimensions `q` times `n` whose elements corresponds to the simulated expression counts. First `q.bio` rows correspond to biological genes. Last `q-q.bio` rows correspond to technical spike-in genes.
`Tech` | Logical vector of length `q`. If `Tech = FALSE` the gene is biological; otherwise the gene is spike-in.
`SpikeInput` | Vector of length `q-q.bio` whose elements indicate the simulated input concentrations for the spike-in genes.
`BatchInfo` | Vector of length `n` whose elements indicate batch information. Not required if a single batch is present on the data. Default: `BatchInfo = NULL`.
`MinTotalCountsPerCell` | Minimum value of total expression counts required per cell (biological and technical). Default: `MinTotalCountsPerCell = 2`.
`MinTotalCountsPerGene` | Minimum value of total expression counts required per transcript (biological and technical). Default: `MinTotalCountsPerGene = 2`.
`MinCellsWithExpression` | Minimum number of cells where expression must be detected (positive count). Criteria applied to each transcript. Default: `MinCellsWithExpression = 2`.
`MinAvCountsPerCellsWithExpression` | Minimum average number of counts per cells where expression is detected. Criteria applied to each transcript. Default value: `MinAvCountsPerCellsWithExpression = 2`.

### Value

A list of 2 elements

`Counts`

  Filtered matrix of expression counts

`Tech`

  Filtered vector of spike-in indicators

`SpikeInput`

  Filtered vector of spike-in genes input molecules

`BatchInfo`

  Filtered vector of the 'BatchInfo' argument

`IncludeGenes`

  Inclusion indicators for transcripts

`IncludeCells`

  Inclusion indicators for cells

### Author(s)

Catalina A. Vallejos cnvallej@uc.cl

### Examples

    set.seed(1)
    Counts <- matrix(rpois(50*10, 2), ncol = 10)
    rownames(Counts) <- c(paste0('Gene', 1:40), paste0('Spike', 1:10))
    Tech <- c(rep(FALSE,40),rep(TRUE,10))
    set.seed(2)
    SpikeInput <- rgamma(10,1,1)
    SpikeInfo <- data.frame('SpikeID' = paste0('Spike', 1:10),
                            'SpikeInput' = SpikeInput)

    Filter <- BASiCS_Filter(Counts, Tech, SpikeInput,
                            MinTotalCountsPerCell = 2,
                            MinTotalCountsPerGene = 2,
                            MinCellsWithExpression = 2,
                            MinAvCountsPerCellsWithExpression = 2)
    SpikeInfoFilter <- SpikeInfo[SpikeInfo$SpikeID %in% rownames(Filter$Counts),]

[Package BASiCS version 2.6.0 Index]