Calculate the ratio of H3K4me3 to H3K4me1 using output of deeptools computeMatrix
0
0
Entering edit mode
17 months ago
jia • 0

Hi, everyone´╝ü I have a list of peaks in bed format and bigwig track of H3K4me3 and H3K4me1. I want to calculate the ratio of H3K4me3 to H3K4me1 in regions near these peaks. What came to my mind at first is deeptools computeMatrix. Here is the code:

computeMatrix reference-point \
-S                              H3K4Me1_Kcl_mm10.bw H3K4Me1_Veh_mm10.bw \
                                 H3K4Me3_Kcl_mm10.bw H3K4Me3_Veh_mm10.bw \
                           -R   Increasing.bed  --referencePoint center \
--binSize 1 --skipZeros -a 2000 -b 2000 -p 10 -o matrix_bin_1_ratio_inc.gz

now I have the output matrix of computeMatrix and here is the header of the matrix

@{"upstream":[2000,2000,2000,2000],"downstream":[2000,2000,2000,2000],"body":[0,0,0,0],"bin size":[1,1,1,1],"ref point":["center","center","center","center"],"verbose":false,"bin avg type":"mean","missing data as zero":false,"min threshold":null,"max threshold":null,"scale":1,"skip zeros":true,"nan after end":false,"proc number":10,"sort regions":"keep","sort using":"mean","unscaled 5 prime":[0,0,0,0],"unscaled 3 prime":[0,0,0,0],"group_labels":["genes"],"group_boundaries":[0,3076],"sample_labels":["H3K4Me1_Kcl_mm10","H3K4Me1_Veh_mm10","H3K4Me3_Kcl_mm10","H3K4Me3_Veh_mm10"],"sample_boundaries":[0,4000,8000,12000,16000]}

As I'm not familiar with 'awk' and 'expr' command in bash , I read the matrix in R

inc_raw = read.delim("matrix_bin_1_ratio_inc.gz", skip=1, header=F)
inc =inc_raw[,-c(1:6)]
inc_H3K4Me1=inc[,c(1:8000)]
inc_H3K4Me3=inc[,c(8001:16000)]
inc_ratio=inc_H3K4Me3/inc_H3K4Me1

Then I don't know how to export the 'inc_ratio' to the format like output matrix of computeMatrix because I want to use deeptools plotProfile to show the ratio in the regions. Could anyone give me some help about this? Thanks!

Chip-seq computeMatrix of to H3K4me3 ratio H3K4me1 • 522 views
ADD COMMENT
1
Entering edit mode

Have you considered using bigwigCompare? It's the more typical way of doing this and produces a bigWig file compatible with computeMatrix.

ADD REPLY
0
Entering edit mode

wooow!! thank you so much!

ADD REPLY

Login before adding your answer.

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