collapsePairs: Internal CrispRVariants function for collapsing pairs with concordant indels
Description
Given a set of alignments to a target region, finds read pairs.
Compares insertion/deletion locations within pairs using the cigar string.
Pairs with non-identical indels are excluded. Pairs with identical indels are
collapsed to a single read, taking the consensus sequence of the pairs.
A GAlignments object. We do not use GAlignmentPairs because amplicon-seq
can result in pairs in non-standard pairing orientation.
Must include BAM flag, must not include unmapped reads.
use.consensus
Should the consensus sequence be used if pairs have a mismatch?
Setting this to be TRUE makes this function much slower (Default: TRUE)
keep.unpaired
Should unpaired and chimeric reads be included? (Default: TRUE)
verbose
Report statistics on reads kept and excluded
...
Additional items with the same length as alns,
that should be filtered to match alns.
Value
The alignments, with non-concordant pairs removed and concordant pairs
represented by a single read.