RGLab / openCyto

A package that provides data analysis pipeline for flow cytometry.
GNU Affero General Public License v3.0
77 stars 29 forks source link

Registering flowDensity gating in openCyto does not work. #158

Closed BenPVD closed 7 years ago

BenPVD commented 7 years ago

Hi everybody,

I am trying to register gating methods from the flowDensity package to openCyto, but up to this point with no success.

I have read the threads here regarding registering flowDensity gating to openCyto using the following code:

.flowDensity <- function(fr, pp_res, channels=NA, filterId="",...){ if(length(channels)==2) flowDensity:::.flowDensity.2d(fr, channels = channels, ...) else flowDensity:::.flowDensity.1d(fr, channel = channels, ...) } registerPlugins(fun = .flowDensity, methodName = "flowDensity", dep = 'flowDensity', 'gating')

This will create a registered "flowDensity" gate when executing the listgtMethods() command, but after executing the gating method within my gating template this error comes up:

Error in flowDensity:::.flowDensity.2d(fr, channels = channels, ...) : object 'remove.margins' not found

I checked the flowDensity package and can't find flowDensity.1d or flowDensity.2dfunctions within the manual, so I tried to change the wrapper function which was posted here earlier. Again without success.

Error in .densityGating(flow.frame = obj, channel, n.sd = n.sd, use.percentile = use.percentile, : formal argument "flow.frame" matched by multiple actual arguments

Can anyone help? Maybe simply post the code for registering the flowDensity gating to opencyto from the beginning to the end? Additionally, I was trying to find the source code from the pre-registered gating functions in order to see how this works there, but commands like UseMethod(), method() or stats::: did not work. Any idea how to get the source code of the pre-registered gating methods of openCyto?

Thanks for your help!

gfinak commented 7 years ago

It looks like the .flowDensity.2d method needs to be updated to reflect the changes in .deGate2D (it is a copy of that method adapted for openCyto). It is missing the default remove.margins argument and perhaps others.

From: Ben Gabriel notifications@github.com Reply-To: RGLab/openCyto reply@reply.github.com Date: Friday, November 3, 2017 at 10:40 AM To: RGLab/openCyto openCyto@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [RGLab/openCyto] Registering flowDensity gating in openCyto does not work. (#158)

Hi everybody,

I am trying to register gating methods from the flowDensity package to openCyto, but up to this point with no success.

I have read the threads here regarding registering flowDensity gating to openCyto using the following code:

.flowDensity <- function(fr, pp_res, channels=NA, filterId="",...){ if(length(channels)==2) flowDensity:::.flowDensity.2d(fr, channels = channels, ...) else flowDensity:::.flowDensity.1d(fr, channel = channels, ...) } registerPlugins(fun = .flowDensity, methodName = "flowDensity", dep = 'flowDensity', 'gating')

This will create a registered "flowDensity" gate when executing the listgtMethods() command, but after executing the gating method within my gating template this error comes up:

Error in flowDensity:::.flowDensity.2d(fr, channels = channels, ...) : object 'remove.margins' not found

I checked the flowDensity package and can't find flowDensity.1d or flowDensity.2dfunctions within the manual, so I tried to change the wrapper function which was posted here earlier. Again without success.

Error in .densityGating(flow.frame = obj, channel, n.sd = n.sd, use.percentile = use.percentile, : formal argument "flow.frame" matched by multiple actual arguments

Can anyone help? Maybe simply post the code for registering the flowDensity gating to opencyto from the beginning to the end? Additionally, I was trying to find the source code from the pre-registered gating functions in order to see how this works there, but commands like UseMethod(), method() or stats::: did not work. Any idea how to get the source code of the pre-registered gating methods of openCyto?

Thanks for your help!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/RGLab/openCyto/issues/158, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABUkeUMZOlFrvr_m-jSsqdBOR01ywgMYks5sy1AkgaJpZM4QRcg4.

BenPVD commented 7 years ago

Thanks for the quick response. If I understand correctly the .flowDensity2D method is a copy of the .deGate2D method adapted for openCyto? Can you point out a way to approach this problem? Where do I find the .deGate2D method? Or where do I have to look for the missing but necessary arguments? Can you also point out how to look at the source code of the pre-registered methods of the openCyto package? I guess that would help me understand the correct structure of the method implementations. (Sorry, obviously only a user of openCyto and not a bioinformatician.)

Thanks!

gfinak commented 7 years ago

This is a fix the package maintainer needs to make.

From: Ben Gabriel notifications@github.com Reply-To: RGLab/openCyto reply@reply.github.com Date: Friday, November 3, 2017 at 11:21 AM To: RGLab/openCyto openCyto@noreply.github.com Cc: Greg Finak greg.finak@gmail.com, Comment comment@noreply.github.com Subject: Re: [RGLab/openCyto] Registering flowDensity gating in openCyto does not work. (#158)

Thanks for the quick response. If I understand correctly the .flowDensity2D method is a copy of the .deGate2D method adapted for openCyto? Can you point out a way to approach this problem? Where do I find the .deGate2D method? Or where do I have to look for the missing but necessary arguments? Can you also point out how to look at the source code of the pre-registered methods of the openCyto package? I guess that would help me understand the correct structure of the method implementations. (Sorry, obviously only a user of openCyto and not a bioinformatician.)

Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

mikejiang commented 7 years ago

both .deGate2D and .flowDensity.2d are private functions defined in flowDensity package. You can see the source by adding namespace prefix flowDensity::: Or view the source from bioc git mirror site https://github.com/Bioconductor-mirror/flowDensity/blob/master/R/helper_functions.R#L118 https://github.com/Bioconductor-mirror/flowDensity/blob/master/R/openCyto_wrappers.R#L60

As @gfinak said, you should contact its maintainer(Mehrnoush Malek mmalekes@bccrc.ca) for the fix (which should be an easy one).

BenPVD commented 7 years ago

Okay, that deletes an item from my to-do-list! Thanks for your help and quick response. I'll definitely check the source code to get a better sense what's going on and contact Mehrnoush Malek regarding the fix. Thanks again!