gviz: DataTrack: histogram like barplot baseline changed to most negative values when all score is negative
1
0
Entering edit mode
wenhuo hu ▴ 200
@wenhuo-hu-5208
Last seen 3.6 years ago
United States

I am plotting by Gviz pacckage. I need to get a barplot for a range, for example, from chr1:1-100, with value/score 40, I will need a bar with the hight of 40. It works by choosing type='histogram' when the value is positive. It also works when there are scores mixed with positive and negative values. But when there are all negative scores, the base line changes to the most negative value, for example chr1:1-100 with value -20, and chr1:200-300 with value -50, the base line is -50, the bar is from -50 to -20, and from -50 to 0 respectively. While I need them still from 0 to -20, and from 0 to -50. 

Any suggestion?

gviz • 418 views
ADD COMMENT
0
Entering edit mode
Robert Ivanek ▴ 710
@robert-ivanek-5892
Last seen 4 hours ago
Switzerland

You can set the y-axis limits.

library(Gviz)
dt <- DataTrack(GRanges("chr1", IRanges(1:100,1:100), value=sample(-c(20,50), 100, replace=T)))
plotTracks(dt, type="histogram", ylim=c(-50,0))

 

ADD COMMENT

Login before adding your answer.

Traffic: 502 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