Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault(core dumped) on tissueCut #81

Closed
OswaldZhang opened this issue Dec 11, 2023 · 9 comments
Closed

Segmentation fault(core dumped) on tissueCut #81

OswaldZhang opened this issue Dec 11, 2023 · 9 comments

Comments

@OswaldZhang
Copy link

Hi, I'm using tissueCut to cut my own gef file, however, every time I try
singularity exec /home/apps/SAW-6.0.0/SAW_06.0.0.sif tissueCut
it always returns
/usr/local/bin/tissueCut: line 1: 139646 Segmentation fault (core dumped) python3 /opt/saw_v6.0.0_software/pipeline/tissueCut/Tissuecut.pyc $*

I've no idea about this issue, this gef is 11G in size and my device has at least 200G mem to use.

Thanks for your timely reply!

@Clouate
Copy link
Collaborator

Clouate commented Dec 12, 2023

Hi, could you provide the complete run command and the error message?

@OswaldZhang
Copy link
Author

Definitely! Thanks for the timely reply!!
Here is the code I use to run tissueCut

singularity exec /home/apps/SAW-6.0.0/SAW_06.0.0.sif tissueCut -i RNAcombine.gef -o ./ --sn FF293712 -O Transcriptomics -d

And here is the error message
tissueCut.log

I have no idea how to solve this. Thanks for the help!

@Clouate
Copy link
Collaborator

Clouate commented Dec 12, 2023

It seems that there is something wrong with your RNAcombine.gef file, or your operation on the gef file is not compatible with our software. It is recommended that you may update SAW to the latest version or try to use the tissue segmentation function of Stereopy
https://stereopy.readthedocs.io/en/latest/Tutorials/Tissue_Segmentation.html

@OswaldZhang
Copy link
Author

REALLY THANKS for your prompt reply! When using the stereopy, it returns the same output for me

image

And here is my code

src_gef_path = "./RNA.raw.combine.gef"
dst_bgef_path = "./RNA.raw.combine.tissue_extraction.gef"

from stereo.tools.tissue_extraction import tissue_extraction_to_bgef
from stereo.image.tissue_cut import RNATissueCut
from stereo.image.tissue_cut import RNA

tissue_extraction_to_bgef(
src_gef_path,
dst_bgef_path,
"./",
src_type=RNA,
rna_tissue_cut_bin_size=1
)

Also, since the gef file is manually convert by me from the gem, here is the code to generate my gef

#generate bgef by gem
generate_bgef(input_file=gem_file,
bgef_file=bgef_file,
stromics=stromics,
n_thread=30,
bin_sizes=bin_sizes,
region=region)

and it returns
image

Not sure what's going on here.

@OswaldZhang
Copy link
Author

After careful investigation, I found it is caused by this function,
https://github.com/STOmics/Stereopy/blob/2c59d95378221120fb2d1cd54de4a1dcb295f530/stereo/tools/tissue_extraction.py#L76C9-L76C86

And I manually redo it, here is my code

from gefpy.bgef_creater_cy import BgefCreater

src_gef_path = "./RNA.raw.combine.gef"
dst_bgef_path = "./RNA.raw.combine.tissue_extraction.gef"

bc = BgefCreater()
bc.create_bgef(src_gef_path, 1,
"./RNA.raw.combine_tissue_cut.tif",
dst_bgef_path)
It returns
image

So I guess there is sth wrong with this function in my case

https://github.com/BGIResearch/gefpy/blob/main/gefpy/bgef_creater_cy.pyx

Still not sure what's going on here.

@Clouate
Copy link
Collaborator

Clouate commented Dec 12, 2023

Hi, I have checked your command. The reason was that the conversion of .gem to .gef changed the data type of the gene matrix in the .gef, which was different from the SN.raw.gef outputted by SAW pipeline and currently not supported for tissueCut.
If you want to edit the gem file, we recommend that you could use the SN.tissue.gem, gene matrix under tissue area, outputted by SAW pipeline.

@OswaldZhang
Copy link
Author

Thanks for your patient reply! So currently is there any way for me to convert my combined gem file to the proper gef file as input to tissueCut? The reason behind this is we have 2 different separate stereo-seq SN.tissue.gem files measured in one tissue section (one is more dense and the other is sparse). We want to do tissue segmentation in an unbiased manner( this is to say, the transcripts located in the more dense one may not contain the transcripts located in the sparse one).

@Clouate
Copy link
Collaborator

Clouate commented Dec 12, 2023

I'm sorry that I don't have a particularly good method. When due with Similar problems in the past, we used h5py to modify the data type of the matrix but only got a tif image of tissue segmentation.
Maybe you could open an new issue at Stereopy, because SAW: tissueCut also based on Stereopy.
https://github.com/STOmics/Stereopy/issues

@OswaldZhang
Copy link
Author

Got it! Thanks for your reply! Let's see how the Stereopy developer replies to this issue.

@OswaldZhang OswaldZhang changed the title Segmentation fault(core dumped) on tissueCut Segmentation fault(core dumped) on tissue_extraction_to_bgef Dec 12, 2023
@OswaldZhang OswaldZhang changed the title Segmentation fault(core dumped) on tissue_extraction_to_bgef Segmentation fault(core dumped) on tissueCut Dec 12, 2023
@Clouate Clouate closed this as completed Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants