% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/strandSeqFreqTable.R
\name{strandSeqFreqTable}
\alias{strandSeqFreqTable}
\title{strandSeqFreqTable -- function to process bam files for contiBAIT}
\usage{
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{
\item{bamFileList}{vector containing the location of the bams file to be read}

\item{fieldSep}{The field seperator of the bam file to use to define the field. Default is '.'}

\item{field}{The field of the bam file name to use as an index (default is 1)}

\item{qual}{Mapping quality threshold. Default is 0}

\item{rmdup}{remove duplicates in output file. Default is TRUE}

\item{verbose}{prints messages to the terminal (default is TRUE)}

\item{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.}

\item{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}

\item{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}

\item{tileChunk}{Number of reads to split bam files into (smaller number requires less RAM). Default is 100000.}

\item{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}

\item{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
}
\description{
strandSeqFreqTable -- function to process bam files for contiBAIT
}
\examples{
#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]])

}
