bc_seq_filter: Remove low quality sequence

Description Usage Arguments Value Examples

Description

Remove low quality sequences by base-pair quality, sequence length or unknown base "N".

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
bc_seq_filter(
  x,
  min_average_quality = 30,
  min_read_length = 0,
  N_threshold = 0,
  sample_name = ""
)

## S4 method for signature 'ShortReadQ'
bc_seq_filter(
  x,
  min_average_quality = 30,
  min_read_length = 0,
  N_threshold = 0
)

## S4 method for signature 'DNAStringSet'
bc_seq_filter(x, min_read_length = 0, N_threshold = 0)

## S4 method for signature 'data.frame'
bc_seq_filter(x, min_read_length = 0, N_threshold = 0)

## S4 method for signature 'character'
bc_seq_filter(
  x,
  min_average_quality = 30,
  min_read_length = 0,
  N_threshold = 0,
  sample_name = basename(x)
)

## S4 method for signature 'integer'
bc_seq_filter(x, min_read_length = 0, N_threshold = 0)

## S4 method for signature 'list'
bc_seq_filter(
  x,
  min_average_quality = 30,
  min_read_length = 0,
  N_threshold = 0,
  sample_name = names(x)
)

Arguments

x

A single or a list of Fastq file, ShortReadQ, DNAStringSet, data.frame, integer vector.

min_average_quality

A numeric or a vector of numeric, specifying the threshold of the minimum average base quality of a sequence to be kept.

min_read_length

A single or a vector of integer, specifying the sequence length threshold.

N_threshold

A integer or a vector of integer, specifying the maximum N can be in a sequence.

sample_name

A string vector, specifying the sample name in the output.

Value

A ShortReadQ or DNAStringSet object with sequences passed the filters.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(ShortRead)

fq_file <- system.file("extdata", "simple.fq", package="CellBarcode")

# apply filter to fastq files
bc_seq_filter(fq_file)

# read in fastq files to get ShortReadQ object
sr <- readFastq(fq_file[1])
# apply sequencing quality filter to ShortReadQ
bc_seq_filter(sr)

# get DNAStringSet object
ds <- sread(sr)
# apply sequencing quality filter to DNAStringSet
bc_seq_filter(ds)

###

wenjie1991/CellBarocde documentation built on Dec. 23, 2021, 5:11 p.m.