R/readBed.R

Defines functions readBed

Documented in readBed

readBed <-
function(bed.file=NULL) {
    if(is.null(bed.file)) bed.file <- file.choose()
    cat("Reading", bed.file , "...\n")
    bed.header <- readLines(bed.file, n=10)
    bed.start <- min(grep("chr", bed.header))
    bed.table <- read.table(bed.file, skip=bed.start-1, header=FALSE, sep="\t")
    colnames(bed.table)[1:3] <- c("chrom", "chromStart", "chromEnd")
    return(bed.table)
}

Try the ionflows package in your browser

Any scripts or data that you put into this service are public.

ionflows documentation built on May 2, 2019, 3:08 p.m.