ploting HiC data with Sushi
2
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 6 months ago
Palo Alto, CA, USA

Dear all,

 

I am using Sushi in order to plot some of our HiC data. I am reading a matrix of interactions, but I am getting the following error when using plotHic() function. Any help would be very much appreciated. Thank you.

 > y<-read.table("matrix-forR",header=TRUE, row.names=1)

> y[1:3,1:3]
       X0 X200000 X400000
0       0       0       0
200000  0       0       0
400000  0       0       0

chrom = "chr1"
chromstart = 50000000
chromend = 55000000

plotHic(y,chrom,chromstart,chromend)
phic = plotHic(y,chrom,chromstart,chromend)

Error in seq.default(min(vec), max(vec), length.out = num) :
  'from' cannot be NA, NaN or infinite

 

sushi • 1.6k views
ADD COMMENT
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 6 months ago
Palo Alto, CA, USA

Thank you to those that read my email. The problem is solved. However, regarding "sushi" if I may add a new question :

particularly, I would like to display 2 HiC triangle plots (flipped and unflipped i.e. setting up "flip=TRUE" ) in order to allow an easy comparison.

the R code I use is the following (below), however it does not fully work in order to allow a side by side comparison,

any suggestions would be very welcome. thank you,

-- bogdan

---------- the R code ---------------------

chrom            = "chr11"
chromstart       = 500000
chromend         = 5050000

phic1 = plotHic(Sushi_HiC.matrix, chrom,chromstart, chromend, max_y = 20, zrange=c(0,28), palette=SushiColors(7))

phic2 = plotHic(Sushi_HiC.matrix, chrom,chromstart,chromend,max_y = 20, zrange=c(0,28), flip=TRUE, palette=topo.colors)

ADD COMMENT
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 6 months ago
Palo Alto, CA, USA

Many thanks to Doug Phanstiel for the insight. For those that are interested, a possible solution  by using the par(mfrow) command. 

 

# allow for 2 plots

par(mfrow=c(2,1))

 

# set margins

par(mar=c(1,1,1,1))

 

# move the labels closer to the axes

par(mgp=c(3,.5,0))

 

# plot the first  Hi-C plot

phic1 = plotHic(Sushi_HiC.matrix, chrom,chromstart, chromend, max_y = 20, zrange=c(0,28), palette=SushiColors(7))

 

# label the genome

labelgenome(chrom,chromstart,chromend,side=1,n=4,scale="Mb")

 

# plot the sencond  Hi-C plot

phic2 = plotHic(Sushi_HiC.matrix,chrom,chromstart,chromend,max_y = 20, zrange=c(0,28), flip=TRUE, palette=topo.colors)

 

 

ADD COMMENT

Login before adding your answer.

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