Knowledge base

Sushi package draws HiC interactive diagram

Introduction

The HiC interaction matrix is the interaction score between two positions on the genome. The HiC interaction graph can display the HiC interaction matrix. It can be implemented in the SuShi package through the plotHic function.

Code explanation

Input

HiC interaction matrix

Sushi_HiC.matrix[100:105,100:105]

As follows

         4460000 4500000 4540000 4580000 4620000 4660000
4460000 60.758775 18.84723 33.31506 22.56641 7.926361 10.69235
4500000 18.847231 32.56282 36.31212 29.04343 13.375643 12.67360
4540000 33.315060 36.31212 17.97024 43.43753 20.411952 16.98875
4580000 22.566409 29.04343 43.43753 38.93754 25.206417 23.87764
4620000 7.926361 13.37564 20.41195 25.20642 9.201501 38.33665
4660000 10.692351 12.67360 16.98875 23.87764 38.336646 22.55054
Code example
library('Sushi')  # Load Sushi包

Sushi_data = data(package ='Sushi') # List Sushi own data
data(list = Sushi_data$results[,3]) # Load data

chrom = "chr11"
chromstart = 500000
chromend = 5050000

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

# Add legend
addlegend(phic[[1]], palette=phic[[2]], title="score", side="right",
bottominset=0.4, topinset=0, xoffset=-.035, labelside="left",
width=0.025, title.offset=0.035)

# Add location notes
labelgenome(chrom, chromstart, chromend, n=4, scale="Mb",
edgeblankfraction=0.20)


The palette changes the color of the color palette, flip = TRUE can flip the image upside down, addlegend can adjust the position of the legend display by changing the side parameter, the lebelside parameter adjusts the label in the legend display position, and the side parameter of labelgenome adjusts the display position of the coordinate position.

chrom = "chr11"
chromstart = 500000
chromend = 5050000

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

addlegend(phic[[1]],palette=phic[[2]],title="score",side="left",bottominset=0.1,
topinset=0.5,xoffset=-.035,labelside="right",width=0.025,title.offset=0.035)

labelgenome(chrom,chromstart,chromend,side=3,n=4,scale="Mb",edgeblankfraction=0.20)

Reference

https://www.bioconductor.org/packages/release/bioc/vignettes/Sushi/inst/doc/Sushi.pdf

Leave a Reply

Your email address will not be published. Required fields are marked *