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

Naive Question #147

Open
Chuang1118 opened this issue Mar 24, 2023 · 0 comments
Open

Naive Question #147

Chuang1118 opened this issue Mar 24, 2023 · 0 comments
Labels
question Further information is requested

Comments

@Chuang1118
Copy link

Hello ncem team,

Thanks to develop NCEM.
I'm trying out NCEM tool for downstream analysis(the receiver/sender analysis) of 10X visium with cell2location.

following this tutorial:
https://github.com/theislab/ncem_tutorials/blob/main/tutorials/type_coupling_visium.ipynb

e.g.
adata

AnnData object with n_obs × n_vars = 79849 × 2000
    obs: 'index', 'target_cell'
    var: 'highly_variable', 'means', 'dispersions', 'dispersions_norm'
    uns: 'hvg', 'log1p', 'node_type_names'
    obsm: 'node_types', 'proportions', 'spatial'

get_data_custom(interpreter=ncem_ip, deconvolution=True)

Mean of mean node degree per images across images: 6.000000
Using split method: node. 
 Train-test-validation split is based on total number of nodes per patients over all images.

Excluded 0 cells with the following unannotated cell type: [None] 

Whole dataset: 79849 cells out of 2 images from 1 patients.
Test dataset: 7985 cells out of 2 images from 1 patients.
Training dataset: 65008 cells out of 2 images from 1 patients.
Validation dataset: 7187 cells out of 2 images from 1 patients.

1/ for now I can plot the figures of type coupling analysis (e.g. Fig2 b, c, d, f in your paper).
How about the part of Training the ncem model for deconvoluted Visium, what's the output from this part ?
This part is Independent ?

2/ when I running the code below:
trainer.estimator.train(epochs=5)
I got the error messages:

Node: 'StatefulPartitionedCall'
RET_CHECK failure (tensorflow/compiler/xla/service/gpu/gpu_compiler.cc:618) dnn != nullptr 
	 [[{{node StatefulPartitionedCall}}]] [Op:__inference_train_function_1382]

I have checked Memory GPU is mostly full. 23178MiB / 24564MiB

Fri Mar 24 10:42:34 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.78.01    Driver Version: 525.78.01    CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA RTX A5000    Off  | 00000000:3B:00.0 Off |                  Off |
| 30%   38C    P2    59W / 230W |  23178MiB / 24564MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

Do you have any idea about GPU memory required for running NCEM with n_obs × n_vars = 79849 × 2000 ?

I have also followed the tutorial from https://github.com/theislab/spatial_scog_workshop_2022/blob/main/ncem/tutorial_ncem.ipynb

3/ For the part of Cell heterogeneity attributed to niche composition. the code below doesn't work to me.

adata_img, adata, log_pval, fold_change = ncem.data.compute_cluster_enrichment(
    image_key=['point16', 'point23', 'point8'],
    target_cell_type='Tcell_CD8',
    clip_pvalues=-5,
    n_neighbors=22,
    n_pcs=None,
)
    828 adata_list = list(self.img_celldata.values())
    829 adata = adata_list[0].concatenate(adata_list[1:], uns_merge="same")
--> 831 cluster_col = self.celldata.uns["metadata"]["cluster_col_preprocessed"]
    832 image_col = self.celldata.uns["metadata"]["image_col"]
    833 if undefined_type:

KeyError: 'cluster_col_preprocessed'

How to built cluster_col_preprocessed metadata ? This part is also for 10x visium?

4/ In general, I have misunderstood your tutorial. Could you tell to me step by step how to analysis 10x visium dataset from anndata with metadata ( obsm: 'node_types', 'proportions', 'spatial' ) using NCEM, especially downstream analysis from Training the ncem model for deconvoluted Visium.

Best,
Chuang

@Chuang1118 Chuang1118 added the question Further information is requested label Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant