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 = "" ) )
})
Run the code above in your browser using DataLab