Entering edit mode
7.4 years ago
genie66
▴
30
Hi, I am new to R and looking for some help in plotting multiple bed files which may or may not overlap. They do have multiple chromosomes. I found a package called Gviz, where a Chromosome ideogram and genomic region could be plotted. But I am not sure how to load a bed file.
I am aiming to plot plain bed files(chr ,start,stop) to see which regions are overlapping in multiple bed files I have.
From below example code I see they loaded two data sets called cpgislands and genemodel (believe that comes with package), like wise is there a way to load my bed files to plot them?
data(cpgIslands)
atr <- AnnotationTrack(cpgIslands, name="CpG")
gtr <- GenomeAxisTrack()
itr <- IdeogramTrack(genome="mm9", chromosome="chr1")
data(geneModels)
grtr <- GeneRegionTrack(geneModels, name="Gene Model", showId=TRUE)
plotTracks(list(itr, gtr, atr, grtr))
Please help me with this. Thanks.
Hi, thanks for you response. I couldn't do import.bed but
sample1 <- read.table("custom.bed",header = TRUE, sep="\t",stringsAsFactors=FALSE, quote="")worked, but the DataTrack function shows the following error,Error in .fillWithDefaults(range, defaults[missing], args[missing], len = nrow(range)) : The mandatory argument 'NA' is missing with no default. I do not have ranges or other values for each regions. I am aiming to plot plain bed files(chr ,start,stop) to see which regions are overlapping in the multiple bed files I have. Appreciate any help.What happens when you just try running
library(rtrackalyer)? Can you show the output? The rtracklayer package should include theimport.bedfunction, which will allow you to make the correct object with ranges.