bamSummariseByChr: summarise mapping observations from a BAM file by chromosome

Description Usage Arguments Value Examples

View source: R/BamParser.R

Description

This method will parse a BAM file and summarise the mapping observations in a way that can be used for preparation of figures and confidence plots by the nanopoRe package

Usage

1
2
3
4
5
6
bamSummariseByChr(chrId,
    bamFile,
    force = FALSE,
    blockSize = 10000L,
    index=NULL
)

Arguments

chrId

is the chromosome to parse

bamFile

is the location to the BAM file to parse

force

logical value describing whether the analysis should be force recalculated

blockSize

the number of reads to process at the time as iterating through

index

path to the BAI index file - should be automatic in most cases

Value

data.frame of per read summary observations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# load reference genome
init()
referenceFasta <- system.file("extdata",
    "Escherichia_coli_complete_genome.fasta",
    package = "nanopoRe")
setReferenceGenome(referenceFasta)
# load reference BAM
demoBam <- system.file("extdata",
    "Ecoli_zymo_R10_filt_subs.bam",
    package = "nanopoRe")
# Rsamtools::BamFile has problems in picking up packaged .bam.bai
# we will specify it here rather then automatic detection
demoBamIdx <- system.file("extdata",
    "Ecoli_zymo_R10_filt_subs.bam",
    package = "nanopoRe")
bamSummariseByChr(chrId=getChromosomeIds()[1],
    bamFile=demoBam,
    blockSize=100L,
    index=demoBamIdx)

sagrudd/nanopoRe documentation built on June 7, 2020, 10:20 p.m.