almaan / stereoscope

Spatial mapping of cell types by integration of transcriptomics data
MIT License
87 stars 26 forks source link

running the stereoscope command for method comparison is throwing some error #31

Open Shrabanti87 opened 2 years ago

Shrabanti87 commented 2 years ago

foo@bar:~$ stereoscope run --sc_cnt synthetic/validcnt --sc_labels synthetic/validmta -scb 256 \ -sce 50000 --st_cnt synthetic/counts.st-hippo-comp.tsv -ste 50000 -o ../res/comp-stereoscope \ --gpu -lr 0.1

[2022-06-14 14:42:10,006 - stsc - INFO ] >> Using device cpu [2022-06-14 14:42:10,006 - stsc - INFO ] >> fitting sc data | count file : synthetic/validation.20190908194059502947.cnt_data.tsv | labels file : synthetic/validation.20190908194059502947.mta_data.tsv Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pandas/core/indexing.py", line 769, in _validate_tuple_indexer self._validate_key(k, i) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pandas/core/indexing.py", line 1378, in _validate_key raise ValueError(f"Can only index by location with a [{self._valid_types}]") ValueError: Can only index by location with a [integer, integer slice (START point is INCLUDED, END point is EXCLUDED), listlike of integers, boolean array]

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/bin/stereoscope", line 33, in sys.exit(load_entry_point('stereoscope==0.3.1', 'console_scripts', 'stereoscope')()) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/stereoscope-0.3.1-py3.10.egg/stsc/main.py", line 14, in main run(prs,args) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/stereoscope-0.3.1-py3.10.egg/stsc/run.py", line 98, in run sc_data = D.make_sc_dataset(args.sc_cnt, File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/stereoscope-0.3.1-py3.10.egg/stsc/datasets.py", line 296, in make_sc_dataset lbl = lbl.iloc[:,"bio_celltype"] File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pandas/core/indexing.py", line 961, in getitem return self._getitem_tuple(key) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pandas/core/indexing.py", line 1458, in _getitem_tuple tup = self._validate_tuple_indexer(tup) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pandas/core/indexing.py", line 771, in _validate_tuple_indexer raise ValueError( ValueError: Location based indexing can only have [integer, integer slice (START point is INCLUDED, END point is EXCLUDED), listlike of integers, boolean array] types

sidharthgd commented 2 years ago

I have this same issue as well, did you find a fix?

almaan commented 2 years ago

Hi,

sorry to see that you are experiencing some issues. If you're using a conda environment, would you mind sharing that with me - and if not, could you provide the version numbers of pandas and numpy. I'd like to try and reproduce the errors, so I can fix them, but want to be sure I'm working with the correct versions.

Best, Alma

sidharthgd commented 2 years ago

Hi, Thanks for the response. I'm using: numpy 1.20.0 pandas 1.3.3 torch 1.11.0 numba 0.54.1 macOS Big Sur 11.6

blee1616 commented 2 years ago

Hi Almaan,

I'm also having the same issue when I run that command. My versions are: pandas =1.4.3 numpy=1.20.0 torch=1.11.0 numba=0.54.1 Also, I run on a windows 11 and use the Ubuntu ap in order to access a Linux terminal.

almaan commented 2 years ago

Hi, Thanks for the response. I'm using: numpy 1.20.0 pandas 1.3.3 torch 1.11.0 numba 0.54.1 macOS Big Sur 11.6

Awesome, thanks @blee1616 ! I'll have a closer look at this as soon as I have time, but as a potential quick fix, could you try to downgrade pandas to 1.3.4: pip install pandas==1.3.4? If you do try this, it would be great if you could share the outcome!

Cheerio, A

almaan commented 2 years ago

Ok @blee1616 and @Shrabanti87, so I think I found the issue. I've just pushed a new update to the master branch, maybe you could pull that version and see if it works?

sidharthgd commented 2 years ago

Hi, I upgraded my pandas to version 1.3.4, and pulled your latest changes. The same problem persists.

almaan commented 2 years ago

Hi, I upgraded my pandas to version 1.3.4, and pulled your latest changes. The same problem persists.

That's strange, could you post the error message again?

blee1616 commented 2 years ago

Hi Almaan,

I just ran the new master branch and the command seems to be working for me now. [2022-06-29 23:38:02,858 - stsc - INFO ] >> Using device cpu [2022-06-29 23:38:02,858 - stsc - INFO ] >> fitting sc data | count file : ../data/curated/20220629232541055676.cnt_data.tsv | labels file : ../data/curated/20220629232959294925.mta_data.tsv [2022-06-29 23:38:09,731 - stsc - INFO ] >> SC data GENES : 5000 SC data CELLS : 346 SC data TYPES : 44

Epoch : 2253 /75000 | Loss : 9.089093E+05 | [ ]

almaan commented 2 years ago

Hi Almaan,

I just ran the new master branch and the command seems to be working for me now. [2022-06-29 23:38:02,858 - stsc - INFO ] >> Using device cpu [2022-06-29 23:38:02,858 - stsc - INFO ] >> fitting sc data | count file : ../data/curated/20220629232541055676.cnt_data.tsv | labels file : ../data/curated/20220629232959294925.mta_data.tsv [2022-06-29 23:38:09,731 - stsc - INFO ] >> SC data GENES : 5000 SC data CELLS : 346 SC data TYPES : 44

Epoch : 2253 /75000 | Loss : 9.089093E+05 | [ ]

Great! Thanks for the feedback! I'll just wait for @Shrabanti87 to confirm that it's working and then I'll close this issue. Good luck with the analysis :fist_oncoming:

/A