Question about ChiPseeker: plot other values in plotAvgProf2
7
0
Entering edit mode
@francesca-casalino-4984
Last seen 12 months ago
United States

Hi,

I was just wondering whether it is possible to specify for example the value peak$V4 that contains ChIP peak values in the promoter regions in the function plotAvgProf2, instead of the Read Count Frequency?

Thank you

ChiPseeker • 3.8k views
ADD COMMENT
1
Entering edit mode
Guangchuang Yu ★ 1.2k
@guangchuang-yu-5419
Last seen 4 weeks ago
China/Guangzhou/Southern Medical Univer…

please use weightCol parameter

plotAvgProf2(weightCol="column name that contains peak value")

 

ADD COMMENT
0
Entering edit mode
@francesca-casalino-4984
Last seen 12 months ago
United States

Thank you so much for your quick reply!

If I use the function  plotAvgProf2 with peaks:

plotAvgProf2(peaks, xlim=c(up, down), conf = 0.95, resample = 1000, weightCol="V5")

I get this error:

Error in boot(data = peaks, statistic = getSgn, R = RESAMPLE_TIME,  : 

  number of items to replace is not a multiple of replacement length

But without the resampling it runs but it seems to  ignore the "weightCol" parameter and it just plots the read count frequencies... 

If I try one peak only with:

plotAvgProf2(peaks[[1]], xlim=c(up, down), weightCol="V5")

It seems to be ignoring the command, also the labels on the y-axis are still indicating the read counts and it ignores the values of xlim, how can they be set to indicate the values on "V5" and xlim?

 

Thanks a million!

 

ADD COMMENT
0
Entering edit mode

For the boot issue, I will ask Yan to answer it.

 

For label of y-axis, just use the ylab parameter:

plotAvgProf2(peaks[[1]], xlim=c(up, down), weightCol="V5", ylab="your_label")

 

ADD REPLY
0
Entering edit mode
@francesca-casalino-4984
Last seen 12 months ago
United States

Hi and thanks again for the reply!

Sorry my questions were not clear, the bootstrapping works great for one peak... I was just wondering whether I can plot more than one peak in the same plot...it seems to work only for one peak at a time ("peak" in the Vignette for example), but if I try with a list of peaks as for example the function "plotAvgProf" accepts, it seems to plot the read frequency and ignore the "weightCol"... 

(The upper and lower parameters are ignored only if I specify them with xlim but they are considered if I do upstream=3000, downstream=3000.)

This is the command I am giving, where "peak" is the GRange object in the Vignette:

plotAvgProf2(peak, upstream=3000, downstream=3000, conf = 0.95, resample = 1000, weightCol="V5")

But it does not work with for example:

plotAvgProf2(files, upstream=3000, downstream=3000, conf = 0.95, resample = 1000, weightCol="V5")

 

Is there any way it can accept a list of peaks, as can be done with plotAvgProf and the read frequency?

Thank you!!

ADD COMMENT
0
Entering edit mode
Guangchuang Yu ★ 1.2k
@guangchuang-yu-5419
Last seen 4 weeks ago
China/Guangzhou/Southern Medical Univer…

plotAvgProf2 can accept a named list of bed files as input.

 

ADD COMMENT
0
Entering edit mode
@francesca-casalino-4984
Last seen 12 months ago
United States

It gives me an error if I try it with "files" as in the Vignette... I must be doing something wrong...

 

plotAvgProf2(files, weightCol="V5", TxDb=txdb, upstream=3000, downstream=3000)

>> preparing promoter regions...     2015-10-13 19:22:57 

>> preparing tag matrix...         2015-10-13 19:22:57 

Error in .normarg_shift_or_weight(weight, "weight", x) : 

  'weight' must be a numeric vector, a single string, or a list-like object

ADD COMMENT
0
Entering edit mode

In the sample file of ChIPseeker, it happened to be the 5th column of the file are intensive values, so we use 'V5' to indicate using that column.

don't always use 'V5'.  You should check which column contains values you want to use and pass the column name to weightCol parameter.

 

ADD REPLY
0
Entering edit mode
@francesca-casalino-4984
Last seen 12 months ago
United States

Ok thanks, is there a restriction on the values that can be mapped then? I was using the V5 to give an example with the same data you used but I have normalised expression values in V5 that I wanted to map and I was trying with those as well, they range from -20 to +20, but I also wanted to map several other metadata columns for example that go from 0.1 to 2. One of my "peak" files look like this:

    GRanges object with 100001 ranges and 4 metadata columns:

           seqnames               ranges strand   |          V4         V5

              <Rle>            <IRanges>  <Rle>   |    <factor>  <numeric>

       [1]     chr1     [ 10010,  10664]      *   |      Peak_1  4.4973750

       [2]     chr1     [713785, 714569]      *   |      Peak_2  5.4287500

       [3]     chr1     [762394, 763144]      *   |      Peak_3  3.3098750

       [4]     chr1     [815103, 817360]      *   |      Peak_4  7.0947500

 

If I try with V5 or V6 or any other columns of my data the weightCol is ignored and plots the read frequency instead with this command:

plotAvgProf2(peak, upstream=3000, downstream=3000,  weightCol="V5") 

And I get this error if I try the bootstrap:

"Error in boot(data = tagMatrix, statistic = getSgn, R = RESAMPLE_TIME,  : 

  number of items to replace is not a multiple of replacement length"

 

So I basically have not been able to apply it to my peaks.

It seems to work with one peak only provided by the vignette but I can't see what the difference is between my peak and the peak in the Vignette... Is there maybe an additional specification I need to provide, such as ylim values? I think the problem is in the coordinates:

Error in plotAvgProf.internal(tagMatrix, xlim = xlim, xlab = xlab, ylab = ylab,  :

  please specify appropreate xcoordinations...

Calls: plotAvgProf -> plotAvgProf.internal

Execution halted

I am trying to understand whether it is the tagMatrix that does not recognise the  weightCol "V5" in my data, but it looks like it has the correct form, so maybe it could be a limit that is set in the plotAvgProf.internal function, which gives the default of plotting the read frequency if some limits are not met? The "dd" data frame in the getTagCount function basically gives me the values of the read frequencies instead of the values of the weightCol, but I am not sure where this goes wrong... the tagMatrix from the getTagMatrix looks fine as well as the peak.cov, but then when it is passed to the plotAvgProf.internal it doesn't recognise the "value"... 

If this is a problem I will try to plot histograms of these values by distance to TSS independently... can you please advise?

Thank you very much for your time.

ADD COMMENT
0
Entering edit mode
Guangchuang Yu ★ 1.2k
@guangchuang-yu-5419
Last seen 4 weeks ago
China/Guangzhou/Southern Medical Univer…

to follow up, pls refer to https://github.com/GuangchuangYu/ChIPseeker/issues/15

ADD COMMENT

Login before adding your answer.

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