Entering edit mode
Vladimir Zhurov
▴
70
@vladimir-zhurov-4990
Last seen 10.3 years ago
Alex Gutteridge <alexg at="" ...=""> writes:
>
> On 20.01.2012 05:11, Vladimir Zhurov wrote:
> >> ...
> >
> > Dear Bioconductors,
> >
> > I am having the following problem which can be due to a
> > misunderstanding,
> > or an actual problem with topTable function in limma package.
> >
> > As far as I understand lfc and p filters should work together in
> > filtering
> > topTable results. Am I correct in this regard?
> >
> > If it is an intended situation then the problem is the following:
> > when more
> > than one contrasts is reported lfc filter does not affect the
output.
> > Which
> > is shown in the sample R session below.
> >
> > I would appreciate you help.
> >
> > Regards.
> >
> > Vladimir.
> >
>
> Hi Vladimir,
>
> I think the issue maybe that it is not clear (to me anyway!) what
> result one would expect with a lfc filter on a table with multiple
> contrasts. Should rows where all contrasts are above the cutoff be
> reported? Or where any are? It doesn't seem to be explicit in the
docs,
> but my assumption is that to avoid confusion topTable ignores lfc=
in
> the case you describe.
>
> Perhaps decideTests() is what you are really looking for? You can
then
> index a topTable generated data.frame with the results of
decideTests.
> E.g (pseudo-code not tested!)
>
> tt = topTable(fit,p.value=1,number=Inf,sort.by="none")
> dt = decideTests(fit,p.value=0.05,lfc=1)
>
> tt[dt[,1] != 0 & dt[,2] != 0 & dt[,3] !=0,] #Gives rows where all
> contrasts pass filter (assuming 3 contrasts)
> tt[dt[,1] != 0 | dt[,2] != 0 | dt[,3] !=0,] #Gives rows where any
> contrast passes filter
>
Alex,
Thank you for your input. I was considering decideTests but wanted to
check
whether there is something that can be done with topTable. I think
that it would
be nice at very least to explain intended behavior in more details in
the manual
for a case of multiple contrasts comparison.
Anyway, I ended up with the following workaround (lets say lfc=1,
p=0.05 and no
adjustment of p value):
tt.all<-topTable(fit.eb, sort.by="none", number=Inf,
adjust.method="none")
dt<-decideTests(fit.eb, lfc=1, p=0.05, adjust.method="none",
method="separate")
rs<-rowSums(abs(dt))
tt<-tt.all[rs >= 1,] # a single contrast above lfc will be sufficient
One may think that you are done at this point. However, decideTests
with
method="separate" recapitulates topTable performed on individual
contrasts. As a
result there are extra probes which will be reported and will have p
value above
cut-off when topTable is done across multiple comparisons. They need
to be
further filtered out.
tt.filt<-tt[tt$adj.P.Val < 0.05,]
Regards.
Vladimir.