Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subset computeMatrix matrix file without computeMatrixOperations #1326

Open
BioLaoXu opened this issue Sep 27, 2024 · 0 comments
Open

subset computeMatrix matrix file without computeMatrixOperations #1326

BioLaoXu opened this issue Sep 27, 2024 · 0 comments

Comments

@BioLaoXu
Copy link

Thanks to the great tools provided by the deeptools development team.

I have obtained a file with the computeMatrix reference-point --referencePoint TSS command, but my TSS result is not very ideal (the input sample is more abundant than the TSS of the IP sample), so I only focus on the TSS distribution of the macs2 identified peak region, reading the official documentation computeMatrixOperations, I found that computeMatrixOperations subset can only filter the sample/strands/value information , So I did filter matrix by myself,I'm not sure if this is feasible, here's my script, I tested it worked and found that there was no error:

##subset matrix
gzip -dc matrix_TSS_2K.gz |sed -r 's/^@/#@/'> matrix_TSS_2K
bedtools intersect -a matrix_TSS_2K -b test_peaks.narrowPeak -wa >matrix_TSS_2K.peak
rawnum=$(tail +2 matrix_TSS_2K|wc -l)
peaknum=$(cat matrix_TSS_2K.peak|wc -l)
cat <(head -1 matrix_TSS_2K|sed -r "s/$rawnum/$peaknum/"|sed -r 's/^#@/@/') matrix_TSS_2K.peak | gzip  > matrix_TSS_2K.peak.gz
##plot
plotHeatmap -m matrix_TSS_2K.peak.gz -out All_TSS_Heatmap.png --colorMap RdYlBu_r
plotProfile -m matrix_TSS_2K.peak.gz  -out All_TSS_Profile.png

matrix_TSS_2K.gz file :generated from computeMatrix reference-point --referencePoint TSS
test_peaks.narrowPeak file :generated from macs2

image

Tool version

computeMatrix 3.5.4 
Python 3.8.16

I wonder if this is feasible,thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant