saezlab / plugy

Flexible processing and analysis of plug microfluidics data
GNU General Public License v3.0
0 stars 0 forks source link

Workflow management #11

Closed deeenes closed 1 year ago

deeenes commented 1 year ago

Give option to do the analysis in steps (currently all at once)

We should have this already, maybe it doesn't work, have to check

deeenes commented 1 year ago

Currently the workflow is divided into 5 parts:

These are executed according to the logic in PlugExperiment.main.

By default all of them are None and turned on based on other parameters. The user can override this by the config, or at the instantiation of PlugExperiment or when calling main. If the user turns on or off certain workflow steps, the prerequisites of the enabled steps will be enabled too. E.g. to run only the first 2 steps:

import plugy
exp = plugy.PlugExperiment()
exp.main(plugs = True)

Or detect the samples, but don't run quality control and analysis:

import plugy
exp = plugy.PlugExperiment()
exp.main(samples = True)

And so on. To run a single part, e.g. to run only samples:

exp._samples()

But it will fail if init and plugs have not been run already.

NgocHien-Du commented 1 year ago

Maybe there is already this function in the program. However, there was no documentation so it would be great to have an example so that others can follow easily.

deeenes commented 1 year ago

In general, plugy has a ton of undocumented features, and where you can find most of the info is the config. I recommend to read the comments in this file :)

Otherwise, I will soon set up an automated docs build and add some tutorials mostly from the examples I wrote in issues like this one (#14, #15).

Another question: do these parameters cover your case? If so, we can close this issue.

NgocHien-Du commented 1 year ago

I have tried to read the config file already. But it is not easy for non-expert to find the relevant part and then to understand it. I am improving but it would be great to have more tuitorials. And the automated docs would be great too. Could you please give an example of how to run the 5 steps sequentially?

deeenes commented 1 year ago

Sequentially: to run the 5 steps it's enough to call main:

import plugy
exp = plugy.PlugExperiment()
exp.main()

To run them one-by-one, just call the methods one after each:

import plugy
exp = plugy.PlugExperiment()
exp._init()
exp._plugs()
exp._samples()
exp._qc()
exp._analysis()
NgocHien-Du commented 1 year ago

Got it. Thank you!