R Gviz ideogram custom track
0
0
Entering edit mode
wd ▴ 30
@wd-7410
Last seen 18 months ago
Germany

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.

Gviz ideogram track custom genome R • 1.1k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

Thank you, that worked!

ADD REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 318 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6