Search
Question: R Gviz ideogram custom track
0
gravatar for wd
11 days ago by
wd10
Germany
wd10 wrote:

Hi

I tried the suggestions A: Create custom IdeogramTrack (Gviz) to create an Ideogram fora scaffold my custom genome, but I can't make it work.

My bands dataframe (bands.txt) looks like this:

chrom chromStart chromEnd name gieStain
scaffold_1 1 7801961 test1 gpos25
scaffold_10 1 2993488 test10 gpos25
scaffold_22 1 1387564 test22 gpos25

Then I'm use the following  for ideogram:

bands<-read.delim("bands.txt")
options(ucscChromosomeNames=FALSE)
itrack <- IdeogramTrack(genome="X",chromosome="scaffold_22",name="scaffold_22",bands=bands)

But in my final plot the scaffold does not completely show up (lining of middle part is not there).

See plot here: https://imgur.com/a/oAyFX

Anyone knows how to show the complete scaffold as a bar? If possible, I would also like to remove the word "Chromosome" before "scaffold_22" in the plot.

Any help would be much appreciated.

ADD COMMENTlink modified 11 days ago • written 11 days ago by wd10

Putting this as a comment rather than answer, because I can't explain why it works...

Adding more data to your bands dataframe seems to do the trick:

chrom   chromStart  chromEnd    name    gieStain
scaffold_1  1   7801961     test1   gpos25
scaffold_10     1   2993488     test10  gpos25
scaffold_22     1   480000     test22  gpos1
scaffold_22     480001   490000     test22  gpos1
scaffold_22     490001   1387564     test22  gpos1

bands <- read.table("~/temp.txt", h = T)
options(ucscChromosomeNames=FALSE)
itrack <- IdeogramTrack(genome="X",chromosome="scaffold_22",name="scaffold_22",bands=bands)
plotTracks(itrack, from = 480000, to = 490000)

Note: I changed the gieStain because leaving it with gpos25 created an odd white triangle at the 5' end of the scaffold, again - not sure why.

Regarding removing the word "chromosome" before "scaffold_22" - the ShowId option of the plotTracks function will remove the entire "Chromosome scaffold_22" label - not sure if you can just remove chromosome.

ADD REPLYlink written 11 days ago by Russ Fraser0

Thank you, that worked!

ADD REPLYlink written 10 days ago by wd10

I don't think that the initial band definitions make any sense. Why would you define bands that all start at the same location? Gviz doesn't really check the consistency of the band definition, but rather naively tries to draw polygons. I assume that is what you are seeing. Try defining non-overlappting bands with distinct ranges.

ADD REPLYlink written 10 days ago by florian.hahne@novartis.com1.5k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 183 users visited in the last hour