amplicanConsensus {amplican} | R Documentation

## Extract consensus out of forward and reverse events.

### Description

When forward and reverse reads are in agreement on the events (eg. deletion) `amplicanConsensus` will mark forward event as TRUE indicating that he represents consensus. In cases where forward and reverse read agree only partially, for example, they share the same start of the deletion, but they have different end `amplicanConsensus` will pick the version of read with higher alignment score, in situation where both of the reads overlap expected cut site, otherwise both events will be rejected and marked FALSE. When there are events only on one of the strands they will be rejected.

### Usage

    amplicanConsensus(aln, cfgT, overlaps = "overlaps", promiscuous = TRUE)

### Arguments

`aln` | (data.frame) Contains relevant events in GRanges style.
`cfgT` | (data.frame) Should be table containing at least positions of primers in the amplicons and their identifiers
`overlaps` | (character) Specifies which metadata column of `aln` indicates which events are overlapping expected cut site.
`promiscuous` | (boolean) Allows to relax consensus rules. When TRUE will allow Indels that are not confirmed by the other strand (when both are used).

### Details

In situation where you have only forward or only reverse reads don't use this function and assign all TRUE to all of your events.

Consensus out of the forward + reverse reads is required for `amplicanSummary`, and `amplicanConsensus` requires `amplicanOverlap`.

### Value

(bolean vector) Where TRUE means that given event represents consensus out of forward and reverse reads.

### See Also

Other analysis steps: `amplicanAlign()`, `amplicanFilter()`, `amplicanMap()`, `amplicanNormalize()`, `amplicanOverlap()`, `amplicanPipelineConservative()`, `amplicanPipeline()`, `amplicanReport()`, `amplicanSummarize()`

### Examples

    file_path <- system.file("test_data", "test_aln.csv", package = "amplican")
    aln <- data.table::fread(file_path)
    cfgT <- data.table::fread(
      system.file("test_data", "test_cfg.csv", package = "amplican"))
    all(aln$consensus == amplicanConsensus(aln, cfgT))

[Package amplican version 1.16.0 Index]