Entering edit mode
Florian Hahne
▴
540
@florian-hahne-2471
Last seen 10.2 years ago
Hi Bastian, Kenneth,
the problem in this case is that flowClust extends the
multipleFilterResult class, adding all the mixture parameters and
stuff.
The subsetFilter operation is defined in flowCore, which doesn't
really
know about all these additional slots. We do have a mechanism in place
to deal with such cases, i.e, the summarizeFilter method which is
called
whenever a filter is evaluated. This is basically just a hook that has
access to both the input filter and the filterResult, and it can be
used
to add arbitrary items to the filterDetails slot. I added a
summarizeFilter method for tmixFilters which does exactly that.
The following will still give you a multipleFilterResult object as the
result of the subsetFilter operation but now with additional flowClust
parameters attached in the filterDetails.
library(flowClust)
data(GvHD)
foo <- GvHD[[1]]
rg <- rectangleGate("FSC-H"=c(100,600), "SSC-H"=c(200, 700))
tm <- tmixFilter(parameters=c("FSC-H", "SSC-H"), K=3)
fr <- filter(foo, tm %subset% rg)
names(filterDetails(fr, "tmixFilter in defaultRectangleGate"))
Note that there are three items in the filterDetails list, one for
each
of the components of the subsetFilter and one for the subsetFilter
itself, and that the latter contains copies of values of the former
two.
This is intentional, albeit a bit unfortunate in this case, since the
additional flowClust parameters contain a lot of information (large
matrices, indexing vectors...), which is unnecessarily copied here.
bw,
Florian
Bastian Angermann wrote:
> Thank you very much and have a great weekend.
>
> Bastian
>
> -------- Original-Nachricht --------
>
>> Datum: Fri, 01 May 2009 14:16:01 -0700
>> Von: Florian Hahne <fhahne at="" fhcrc.org="">
>> An: Bastian Angermann <angerb at="" gmx.de="">
>> Betreff: Re: [BioC] flowClust results in subset filters
>>
>
>
>> Ok, I will take a look asap,
>> Florian
>>
>> Bastian Angermann wrote:
>>
>>> Hi Florian,
>>>
>>> I've come over a minor issue with the current return type of a
filter
>>> operation that subsets a tmix-filter within an other filter.
>>>
>>> While the current return type of multipleFilterResult allows to
access
>>> the class assignment by the tmix-Filter, the results describing
>>> the fitted distribution (i.e. means, proportions and
>>> covariance matrices) are not accessible. The filter included in
the
>>>
>> filterDetails in the appropriate gate is of type tmixFilter and not
>> tmixFilterResult, which would of course have a redundant subSet.
>>
>>> Access to the parameters of the fitted distributions would be
>>> quite usefull.
>>>
>>>
>>> Best,
>>> Bastian
>>> -------- Original-Nachricht --------
>>>
>>>
>>>> Datum: Mon, 27 Apr 2009 17:41:43 -0700
>>>> Von: Florian Hahne <fhahne at="" fhcrc.org="">
>>>> An: Bastian Angermann <angerb at="" gmx.de="">
>>>> Betreff: Re: [BioC] flowClust results in subset filters
>>>>
>>>>
>>>
>>>
>>>> Hi Bastian,
>>>> I just committed the changes to the devel branch of the package
>>>>
>> (version
>>
>>>> 1.11.1).
>>>> It might take a day or two to build, but it would be great if you
could
>>>> take a look at this version first. I would like to hold off on
bumping
>>>> things back into release unless we are all happy with it.
>>>> If you know how to build the devel package from source you should
be
>>>> able to get the 1.11.1 version as of now.
>>>> Florian
>>>>
>>>> Bastian Angermann wrote:
>>>>
>>>>
>>>>> Hi Florian,
>>>>>
>>>>> thanks for your reply. Let me know if I can do any beta testing
>>>>> of the new code.
>>>>>
>>>>> Cheers,
>>>>> Bastian.
>>>>>
>>>>> -------- Original-Nachricht --------
>>>>>
>>>>>
>>>>>
>>>>>> Datum: Sun, 26 Apr 2009 22:49:02 -0700
>>>>>> Von: Florian Hahne <fhahne at="" fhcrc.org="">
>>>>>> An: Bastian Angermann <angerb at="" gmx.de="">
>>>>>> CC: Bioconductor at stat.math.ethz.ch
>>>>>> Betreff: Re: [BioC] flowClust results in subset filters
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Hi Bastian,
>>>>>> this is indeed a feature which wasn't implemented yet. I fixed
the
>>>>>> code and everything seems to be working as intended now, but I
want
>>>>>>
>> to
>>
>>>>>> give it some more rigorous testing before submitting. I am
planning
>>>>>>
>> to
>>
>>>>>> push that back into the release branch since it is more of a
bug fix
>>>>>> than feature addition.
>>>>>> If you want to be more independent of the types of comparisons
>>>>>>
>> between
>>
>>>>>> gating steps, you might want to take a look at the workFlow
stuff (as
>>>>>>
>>
>>
>>>>>> described in the package vignette). There you can compute
summary
>>>>>> statistics for a particular gating operation based on another
>>>>>> reference view in the workFlow (via the additional 'reference'
>>>>>> argument of the summary method)
>>>>>> bw,
>>>>>> Florian
>>>>>>
>>>>>>
>>>>>> On 24.04.2009, at 10:30, Bastian Angermann wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I am using R2.9.0 and the 2.4 version of Bioconductor. When I
try to
>>>>>>>
>>
>>
>>>>>>> run
>>>>>>> a tmixfilter subsetted on a rectangular gate the result is of
class
>>>>>>> logicalFilterResult thus I am unable to access the individual
>>>>>>> clusters:
>>>>>>> #################################################
>>>>>>> library(flowCore)
>>>>>>> library(flowClust)
>>>>>>> data(rituximab)
>>>>>>>
>>>>>>> r_filter <-
rectangleGate("FSC.H"=c(100,500),"SSC.H"=c(100,500))
>>>>>>> # gate boundaries are not meant to be meaningful.
>>>>>>> t_filter <- tmixFilter("tmix", c("FSC.H", "SSC.H"), K=3)
>>>>>>> result <- filter(rituximab,t_filter %subset% r_filter)
>>>>>>>
>>>>>>> class(result)
>>>>>>> ################################################
>>>>>>>
>>>>>>> Is that a bug, missing feature or am I missing something?
>>>>>>> I'd like to be able to see the result of the
>>>>>>> tmixFilter in the context of the ancestor populations,
>>>>>>> thus the %subset%. I'am working around that by adding an index
>>>>>>>
>> vector
>>
>>>>>>> to the original flowFrame, to be able to do manual subsetting,
but
>>>>>>> it would be nice to to that without this hack.
>>>>>>>
>>>>>>> Thanks a lot,
>>>>>>> Bastian Angermann
>>>>>>> --
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Bioconductor mailing list
>>>>>>> Bioconductor at stat.math.ethz.ch
>>>>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>>>>>> Search the archives:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
http://news.gmane.org/gmane.science.biology.informatics.conductor
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>> --
>>>> Florian Hahne, PhD
>>>> Computational Biology Program
>>>> Division of Public Health Sciences
>>>> Fred Hutchinson Cancer Research Center
>>>> 1100 Fairview Ave. N, M1-B514
>>>> PO Box 19024
>>>> Seattle, Washington 98109-1024
>>>> 206-667-3148
>>>> fhahne at fhcrc.org
>>>>
>>>>
>>>
>>>
>> --
>> Florian Hahne, PhD
>> Computational Biology Program
>> Division of Public Health Sciences
>> Fred Hutchinson Cancer Research Center
>> 1100 Fairview Ave. N, M1-B514
>> PO Box 19024
>> Seattle, Washington 98109-1024
>> 206-667-3148
>> fhahne at fhcrc.org
>>
>
>
--
Florian Hahne, PhD
Computational Biology Program
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
PO Box 19024
Seattle, Washington 98109-1024
206-667-3148
fhahne at fhcrc.org