getAdaptorThresholds: Get score thresholds for adaptor alignments

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Compute score thresholds to be used to determine if adaptors are present at the read ends.

Usage

1
getAdaptorThresholds(aligned, error=0.01, number=1e5, BPPARAM=SerialParam())

Arguments

aligned

A DataFrame of adaptor alignment information and read sequences, identical to the output of adaptorAlign.

error

A numeric scalar specifying the acceptable false discovery rate.

number

Integer scalar specifying the number of records to read at once from the FASTQ file, see ?FastqStreamer.

BPPARAM

A BiocParallelParam object specifying whether alignment should be parallelized.

Details

Read sequences (or specifically, the start and end of them, according to the tolerance specified in adaptorAlign) are scrambled, and adaptor alignment is performed against the scrambled sequences. For each adaptor, the scrambled alignment scores represent a null distribution of alignment scores.

We aim to define a score threshold above which the adaptor is considered to be present in the read sequence. This is done by estimating the false discovery rate as the ratio of the number of scrambled scores above the threshold to the number of real alignment scores above the threshold. We choose a threshold such that the false discovery rate is kept below the specified error.

For the sake of speed, the function will only use a randomly sampled subset of reads (specified by number). It is unnecessary to scramble every read in order to compute a satisfactorily precise threshold.

Value

A named list with the following components:

threshold1:

A numeric scalar specifying the alignment score threshold for adaptor 1.

threshold2:

A numeric scalar specifying the alignment score threshold for adaptor 2.

scores1:

A list containing reads, a sorted vector of alignment scores from aligned$adaptor1; and scrambled, a sorted vector of “null” alignment scores for adaptor 1 against a scrambled read sequence.

scores2:

Same as scores1 but for adaptor 2.

Author(s)

Aaron Lun

See Also

adaptorAlign to obtain the initial adaptor alignments.

filterReads to remove low-quality alignments based on this function.

Examples

1
2

florian0512/sarlacc documentation built on May 28, 2019, 8:39 p.m.