change x- and y-axis limit within dba.plotVolcano in DiffBind
1
0
Entering edit mode
Suz • 0
@suz-16004
Last seen 6.5 years ago

Hello,

 

Can I change the axis limits within the dba.plotVolcano function?

Simply adding ylim=c(min,max) doesn't work.

I made volcano plots for two contrasts, and it would be nicer to have comparable axes.

Is there any way to change it?

 

Thanks for your help,

Suz

 

 

diffbind • 891 views
ADD COMMENT
0
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 5 weeks ago
Cambridge, UK

dba.plotVocano() uses ggplot internally, so ylim() doesn'y work. There is no easy way to change the behavior of dba.plotVolcano().

If you assign the return value of the call to dba.plotVolcano(), you will get a GRanges object with all the data you need to make your own plots. For example:

> data(tamoxifen_analysis)
> res <- dba.plotVolcano(tamoxifen, th=1)
> res
GRanges object with 2845 ranges and 6 metadata columns:
         seqnames               ranges strand |      Conc
            <Rle>            <IRanges>  <Rle> | <numeric>
     [1]    chr18 [64490686, 64491186]      * |      6.36
     [2]    chr18 [34597713, 34598213]      * |      5.33
     [3]    chr18 [69433108, 69433608]      * |      4.57
     [4]    chr18 [26860997, 26861497]      * |       7.3
     [5]    chr18 [60892900, 60893400]      * |      7.13
     ...      ...                  ...    ... .       ...
  [2841]    chr18 [75404971, 75405471]      * |      3.65
  [2842]    chr18 [46079151, 46079651]      * |      2.94
  [2843]    chr18 [12410806, 12411306]      * |      3.03
  [2844]    chr18 [10833549, 10834049]      * |      2.75
  [2845]    chr18 [21305647, 21306147]      * |      4.39
         Conc_Resistant Conc_Responsive      Fold   p-value       FDR
              <numeric>       <numeric> <numeric> <numeric> <numeric>
     [1]           1.39               7     -5.61  2.36e-10  4.41e-07
     [2]           0.22            5.97     -5.75   3.1e-10  4.41e-07
     [3]          -0.79            5.21        -6  2.97e-09  2.82e-06
     [4]           3.13            7.92     -4.79  1.11e-08  7.89e-06
     [5]           1.84            7.77     -5.93  1.82e-08  8.91e-06
     ...            ...             ...       ...       ...       ...
  [2841]           3.63            3.66     -0.02     0.998     0.999
  [2842]           2.95            2.94      0.02     0.998     0.999
  [2843]           3.02            3.03     -0.01     0.999     0.999
  [2844]           3.07            2.53      0.53         1         1
  [2845]           2.69            4.87     -2.18         1         1
  -------
  seqinfo: 1 sequence from an unspecified genome; no seqlengths

> plot(res$Fold,-log10(res$FDR),pch=20)
ADD COMMENT

Login before adding your answer.

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