Learn R Programming

CrispRVariants (version 1.0.2)

countDeletions: 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, ...)
"countDeletions"(alns, ..., multi.del = FALSE, del.and.ins = FALSE, del.ops = c("D"))
countInsertions(alns, ...)
"countInsertions"(alns, ..., ins.and.del = FALSE, multi.ins = FALSE, del.ops = c("D"))
countIndels(alns)
"countIndels"(alns)
indelPercent(alns)
"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 insertionindelPercent: The percentage of reads containing an insertion or deletion (numeric)

Examples

Run this code
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)

Run the code above in your browser using DataLab