qualityAlign: Perform quality-based alignment

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

View source: R/qualityAlign.R

Description

Align a quality-based sequence to a known reference.

Usage

1
2
qualityAlign(sequences, reference, gapOpening=5, gapExtension=1, 
    edit.only=FALSE, BPPARAM=SerialParam())

Arguments

sequences

A QualityScaledDNAStringSet of observed barcode sequences, usually one of the subsequences from adaptorAlign.

reference

A character vector or DNAStringSet containing the reference sequence.

gapOpening

A numeric scalar specifying the gap opening penalty.

gapExtension

A numeric scalar specifying the gap extension penalty.

edit.only

Logical scalar specifying whether the edit distances should be reported without alignment strings.

BPPARAM

A BiocParallelParam object specifying whether alignment should be parallelized.

Details

This provides an alternative to quality-aware alignment with pairwiseAlignment when one of the sequences is known.

Value

A DataFrame containing:

score:

Numeric, the alignment score to the assigned barcode.

edit:

Integer, the edit distance of the alignment.

reference:

Character, the alignment string for the reference sequence. Only reported when edit.only=FALSE.

sequence:

Character, the alignment string for each query sequence. Only reported when edit.only=FALSE.

Each row corresponds to an entry in sequences.

Author(s)

Aaron Lun

See Also

barcodeAlign and adaptorAlign, which operate on similar principles.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ref <- "CAGCTGGACGATCAGCTCGATGCGACTGTGTGCATCG"
queries <- c("CAGGACGATCAGCTCGACGACTAGTGTGCATCGA",
    "CCTAAAGGACGATCAGCTCGATCTGTGTGCATCAAGA")

# Adding some qualities.
qquals <- lapply(nchar(queries), runif)
qquals <- do.call(c, lapply(qquals, as, "PhredQuality"))
queries <- QualityScaledDNAStringSet(queries, qquals)

# Assigning reads to individual barcodes.
align <- qualityAlign(queries, ref)

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