readBinFile: Read the bin-level text files containing ChIP and input...

Description Usage Arguments Value Note Author(s) Examples

Description

Read the bin-level text files containing ChIP and input sample counts as well as M and GC scores.

Usage

1
readBinFile(type = c("chip", "input", "M", "GC"), fileName)

Arguments

type

A character vector indicating data types to be imported. This vector can contain "chip" (ChIP data), "input" (input data), "M" (mappability score), "GC" (GC content score). Default: c("chip","input","M","GC").

fileName

A character vector of file names, each of which matches each element of "type". "type" and "fileName". This vector should have the same length with "type" and corresponding elements in two vectors should appear in the same order.

Value

A data.frame of the processed bin files, containing ChIP, input, M and GC in different columns.

Note

"chip","input" and "M" files are all mandatory. "GC" file is optional.

Author(s)

Chandler Zuozuo@stat.wisc.edu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data( bindata.chr1 )
pwd <- getwd()
local({
setwd( tempdir() )
on.exit( setwd( pwd ) )
write.table( bindata.chr1[,c(1,4)], file = "chr1_map.txt", sep = "\t",
row.names = FALSE, col.names = FALSE )
write.table( bindata.chr1[,c(1,5)], file = "chr1_gc.txt", sep = "\t",
row.names = FALSE, col.names = FALSE )
write.table( bindata.chr1[,c(1,2)], file = "chr1_chip.txt", sep = "\t",
row.names = FALSE, col.names = FALSE )
write.table( bindata.chr1[,c(1,3)], file = "chr1_input.txt", sep = "\t",
row.names = FALSE, col.names = FALSE )
readBinFile( fileName = c("chr1_chip.txt", "chr1_input.txt", "chr1_map.txt",
"chr1_gc.txt" ) )
file.remove( paste( "chr1_", c( "chip", "input", "map", "gc" ), ".txt", sep = "" ) )
})

chandlerzuo/cssp documentation built on May 13, 2019, 3:23 p.m.