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

Description Usage Arguments Value Examples

View source: R/strandSeqFreqTable.R

Description

strandSeqFreqTable – function to process bam files for contiBAIT

Usage

1
2
3
4
strandSeqFreqTable(bamFileList, fieldSep = ".", field = 1, qual = 0,
  rmdup = TRUE, verbose = TRUE, filter = NULL, misorientations = NULL,
  chimeras = 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 ChrTable (GRanges with a meta column titled 'name' determining contig name) to split chromosomes based on locations. If this parameter is NULL (default), a filter table will be automatically generated from the header of the first file in bamFileList.

misorientations

additional file of type ChrTable (GRanges with a meta column titled 'name' determining contig name) with putative misorientation locations. These location's reads are reversed in the regions of filter that they lie within. Product of locateMisorients[[1]]. Default is NULL

chimeras

additional file of type ChrTable (GRanges with a meta column titled 'name' determining contig name) with putative chimeric locations. These location's reads are masked in the regions of filter that they lie within, and are appended to the end of the output file. Product of locateMisorients[[2]]. Default is NULL

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]])

contiBAIT documentation built on Nov. 8, 2020, 5:49 p.m.