STOmics / Stereopy

A toolkit of spatial transcriptomic analysis.
MIT License
197 stars 65 forks source link

CellCut.cell_cut not working #106

Closed crelicthecleric closed 1 year ago

crelicthecleric commented 1 year ago

I've been trying to follow the cell_segmentation tutorial v0.10.0 using data from MOSTA; however, when I try to run the cell_cut function, I run into the following error:

python3: /workitems/geftools/cgefCellgem.cpp:897: void cgefCellgem::readmask_new(const string&): Assertion `m_rows == cgefParam::GetInstance()->m_max_y - cgefParam::GetInstance()->m_min_y+1' failed.

This is the code I run on a linux computing cluster:

from stereo.tools.cell_cut import CellCut

cgef_out_dir = "./cgef"
bgef_path = "../E12.5_E1S3.bgef"
gem_path = "../E12.5_E1S3_bin1.gem"

mask_path = "./cgef/deep-learning/E12.5_E1S3_mask.tif"

image_path = "../image_spat/E12.5_E1S3.tif"
model_path = "./models/seg_model_20211210.pth"

cc = CellCut(cgef_out_dir=cgef_out_dir)

out_path = cc.cell_cut(gem_path=gem_path, mask_path=mask_path)
# out_path = cc.cell_cut(bgef_path=bgef_path, mask_path=mask_path)
# out_path = cc.cell_cut(bgef_path=bgef_path, image_path=image_path, model_path=model_path)

GEM File Source: https://ftp.cngb.org/pub/SciRAID/stomics/STDS0000058/Bin1_matrix/E12.5_E1S3_GEM_bin1.tsv.gz Image File Source: https://ftp.cngb.org/pub/SciRAID/stomics/STDS0000058/Image/E12.5_E1S3.tif

I have also tried running the commented out versions as well. The mask generation and conversion from gem to bgef are successful, but get the same error for the cell binning.

TheSallyGardens commented 1 year ago

Sorry, the current stereopy is not compatible with this kind of data.

crelicthecleric commented 1 year ago

What specifically about the data is incompatible? Each of those file types is listed in the documentation. What file types should I be using with the CellCut function?

LyonLen commented 1 year ago

Sorry for the long-time-no-response. The reason why it failed is that the mask and the expression which you mentioned before are not perfectly matched. The expression has already been filtered before uploading to the file database.

junhouhui commented 1 year ago

Notice: this issue has been closed because it has been inactive for 14 days. You may reopen this issue if it has been closed in error.