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

Input X contains NaN. #678

Open
christophechu opened this issue May 20, 2024 · 3 comments
Open

Input X contains NaN. #678

christophechu opened this issue May 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@christophechu
Copy link

dyn.tl.cell_velocities(adata, method='kmc', other_kernels_dict={'transform': 'sqrt'})
raise 'Input X contains NaN.'

@christophechu christophechu added the bug Something isn't working label May 20, 2024
@Sichao25
Copy link
Collaborator

Hi, thanks for raising this issue. Basically, this error occurs when there are NaN values in your dataset (Could be either in expression or velocity matrix). Could you share additional details about your issue(e.g. the dataset you are working with, previous steps you've performed, relevant traceback ...)?

@christophechu
Copy link
Author

It should by definition not have any NA value. But I don't know why this problem has arisen.

adata_raw = adata.copy()
preprocessor = dyn.pp.Preprocessor(cell_cycle_score_enable=True)
preprocessor.config_monocle_recipe(adata_raw)
preprocessor.filter_cells_by_outliers_kwargs["keep_filtered"] = False
preprocessor.filter_genes_by_outliers_kwargs["inplace"]=True
preprocessor.select_genes_kwargs["n_top_genes"]=3000
preprocessor.preprocess_adata_monocle(adata_raw)
adata = adata_raw.copy()
adata.raw = adata
del adata_raw

AnnData object with n_obs × n_vars = 150931 × 7305
obs: 'file_name', 'n_genes_by_counts', 'log1p_n_genes_by_counts', 'total_counts', 'log1p_total_counts', 'pct_counts_in_top_20_genes', 'total_counts_mt', 'log1p_total_counts_mt', 'pct_counts_mt', 'outlier_5', 'mt_outlier', 'scDblFinder_score', 'scDblFinder_class', 'hybrid_score', 'hybrid_class', 'DoubletFinder_score', 'DoubletFinder_class', 'n_genes', 'Doublet_detect', 'patient', 'tissue', 'dataset', 'nGenes', 'nCounts', 'pMito', 'pass_basic_filter', 'Size_Factor', 'initial_cell_size', 'unspliced_Size_Factor', 'initial_unspliced_cell_size', 'spliced_Size_Factor', 'initial_spliced_cell_size', 'ntr'
var: 'nCells', 'nCounts', 'pass_basic_filter', 'log_cv', 'log_m', 'score', 'frac', 'use_for_pca', 'ntr', 'use_for_dynamics'
uns: 'CD4_subtypes_colors', 'diffmap_evals', 'neighbors', 'pp', 'velocyto_SVR', 'feature_selection', 'PCs', 'explained_variance_ratio_', 'pca_mean', 'vel_params_names', 'dynamics'
obsm: 'X_diffmap', 'X_pca_harmony', 'X_umap', 'X_pca'
varm: 'vel_params'
layers: 'spliced', 'unspliced', 'X_unspliced', 'X_spliced', 'M_u', 'M_uu', 'M_s', 'M_us', 'M_ss', 'velocity_S'
obsp: 'connectivities', 'distances', 'moments_con'

@Sichao25
Copy link
Collaborator

Would you mind sharing the traceback information? This will help us better locate the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants