Learn R Programming

contiBAIT (version 1.0.0)

strandSeqFreqTable: strandSeqFreqTable -- function to process bam files for contiBAIT

Description

strandSeqFreqTable -- function to process bam files for contiBAIT

Usage

strandSeqFreqTable(bamFileList, fieldSep = ".", field = 1, qual = 0,
  rmdup = TRUE, verbose = TRUE, filter = NULL, tileChunk = 1e+05,
  pairedEnd = TRUE, BAITtables = FALSE)

Arguments

bamFileList
vector containing the location of the bams file to be read
fieldSep
The field seperator of the bam file to use to define the field. Default is '.'
field
The field of the bam file name to use as an index (default is 1)
qual
Mapping quality threshold. Default is 0
rmdup
remove duplicates in output file. Default is TRUE
verbose
prints messages to the terminal (default is TRUE)
filter
additional file of type GRanges (with a meta column titled 'name' determining contig name) to split chromosomes based on locations. If this parameter is blank, a filter table will be automatically generated from the header of the first file in bamFileList.
tileChunk
Number of reads to split bam files into (smaller number requires less RAM). Default is 100000.
pairedEnd
Whether the bam files being read are in paired end format. Default is TRUE. Note, since paired reads will be the same direction, only first mate read of pair is used in output
BAITtables
creates additional matrices in the returned list with just Watson and Crick read counts to be used in downstreat BAIT plotting. Default is FALSE

Value

  • a list containing two matrices: a StrandFreqMatrix of W:C read frequencies, and a StrandReadMatrix of read counts

Examples

Run this code
#Get a list of BAM files containing libraries for cells from the same organism, aligned to the same genome
#In this case these are the example BAM files provided with the package (hence the call to system.file);

example.dir <- file.path(system.file(package='contiBAIT'), 'extdata')
bam.files <- dir(example.dir, full.names=TRUE)

strand.freq <- strandSeqFreqTable(bam.files, pairedEnd = FALSE)

show(strand.freq[[1]])
show(strand.freq[[2]])

Run the code above in your browser using DataLab