strandSeqFreqTable – function to process bam files for contiBAIT

Share:

Description

strandSeqFreqTable – function to process bam files for contiBAIT

Usage

1
2
3
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#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]])

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.