Entering edit mode
I have to make the chromosome name to "4" rather "chr4" because my dataTrack 's chromosome names are numbers without "chr". I read the tutorial, and did the following, but it did not work. Thank you for your help.
Ming
options(ucscChromosomeNames=FALSE) itrack<- IdeogramTrack(genome = "hg19", chromosome = 4) Error in .local(.Object, ...) : Chromosome '4' does not exist on UCSC genome 'hg19'
Thanks for your answer. I know that it is build on UCSC. The problem is that my data track's chromosome name is only numbers,
when I plot my dataTrack and the IdeogramTrack together, it complains that the chromosomes are different....
I see, in that case the fastest fix can be something like this:
This would remove the "chr" from the original chromosome names in the
IdeogramTrack
.However I noticed that you are using current version of the biomart which is for human genome using the GRCh38.p3 but you built
IdeogramTrack
from older genome version from UCSC (hg19). Maybe it is safer to use the same one?Here is example code which shows also dummy data track on chromosome 4.
library(Gviz) options(ucscChromosomeNames=FALSE) itrack <- IdeogramTrack(genome = "hg38", chromosome = "chr4") levels(itrack@bandTable$chrom) <- sub("^chr", "", levels(itrack@bandTable$chrom), ignore.case=T) dtrack <- DataTrack(range=GRanges("4", IRanges(45.5e6, width=1), e=100)) plotTracks(list(itrack,dtrack), from=45e6, to=46e6, chromosome="4")
Thank you for the answer! I am aware that biomart is using the newest genome build, and I will have to use an older version of biomart database when I put the IdeogramTrack from hg19 together.
it worked for your example. But when i feed into a bam file. it still complains. any ideas why?
I figured it out that I have to do this also to make it work: