macs <- system.file("extdata", "MACS_peaks.xls", package="ChIPpeakAnno")
macsOutput <- toGRanges(macs, format="MACS")
if(interactive()){
## MACS connection
macs <- readLines(macs)
macs <- textConnection(macs)
macsOutput <- toGRanges(macs, format="MACS")
## bed
toGRanges(system.file("extdata", "MACS_output.bed", package="ChIPpeakAnno"),
format="BED")
## narrowPeak
toGRanges(system.file("extdata", "peaks.narrowPeak", package="ChIPpeakAnno"),
format="narrowPeak")
## broadPeak
toGRanges(system.file("extdata", "TAF.broadPeak", package="ChIPpeakAnno"),
format="broadPeak")
## MACS2
toGRanges(system.file("extdata", "MACS2_peaks.xls", package="ChIPpeakAnno"),
format="MACS2")
## GFF
toGRanges(system.file("extdata", "GFF_peaks.gff", package="ChIPpeakAnno"),
format="GFF")
## EnsDb
library(EnsDb.Hsapiens.v75)
toGRanges(EnsDb.Hsapiens.v75, feature="gene")
## TxDb
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
toGRanges(TxDb.Hsapiens.UCSC.hg19.knownGene, feature="gene")
## data.frame
macs <- system.file("extdata", "MACS_peaks.xls", package="ChIPpeakAnno")
macs <- read.delim(macs, comment.char="#")
toGRanges(macs)
}
Run the code above in your browser using DataLab