countDeletions {CrispRVariants} | R Documentation

## Count the number of reads containing an insertion or deletion

### Description

Counts the number of reads containing a deletion or insertion (indel) of any size in a set of aligned reads. For countDeletions and countInsertions Reads may be filtered according to whether they contain more than one indel of the same or different types.

### Usage

    countDeletions(alns, ...)

    ## S4 method for signature 'GAlignments'
    countDeletions(alns, ..., multi.del = FALSE,
      del.and.ins = FALSE, del.ops = c("D"))

    countInsertions(alns, ...)

    ## S4 method for signature 'GAlignments'
    countInsertions(alns, ..., ins.and.del = FALSE,
      multi.ins = FALSE, del.ops = c("D"))

    countIndels(alns)

    ## S4 method for signature 'GAlignments'
    countIndels(alns)

    indelPercent(alns)

    ## S4 method for signature 'GAlignments'
    indelPercent(alns)

### Arguments

`alns` | The aligned reads
`...` | extra arguments
`multi.del` | If TRUE, returns the exact number of deletions, i.e., if one read contains 2 deletions, it contributes 2 to the total count (default: FALSE)
`del.and.ins` | If TRUE, counts deletions regardless of whether reads also contain insertions. If FALSE, counts reads that contain deletions but not insertions (default: FALSE)
`del.ops` | Cigar operations counted as deletions. Default: c("D")
`ins.and.del` | If TRUE, counts insertions regardless of whether reads also contain deletions If FALSE, counts reads that contain insertions but not deletions (default: FALSE)
`multi.ins` | If TRUE, returns the exact number of insertions, i.e., if one read contains 2 insertions, it contributes 2 to the total count (default: FALSE)

### Value

countDeletions: The number of reads containing a deletion (integer)

countInsertions: The number of reads containing an insertion (integer)

countIndels: The number of reads containing at least one insertion

indelPercent: The percentage of reads containing an insertion or deletion (numeric)

### 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)
    countDeletions(bam)
    countInsertions(bam)
    countIndels(bam)
    indelPercent(bam)

[Package CrispRVariants version 1.14.0 Index]