Teichlab / cellphonedb

MIT License
338 stars 105 forks source link

No CellPhoneDB interacions found in this input #309

Closed YuliaInn closed 3 years ago

YuliaInn commented 3 years ago

I have ~22000 cells in my input file. Whenever I subset the same input to 500 cells and run the same command as below, it works. I am running it in hpc cluster with 400G memory and 12 cpus allocated. I have ~450G storage in my working directory too. I talked to my hpc cluster support, they said it shouldn't be a memory problem.

I did not file any issues here with a similar error "No CellPhoneDB interacions found in this input". What can it be?

cellphonedb method statistical_analysis cellphonedb_metaLEFT_all.txt LeeCRCtumorNormalized_LEFT_all.txt --threads=12 --verbose

OUTPUT:

/storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/sklearn/utils/deprecation.py:144: FutureWarning: The sklearn.cluster.kmeans module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.cluster. Anything that cannot be imported from sklearn.cluster is now part of the private API. warnings.warn(message, FutureWarning) [ ][APP][12/05/21-11:17:43][WARNING] Latest local available version is v2.0.0, using it [ ][APP][12/05/21-11:17:43][WARNING] User selected downloaded database v2.0.0 is available, using it [ ][CORE][12/05/21-11:17:43][INFO] Initializing SqlAlchemy CellPhoneDB Core [ ][CORE][12/05/21-11:17:43][INFO] Using custom database at /home/iid49/.cpdb/releases/v2.0.0/cellphone.db [ ][APP][12/05/21-11:17:43][INFO] Launching Method cpdb_statistical_analysis_local_method_launcher [ ][APP][12/05/21-11:17:43][INFO] Launching Method _set_paths [ ][APP][12/05/21-11:17:43][INFO] Launching Method _load_meta_counts [ ][CORE][12/05/21-11:28:08][INFO] Launching Method cpdb_statistical_analysis_launcher [ ][CORE][12/05/21-11:28:08][INFO] Launching Method _counts_validations [ ][CORE][12/05/21-11:28:24][INFO] [Cluster Statistical Analysis] Threshold:0.1 Iterations:1000 Debug-seed:-1 Threads:12 Precision:3 [ ][APP][12/05/21-11:28:27][ERROR] Unexpected error Traceback (most recent call last): File "/storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/cellphonedb/src/api_endpoints/terminal_api/method_terminal_api_endpoints/method_terminal_commands.py", line 144, in statistical_analysis subsampler, File "/storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/cellphonedb/src/local_launchers/local_method_launcher.py", line 64, in cpdb_statistical_analysis_local_method_launcher subsampler File "/storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/cellphonedb/src/core/methods/method_launcher.py", line 76, in cpdb_statistical_analysis_launcher self.separator) File "/storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/cellphonedb/src/core/methods/cpdb_statistical_analysis_method.py", line 36, in call result_precision, File "/storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/cellphonedb/src/core/methods/cpdb_statistical_analysis_complex_method.py", line 64, in call raise NoInteractionsFound() cellphonedb.src.core.exceptions.NoInteractionsFound.NoInteractionsFound: No CellPhoneDB interacions found in this input.

prete commented 3 years ago

Hi @YuliaInn, the fact that 500 cells work could mean that it's a memory issue when running 22k cells despite having 400GB.

I can suggest you try the --subsampling option when launching cellphonedb. For example, something like:

cellphonedb method statistical_analysis --subsampling  --subsampling-log True --subsampling-num-cells 500 meta.txt count.txt

Read more the about optional-parameters here.

Alternatively, you could try moving your counts file to h5ad format and give beta version 2.1.8b3 a try (pip install -U cellphonedb==2.1.8b3).

YuliaInn commented 3 years ago

I tried subsampling

cellphonedb method statistical_analysis --subsampling  --subsampling-log True --subsampling-nu\
m-cells 500 cellphonedb_metaLEFT_all.txt LeeCRCtumorNormalized_LEFT_all.txt

I checked my counts file, it does not have any NA or inf values

OUTPUT:

Starting at: Wed May 12 18:25:32 CDT 2021

[ ][APP][12/05/21-18:28:05][WARNING] Latest local available version is v2.0.0, using it [ ][APP][12/05/21-18:28:05][WARNING] User selected downloaded database v2.0.0 is available, using it [ ][CORE][12/05/21-18:28:05][INFO] Initializing SqlAlchemy CellPhoneDB Core [ ][CORE][12/05/21-18:28:05][INFO] Using custom database at /home/iid49/.cpdb/releases/v2.0.0/cellphone.db [ ][APP][12/05/21-18:28:07][INFO] Launching Method cpdb_statistical_analysis_local_method_launcher [ ][APP][12/05/21-18:28:07][INFO] Launching Method _set_paths [ ][APP][12/05/21-18:28:07][INFO] Launching Method _load_meta_counts [ ][CORE][12/05/21-18:36:16][INFO] Launching Method cpdb_statistical_analysis_launcher [ ][CORE][12/05/21-18:36:16][INFO] Launching Method _counts_validations [ ][CORE][12/05/21-18:36:28][INFO] Subsampling 25952 to 500 [ ][CORE][12/05/21-18:36:38][WARNING] Subsampling failed: ignored. [ ][CORE][12/05/21-18:36:38][WARNING] array must not contain infs or NaNs [ ][CORE][12/05/21-18:36:40][INFO] [Cluster Statistical Analysis] Threshold:0.1 Iterations:1000 Debug-seed:-1 Threads:4 Precision:3 [ ][APP][12/05/21-18:36:42][ERROR] Unexpected error /storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/sklearn/utils/deprecation.py:144: FutureWarning: The sklearn.cluster.kmeans module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.cluster. Anything that cannot be imported from sklearn.cluster is now part of the private API. warnings.warn(message, FutureWarning) /storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/cellphonedb/src/core/utils/subsampler.py:28: RuntimeWarning: invalid value encountered in log1p pca_input = np.log1p(counts_t) Traceback (most recent call last): File "/storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/cellphonedb/src/api_endpoints/terminal_api/method_terminal_api_endpoints/method_terminal_commands.py", line 144, in statistical_analysis subsampler, File "/storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/cellphonedb/src/local_launchers/local_method_launcher.py", line 64, in cpdb_statistical_analysis_local_method_launcher subsampler File "/storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/cellphonedb/src/core/methods/method_launcher.py", line 76, in cpdb_statistical_analysis_launcher self.separator) File "/storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/cellphonedb/src/core/methods/cpdb_statistical_analysis_method.py", line 36, in call result_precision, File "/storage/hpc/data/iid49/miniconda/envs/cellphone/lib/python3.7/site-packages/cellphonedb/src/core/methods/cpdb_statistical_analysis_complex_method.py", line 64, in call raise NoInteractionsFound() cellphonedb.src.core.exceptions.NoInteractionsFound.NoInteractionsFound: No CellPhoneDB interacions found in this input.

Ending at: Wed May 12 18:36:44 CDT 2021

prete commented 3 years ago

Is your data non log-transformed? because if it's already log-transformed then you need to run it using --subsampling-log False

YuliaInn commented 3 years ago

It worked when I changed --subsampling-log True to --subsampling-log False

But I used RC normalization of my counts, so they shouldn't be log transformed