constructBedRanges: constructBedRanges

View source: R/utilities.R

constructBedRangesR Documentation

constructBedRanges

Description

Constructs a GRanges object from a bam/bed/bed.zip file in a consistent way.

Usage

constructBedRanges(
  filename,
  filetype = c("bam", "bed", "bed.zip", "narrow", "broad"),
  genomeName = NULL,
  onlyStdChrs = FALSE,
  arePeaks = FALSE,
  verbose = FALSE
)

Arguments

filename

the complete file path of a bam?bed file.

filetype

the file type bam/bed/bed.zip/narrow/broad.

genomeName

the name of the genome used to map the reads (i.e. "mm9"). N.B. if NOT NULL the GRanges Seqinfo will be forced to genomeName Seqinfo (needs Internet access, but strongly suggested!)

onlyStdChrs

flag to keep only standard chromosome.

arePeaks

flag indicating if the file contains peaks.

verbose

flag to obtain verbose output.

Value

a GRanges object.

Examples

files <- list.files(system.file("extdata/bam/", package="DEScan2"),
                    pattern="bam$", full.names=TRUE)
bgr <- constructBedRanges(files[1], filetype="bam", genomeName="mm9",
                            onlyStdChrs=TRUE)
bgr

drighelli/DEScan2 documentation built on March 21, 2023, 3:06 p.m.