plot a smoth TSS profile in R
1
1
Entering edit mode
7.3 years ago
Lila M ★ 1.2k

Hi everybody! I've plot a TSS profile using deepTool as:

computeMatrix reference-point --referencePoint TSS --beforeRegionStartLength 500 --afterRegionStartLength 2000 -R tss -S sample1 sample2 sample3 -bl DACblacklist.bed.gz --skipZeros -o matrix_TSS.gz

plotProfile --matrixFile matrix_TSS.gz --outFileSortedRegions sort --averageType mean --yAxisLabel Mean_Coverage --perGroup --outFileName TSS_scale_profile

The plot is prety good, but I want to processing and smoothing it in R. My problem is that I don't know the colnames that deepTools uses for plot it, and I don't know what is the best way to load and edit the peaks.

Any suggestion please?

Best

ChIP-Seq R • 3.8k views
ADD COMMENT
2
Entering edit mode
7.3 years ago

You presumably want to process the final results that plotProfile is plotting, in which case add the --outFileNameData something.tsv option and load that into R (set colnames=F when you load the data, since columns are bins, rows are samples or groups). You can then reprocess and replot things as desired.

ADD COMMENT
0
Entering edit mode

Thank you very much Devon. I don't know how to reprocess it, because I have 5 rows (bin labels, bins and one row per sample). I'm not very familiarised with this format, could you please give me an extensive example of the script? Thank you!

ADD REPLY
2
Entering edit mode

I'd probably do something like the following in R:

d = read.delim("something.tsv", header=F, skip=2)
d2 = as.data.frame(t(as.matrix(d[,-c(1,2)])))
colnames(d2) = d[,1]
d2$sample = rep(c("sample1", "sample2", "sample3"), each=250)
d2$bin = rep(c(1:250), 250)

Then you have a dataframe with the columns denoting each group and bins and samples labeled. You can further tidy this if you prefer. Note that I'm just typing the above by eye, so there's probably a typo or two.

ADD REPLY
1
Entering edit mode

Thank you, I've plotted the samples and bins, and the plot is exactly the same as that one reported in deepTools. I've also smoothed it in R, but there a huge difference between them, and I think that I'm missing information. Do you know if is there another approach for a slight smooth method?

Thank you

ADD REPLY
2
Entering edit mode

You might play around with a local regression method, like loess, where you can change the bandwidth.

ADD REPLY

Login before adding your answer.

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