Question: deeptools computeMatrix reference-point, want to plot 1kb before TSS and 1kb after TES then use plotHeatmap
gravatar for jennxyzhang
3 months ago by
jennxyzhang0 wrote:

Hello! I am looking to use deeptools plotHeatmap to plot 1kb before and after a gene annotation. Unfortunately I don't think computeMatrix allows me to do this as I can only select one reference-point.

What I tried instead was to run computeMatrix for the 1kb upstream of TSS, and separately run 1kb downstream of TES. But in reference-point mode I must indicate both before and after options, with a minimum of the window size:

        # 1kb upstream of TSS
    computeMatrix reference-point \
    --scoreFileName bigwig/${name}.bw \
    --regionsFileName ref_data/hg19_L.BED \
    --referencePoint TSS --upstream 1000 --downstream 50 \
    --binSize 50 --sortUsing mean \
    --outFileName expression/matrix/${name}_matrix_bTSS.gz

    # 1kb downstream of TES
    computeMatrix reference-point \
    --scoreFileName bigwig/${name}.bw \
    --regionsFileName ref_data/hg19_L.BED \
    --referencePoint TES --upstream 50 --downstream 1000 \
    --binSize 50 --sortUsing mean \
    --outFileName expression/matrix/${name}_matrix_aTES.gz

    # combine 1kb upstream of TSS and 1kb downstream of TES
    computeMatrixOperations cbind \
    -m expression/matrix/${name}_matrix_bTSS.gz expression/matrix/${name}_matrix_aTES.gz \
    -o expression/matrix/${name}_matrix_cbind.gz

Thus my two outputs that I later combine to plot have that trailing 50 bp window. I can gunzip the matrix and remove that 'column' of data for the trailing 50bp, but then the file might not match the heading information:

@{"verbose":true,"scale":1,"skip zeros":false,"nan after end":false,"sort using":"mean","unscaled 5 prime":0,"body":0,"sample_labels":["C1psorted"],"downstream":50,"unscaled 3 prime":0,"group_labels":["genes"],"bin size":50,"upstream":1000,"group_boundaries":[0,1528],"sample_boundaries":[0,21],"missing data as zero":false,"ref point":"TSS","min threshold":null,"sort regions":"keep","proc number":4,"bin avg type":"mean","max threshold":null}

In order to combine the two gzipped files, I used computeMatrixOperations cbind to concatenate the data left to right. But then after plotting using plotHeatmap I still get these data in two separate columns where instead I'd like to see them all in one column.

TLDR; if someone can explain to me how to edit my two matrix outputs in a manner that will allow me to plot a continuous heatmap of 1kb before TSS and 1kb after TES that would be awesome.

Thanks for reading this long question. :'')

ADD COMMENTlink modified 8 weeks ago by Biostar ♦♦ 20 • written 3 months ago by jennxyzhang0

So, do I understand correctly that you want to plot all gene bodies 'as is' (i.e. not scaled to the same size) plus additional bp before the TSS and after the TES? I.e. have you tried out the scale-regions mode and found it lacking? You can see the graphical comparison of the two modes here.

ADD REPLYlink modified 3 months ago • written 3 months ago by Friederike6.3k

I don't want to plot the gene bodies, just the regions before and after, with a little tick to mark the gene is located in the middle. I think there might just be no easy workaround with plotHeatmap so I might just need to plot it myself. :') Thanks

ADD REPLYlink written 3 months ago by jennxyzhang0

I would just set the gene body size to something small, e.g. 5 bp in the scale-region mode

ADD REPLYlink written 3 months ago by Friederike6.3k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 884 users visited in the last hour