ggosti / fcGMM

0 stars 0 forks source link

Script usage issues #1

Open Ciro1990 opened 3 months ago

Ciro1990 commented 3 months ago

Hi there,

I was trying to use your script but I am having lots of issues. First, I do not get how to organize my data. Second, I was wondering if it is necessary to modify the fcGMM.py file. Could you maybe provide a more (biologist)user friendly guide? Or maybe a jupyter notebook with all the steps?

That would be really helpful.

Thanks a lot Ciro

ggosti commented 3 months ago

The project is not written in Jupyter, because it heavily uses widgets. To run the code you need to make a folder for the fcs data e.g. folder/. Then make a file.dat file in the folder as discussed in the README.md file. . Then run python runFcGMM.py with the arguments as described in the README.md file.

If you give me more information, maybe I can prepare a simple example template. How many fcs files do you want to analyze? What markers do you want to analyze?

Ciro1990 commented 3 months ago

Hi Giorgio,

thanks a lot for your quick answer!

So, my current experiment has 4 time points and in each time-point 2 conditions. I would like to analyze the CTV together with my GFP and the FCS-A (ideally i have other 2 markers as well)

Ciro1990 commented 3 months ago

PS: I can also share with you some of my .fcs files if you need them

ggosti commented 3 months ago

Let's try a couple of things first. I made a new branch for an implementation that includes a Jupyter notebook. However, implementing this notebook will require some time because the widgets do not work in the current notebook version.

I have a couple of questions:

  1. What are the fcs channel names for the labels (CTV and GFP)?
  2. Did you acquire fcs data for the autofluorescence?

In the meantime, you can try to clone the new branch version, which I have called notebook. Then you can put your fcs files in the new data folder I have added. Finally, you should change the dataCTV.dat file with the names of the files you have loaded. After all this, you can try to run the notebook ExampleNotebook.ipynb I have loaded. If you post here the outputs I will be able to help you out and see where you get stuck.

Ciro1990 commented 3 months ago

First of all, thanks a lot for helping out! I appreciate it. To answer your questions:

  1. The channels names are: 'CTV PB450-A' and 'GFP FITCA'. Related to this, I have two follow up questions: a) are the compensated parameters taken into consideration? b) is there a way to select a gated population (i.e. lymphocytes>singlets>alive)?

  2. I did not acquire the auto-fluorescence, but if needed I could do it in future experiments.

I have started to use the notebook and so far it run smoothly. I changed the name of the channel from V450-A to CTV PB450-A. Also I had an issue in the fcGMM.py. I had to remove all the lined where the 'EXPORT TIME' appeared, since I do not have such parameter in my .fcs files, somehow. I also had to remove all the lines of code where AutoFL were mentioned. I am now stuck at the last cell of the notebook with an error:

`Traceback (most recent call last):

File "runFcGMM.py", line 351, in

res0 = pd.read_csv(dirInit+'init-dim'+str(dim)+'-'+str(hour)+'h-'+sufx+'.csv')

File "C:\Users\ge29nek\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\util_decorators.py", line 211, in wrapper

return func(*args, **kwargs)

File "C:\Users\ge29nek\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\util_decorators.py", line 331, in wrapper

return func(*args, **kwargs)

File "C:\Users\ge29nek\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\io\parsers\readers.py", line 950, in read_csv

return _read(filepath_or_buffer, kwds)

File "C:\Users\ge29nek\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\io\parsers\readers.py", line 605, in _read

parser = TextFileReader(filepath_or_buffer, **kwds)

File "C:\Users\ge29nek\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\io\parsers\readers.py", line 1442, in init

self._engine = self._make_engine(f, self.engine)

File "C:\Users\ge29nek\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\io\parsers\readers.py", line 1735, in _make_engine

self.handles = get_handle(

File "C:\Users\ge29nek\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\io\common.py", line 856, in get_handle

handle = open(

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\ge29nek\Desktop\fcGMM\fcGMM/init/init-dim1-0h-dataCTV.csv'`

ggosti commented 3 months ago

To answer the questions: 1) A) We did not take in consideration compensation parameters, because we used dyes with channels from separate lasers.

1) B) We only implemented a gating strategy for a very basic gate for fsc-A and ssc-A. That used an upper threshold value for both fsc and ssc. A more complex strategy should be implemented from scratch.

2) The autofluorescence is very helpful when considering proliferation dyes or any dyes that is diluted as cells divide.

Just to better understand you what to run GMM on the CTV only or on the CTV and tbe GFP? If this is the case, is the GFP a dyes that is diluted when cells divide?

One of the important issues that I noticed is that the code channels names are not configurable. In the next couple days I will implement a simple Jupyter notebook that shows how to analyze a single fcs file and that allows for configurable channel names. Than I will make the main code more configurable especially with regards with the channel names.

ggosti commented 3 months ago

I finalized the example notebook! If you checkout the notebook branch you can test it on your data. Please let me know what you get!