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!
Have you considered using bigwigCompare? It's the more typical way of doing this and produces a bigWig file compatible with computeMatrix.
wooow!! thank you so much!