getBamInputReadCount: getBamInputReadCount

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Fetch the number of input reads from bam files

Usage

1

Arguments

bamFiles

The filenames of input bam files.

Details

This function reads the header of bam files and searches for the comment line "INPUTREADCOUNT", which can be added by addInputReadCounts.

Value

The number of input reads are returned. If the "INPUTREADCOUNT" doesn't exist, NA is returned.

Author(s)

Ge Tan

See Also

addInputReadCounts

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  ## Not run: 
  ## This example is not tested because it requires external software "samtools"
  bamfile <- system.file("extdata", "ex1.bam", package="Rsamtools",
                         mustWork=TRUE)
  tempBamFile <- tempfile(fileext=".bam")
  file.copy(bamfile, tempBamFile)
  reads1 <- file.path(system.file("extdata", package="NGS"), "fastq",
                    "nanocage_ACAGAT_carp_embryo_R1.fastq")
  addInputReadCounts(bamFiles=tempBamFile, reads1s=reads1, binary="samtools")
  
  getBamInputReadCount(tempBamFile)
  file.remove(tempBamFile)
  
## End(Not run)

ge11232002/NGS documentation built on May 17, 2019, 12:13 a.m.