findChimeras {CrispRVariants} | R Documentation

## Find chimeric reads

### Description

Find chimeric reads, assuming that the GAlignments object does not contain multimapping reads. That is, read names that appear more than ones in the file are considered chimeras. Chimeric reads are reads that cannot be mapped as a single, linear alignment. Reads from structual rearrangements such as inversions can be mapped as chimeras. Note that the indices of all chimeric reads are returned, these are not separated into individual chimeric sets.

### Usage

    findChimeras(bam, by.flag = FALSE)

### Arguments

`bam` | A GAlignments object, must include names
`by.flag` | Can the chimeras be detected just using the supplementary alignment flag? (Default: FALSE). If TRUE, detects supplementary alignments and returns reads with the same name as a supplementary alignment (quicker). If FALSE, all alignments with duplicated names are returned.

### Value

A vector of indices of chimeric sequences within the original bam

### Author(s)

Helen Lindsay

### See Also

`plotChimeras` for plotting chimeric alignment sets.

### Examples

    bam_fname <- system.file("extdata", "gol_F1_clutch_2_embryo_4_s.bam",
                             package = "CrispRVariants")
    bam <- GenomicAlignments::readGAlignments(bam_fname, use.names = TRUE)
    chimera_indices <- findChimeras(bam)
    chimeras <- bam[chimera_indices]

[Package CrispRVariants version 1.12.0 Index]