seqsToAln: Creates a text alignment from a set of cigar strings

Description Usage Arguments Value Author(s)

View source: R/seqsToAln.R

Description

Creates a one-to-one text alignment of a set of cigar strings with respect to the reference sequence by collapsing insertions and introducing gaps across deletions.

When genomic coordinates for the alignment start and the target region are provided, aligned sequences are cropped to the target region

Given a character vector of pairwise alignments and a region to display, trims alignments to the display regions, joined by a separator "join". Alignments should be equal length, e.g. created by seqsToAln

Usage

1
2
3
4
5
seqsToAln(cigar, dnaseq, target, del_char = "-", aln_start = NULL,
  reverse_complement = FALSE, allow_partial = FALSE)

selectAlnRegions(alns, reference, target, keep, join = "/ %s /",
  border.gaps = FALSE)

Arguments

cigar

A list of cigar strings to align

dnaseq

The set of sequences corresponding to the cigars, as Biostrings::DNAStrings

target

The target region to return, as GRanges. Sequences overlapping the target region are trimmed to exactly match it.

del_char

The character to represent deleted bases. Default "-"

aln_start

Genomic start locations of aligned sequences. Should be used in conjunction with target_start and target_end.

reverse_complement

(Default: FALSE)

allow_partial

Are alignments that do not span the target region allowed? (Default: FALSE)

alns

Character vector of pairwise alignments, with insertions removed

reference

Reference sequence

keep

Region to display, relative to the target region, i.e. not genomic coords (IRanges or GRanges)

join

character(1) String used for joining alignment segments. Can accept a placeholder to fill in the number of bases deleted with " deleted

border.gaps

(logical(1)) Should bases deleted from the borders be shown? (Default: FALSE)

Value

The sequences with insertions collapsed and deletions padded

A list of the truncated alignments (alns) and reference (ref)

Author(s)

Helen Lindsay

Helen Lindsay


CrispRVariants documentation built on Nov. 8, 2020, 11:09 p.m.