R/coord.to.granges.R

Defines functions .gff.to.GRanges .bed.to.GRanges

Documented in .bed.to.GRanges .gff.to.GRanges

# Function to import a bedfile/gfffile and put the information into a GRange

.bed.to.GRanges <- function(bedfile, ...) {
    # create conexion to the file with TSS coordinates (in Bed format)
    con <- file(bedfile,open="r")
    grFromBed <- import(con, "BED", trackLine = FALSE)
    # close conexion to the file
    on.exit(close(con))
    # Coerce into a data frame
    grDF <- as.data.frame(grFromBed)
}

.gff.to.GRanges <- function(gffFile, ...) {
    # create conexion to the file with TSS coordinates (in GFF format)
    con <- file(gffFile,open="r")
    grFromGFF <- import(con, "GFF")
    # close conexion to the file
    on.exit(close(con))
    # Coerce into a data frame
    grDF <- as.data.frame(grFromGFF)
} 

Try the CoverageView package in your browser

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

CoverageView documentation built on Nov. 8, 2020, 7:52 p.m.