countReads: Count Reads

Description Usage Arguments Value Author(s) See Also Examples

View source: R/countReads.R

Description

Most Rcade users will not need to call this function directly. Given targets information linking to bam files, count the reads that lie in defined bins.

Usage

1
countReads(annoZone, targets, fileDir=NULL, dontCheckTargets=FALSE)

Arguments

annoZone

GRanges - The bins to be used when counting reads.

targets

data.frame - Targets file (see vignette)

fileDir

character - The directory in which the raw ChIP-seq data files are kept.

dontCheckTargets

logical - If TRUE, the targets file is not checked for consistency/appropriate field names. This should not be changed for Rcade purposes, but may be useful if you wish to obtain bin counts for some other purpose. Make sure relevant column names are lower case. Use at your own risk!

Value

Matrix of read counts, with columns corresponding to samples and rows corresponding to bins.

Author(s)

Jonathan Cairns

See Also

RcadeAnalysis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
	dir <- file.path(system.file("extdata", package="Rcade"), "STAT1")

	targets <- read.csv(file.path(dir, "targets.csv"), as.is = TRUE)

	anno <- read.csv(file.path(dir, "anno.csv"))
	anno <- anno[order(anno$chromosome_name),]
	colnames(anno) <- c("ENSG","chr","start","end","str")
	ChIPannoZones <- defineBins(anno, zone=c(-1500, 1500), geneID="ENSG")

	x <- countReads(ChIPannoZones, targets, fileDir = dir)

Rcade documentation built on Nov. 8, 2020, 6:25 p.m.