generateReadMatrices: Map the reads for each pair of matched ChIP and input files...

Description Usage Arguments Details Value Author(s)

Description

Map the reads for each pair of matched ChIP and input files to a specified set of genomic intervals.

Usage

1
2
3
generateReadMatrices(chipfile, inputfile, input.suffix, target,
  chipformat = "BAM", inputformat = "BAM", fragLen = 150,
  pairedEnd = FALSE, unique = TRUE, ncores = 1)

Arguments

chipfile

A string vector for the ChIP files.

inputfile

A string vector for the matching input files. The length must be the same as 'chipfile'.

input.suffix

A string for the suffix of input files.

target

A RangedData object for the target intervals where the reads are mapped.

chipformat

A vector of strings specifying the type of the ChIP files. Can be a single value if all ChIP files have the same format. Currently two file types are allowed: "BAM" or "BED". Default: "BAM".

inputformat

A vector of strings specifying the type of the input file. Can be a single string if all input files have the same format. Currently two file types are allowed: "BAM" or "BED". Default: "BAM".

fragLen

Either a single value or a 2-column matrix of the fragment lengths for the chip and input files. Default: 150.

pairedEnd

Either a boolean value or a 2-column boolean matrix for whether each file is a paired-end data set. Currently this function only allows "BAM" files for paired-end data. Default: FALSE.

unique

A boolean value for whether only reads with distinct genomic coordinates or strands are mapped. Default: TRUE.

ncores

The number of cores. Default: 1.

Details

This function uses the readGAlignments and readGAlignmentsPaired from the GenomicRanges package to read BAM files. It uses scan function to read the "BED" formatted data, assuming that chr, start, end, strand information are in column 1, 2, 3, 6.
For the input files, read counts from all files with the same prefix are added.

Value

A list of two matrices:

chip A matrix for the number of mapped reads at each target interval (row) from each ChIP file (column).
input A matrix for the number of mapped reads at each target interval(row) from matching input files for the ChIP file (column).
target A GRanges object with sorted elements.
depth A matrix of two columns for the read depths of each ChIP file and its matching input.

Author(s)

Chandler Zuo zuo@stat.wisc.edu


chandlerzuo/mbasic documentation built on May 13, 2019, 3:24 p.m.