I got a
ValueError: Input contains NaN, infinity or a value too large for dtype('float32').
when trying to run this part of the code
n_cells = len(adata)
Not sure if the cause of error is becauseI I merge 4 10x sample files into one adata, just used
.concatenate() command, or it's because of something else.
Everything was working well until that step
Seems like merging samples introduced some missing values.
Your sample elements are the same in each of the objects? Maybe you are using a different merging strategy.
The variables are the same but the n_obs is slightly different but not too much (13818, 13829, 13830, 13843); 4 files (runs).
I followed this strategy https://scanpy.discourse.group/t/merge-multiple-10x-samples/184
adata_pbmc_normal_L001 = sc.read_10x_mtx('~/pbmc_normal_L001/outs/filtered_feature_bc_matrix/') adata_pbmc_normal_L002 = sc.read_10x_mtx('~/pbmc_normal_L002/outs/filtered_feature_bc_matrix/') adata_pbmc_normal_L003 = sc.read_10x_mtx('~/pbmc_normal_L003/outs/filtered_feature_bc_matrix/') adata_pbmc_normal_L004 = sc.read_10x_mtx('~/pbmc_normal_L004/outs/filtered_feature_bc_matrix/')
adata = adata1.concatenate(adata2, adata3, adata4, index_unique=None)
I didn't do any filtration prior to concatenating the dataset.