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

how to get ./Downstream/Tumor_origin/src/feature/tcga/TCGA-LN-A8I1-01Z-00-DX1.F2C4FBC3-1FFA-45E9-9483-C3F1B2B7EF2D.pt #41

Open
27yw opened this issue Dec 3, 2024 · 9 comments

Comments

@27yw
Copy link

27yw commented Dec 3, 2024

Hi! very wonderful work.
Here comes some question
how to get ./Downstream/Tumor_origin/src/feature/tcga/TCGA-LN-A8I1-01Z-00-DX1.F2C4FBC3-1FFA-45E9-9483-C3F1B2B7EF2D.pt

when I try to run this code
python3 Get_CHIEF_WSI_level_feature_batch.py

and I got this error
Original Traceback (most recent call last): File "/data_train/code/biz/yw/miniconda3/envs/chief2/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 351, in _worker_loop data = fetcher.fetch(index) # type: ignore[possibly-undefined] File "/data_train/code/biz/yw/miniconda3/envs/chief2/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch data = self.dataset[possibly_batched_index] File "/data_train/code/biz/yw/CHIEF/datasets/BagDataset.py", line 25, in __getitem__ features = torch.load(full_path, map_location=torch.device('cpu')) File "/data_train/code/biz/yw/miniconda3/envs/chief2/lib/python3.9/site-packages/torch/serialization.py", line 1319, in load with _open_file_like(f, "rb") as opened_file: File "/data_train/code/biz/yw/miniconda3/envs/chief2/lib/python3.9/site-packages/torch/serialization.py", line 659, in _open_file_like return _open_file(name_or_buffer, mode) File "/data_train/code/biz/yw/miniconda3/envs/chief2/lib/python3.9/site-packages/torch/serialization.py", line 640, in __init__ super().__init__(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: './Downstream/Tumor_origin/src/feature/tcga/TCGA-B6-A0WV-01Z-00-DX1.A8B9E114-A8CF-4389-B47C-2E1B842F7FF9.pt'
how to fix it?

@27yw
Copy link
Author

27yw commented Dec 3, 2024

btw there is no feature/tcga folder under Downstream/Tumor_origin/src/

@Dadatata-JZ
Copy link
Collaborator

Dadatata-JZ commented Dec 4, 2024

@27yw thanks.

It is just intended to show how to load a feature file. It is really nothing technical.
You should (1) tile your WSIs, (2) extract tile-level features (3) stack the features as a matrix in a file (e.g., pickle). "

You could refer to ctranspath repo to catch up with some prior.
https://github.com/Xiyue-Wang/TransPath

@27yw
Copy link
Author

27yw commented Dec 6, 2024

HI thanks for your answering
so you use this repo to get the features and save into a .pt file?
https://github.com/Xiyue-Wang/TransPath

@ivicts
Copy link

ivicts commented Mar 17, 2025

@Dadatata-JZ Hi for survial, inference.ipynb, may I ask if the feature file is tile-level features (Get_CHIEF_patch_feature.py) or WSI level features (Get_CHIEF_WSI_level_feature.py)?

@Dadatata-JZ
Copy link
Collaborator

@ivicts You would need both to obtain the tile-level and then slide-level features.

@Dadatata-JZ
Copy link
Collaborator

HI thanks for your answering so you use this repo to get the features and save into a .pt file? https://github.com/Xiyue-Wang/TransPath

@27yw Yes, you can.

@ivicts
Copy link

ivicts commented Mar 18, 2025

@Dadatata-JZ Thanks, I just want to run the inference.ipynb, for the survival problem for my custom data. For this problem, what are the input features? Is it:

  1. Tile-level features (Get_CHIEF_patch_feature.py)
  2. WSI level features (Get_CHIEF_WSI_level_feature.py)
  3. (a) Tile my WSIs
    (b) Extract tile-level features (Get_CHIEF_patch_feature.py)
    (c) Stack the features as a matrix in a file (e.g., pickle, concatenate? what dimension?).

Which one should I do? I just want to run the survival analysis for my custom data.

@ivicts
Copy link

ivicts commented Mar 26, 2025

@Dadatata-JZ are there any updates on this?

@Dadatata-JZ
Copy link
Collaborator

Dadatata-JZ commented Mar 27, 2025

@ivicts

4.
(a) Tile my WSIs
(b) Extract tile-level features (Get_CHIEF_patch_feature.py or any other tile-level feature extractors)
(c) concat tile-level features then extract slide-level features
(d) tune it for patient stratification (i.e., risk score/group up to your applications)
(e) get the corresponding survival information, then compute KM curves and check c-index etc.

Also, if you are not familiar with survival analysis using deep learning/CPath, some previous works may be inspiring. for instance,
https://pubmed.ncbi.nlm.nih.gov/38123254/

Feel free to shoot me an email and loop me into your real applications if prompt responses are expected. working on responding grant calls and other manuscripts. I don't get on GITHUB as often as before.

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

3 participants