narrowAlignments {CrispRVariants} | R Documentation

## Narrow a set of aligned reads to a target region

### Description

Aligned reads are narrowed to the target region. In the case of reads with deletions spanning the boundaries of the target, reads are narrowed to the start of the deletion,

### Usage

    narrowAlignments(alns, target, ...)

    ## S4 method for signature 'GAlignments,GRanges'
    narrowAlignments(alns, target, ...,
      reverse.complement, minoverlap = NULL, verbose = FALSE,
      clipping.ops = c("S", "H"), match.ops = c("M", "X", "="))

### Arguments

`alns` | A GAlignments object including a metadata column "seq" containing the sequence
`target` | A GRanges object
`...` | additional arguments
`reverse.complement` | Should the aligned reads be reverse complemented?
`minoverlap` | Minimum overlapping region between alignments and target. If not specified, alignments must span the entire target region. (Default: NULL)
`verbose` | (Default: FALSE)
`clipping.ops` | CIGAR operations corresponding to clipping (Default: c("S","H"))
`match.ops` | CIGAR operations corresponding to a match, i.e. a non-indel position (Default: c("M","X","="))

### Value

The narrowed alignments (GAlignments)

### Author(s)

Helen Lindsay

### Examples

    bam_fname <- system.file("extdata", "gol_F1_clutch_2_embryo_4_s.bam",
                             package = "CrispRVariants")
    bam <- GenomicAlignments::readGAlignments(bam_fname, use.names = TRUE)
    target <- GenomicRanges::GRanges("18", IRanges::IRanges(4647377, 4647399),
              strand = "+")
    narrowAlignments(bam, target, reverse.complement = FALSE)

[Package CrispRVariants version 1.8.0 Index]