Distribution Of Peaks From Tss-Kernel Density Estimation
1
0
Entering edit mode
11.0 years ago
e.karasmani ▴ 140

Dear All,

Good afternoon. I want to plot the distribution of my ChIP seq peaks from TSS.

So I want to make a picture like that.....

http://www.google.nl/imgres?um=1&client=firefox-a&sa=N&rls=org.mozilla:en-US:official&hl=en&biw=1600&bih=1136&tbm=isch&tbnid=bbX6KCy4DQu3LM:&imgrefurl=http://compbio.med.harvard.edu/wiki/display/pub/Density%2Bof%2B5%27-end%2Band%2B3%27-end%2Bnucleosome%2Bfragments%2Baround%2BTSS&docid=XzgqBiDM6RK94M&imgurl=http://compbio.med.harvard.edu/wiki/plugins/servlet/perimeter/attachments/7766149/7766147/nucl_ends/k4me3.stim.bta.five.three.ends.around.TSS.png&w=500&h=300&ei=TC2KUc_wKauT0AWJjoDgAw&zoom=1&ved=1t:3588,r:85,s:0,i:346&iact=rc&dur=503&page=3&tbnh=168&tbnw=272&start=79&ndsp=43&tx=166&ty=112

Hence, I tried to use the density function which looks like that....

 d <- density(lena$distance.to.gene)

lena$distance.to.gene is a column from my data frame which has the distances from the TSS.

Hence, when I am using the density function like i descibed it above it gives me a graph which looks like a gausian distribution.

What i want to change is the resolution of the density of the peaks. For example to have them every 100bp or every 200 bp.

However from the manual ?density it is not clear to me which option should I use to set this criteria.

could you please share your thoughts with me?

Moreover, do you have any other suggestions on how to plot the graph that i want to make?

thank you in advance

best regards Lena

r chipseq chip-seq • 3.1k views
ADD COMMENT
1
Entering edit mode
11.0 years ago
Michael 54k

Not totally sure what you mean with:

What i want to change is the resolution of the density of the peaks. For example to have them every 100bp or every 200 bp.

If you mean the resolution of the peak detection, e.g. trying to detect two peaks with 100bp distance as two separate peaks instead of one, you have to change parameters in the peak finding.

If you are referring to the "resolution" of the density estimate, then you should look at the bw parameter:

bw the smoothing bandwidth to be used. The kernels are scaled such that this is the standard deviation of the smoothing kernel.

Larger values will give a 'smoother' result, and lower values more 'wobbly' density estimates. Compare these two plots:

plot(density(rpois(100,10),bw=0.1))
plot(density(rpois(100,10),bw=10))
ADD COMMENT

Login before adding your answer.

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