make.simple.consensus: Make Simple Consensus

Description Usage Arguments Details Value Author(s) Examples

View source: R/viRome_functions.R View source: R/make.simple.consensus.R

Description

From aligned data read in by read.bam and processed by clip.bam create a consensus sequence

Usage

1
make.simple.consensus(vdf = NULL, reflen = 11703)

Arguments

vdf

A data frame as produced by read.bam and processed by clip.bam. The fields the data.frame absolutely must have are "pos" (left-most position of the alignment on the positive strand) and clipseq (sequence of the aligned read on the positive strand

reflen

The reference length

Details

This is a *very simple* way to calculate the consensus sequence, and in general we recommend other tools, such as samtools, for doing this.

Basically, for each location in the reference, this function counts the most common aligned base. These are then returned as a string. By definition the return is the same length as the reference. Indels not handled.

Value

A string of the consensus

Author(s)

Mick Watson

Examples

1
2
3
4
 ## Not run: infile <- system.file("data/SRR389184_vs_SINV_sorted.bam", package="viRome")
 ## Not run: bam <- read.bam(bamfile=infile, chr="SINV", start=1, end=12000, removeN=TRUE)
 ## Not run: bamc <- clip.bam(bam)
 ## Not run: seq <- make.simple.consensus(bamc)

mw55309/viRome_legacy documentation built on Dec. 21, 2021, 11:05 p.m.