Open MishalAshraf opened 1 year ago
Interestingly, the same code run with a slight modification produces the intended behaviour. Is this intended? `
adata_sub_master = sc.read_h5ad("your_favourite_object.h5ad")
n_genes = 1491
for i in range(10):
adata_sub = adata_sub_master.copy()
sc.pp.highly_variable_genes(adata_sub, n_top_genes=n_genes)
unique_genes = list(adata_sub.var['highly_variable'][adata_sub.var['highly_variable'] == True].index)
if i == 0:
all_unique = list(set(unique_genes))
print(f"total {len(all_unique)} unique genes")
else:
all_unique = list(set(all_unique+unique_genes))
print(f"total {len(all_unique)} unique genes")`
Please make sure these conditions are met
What happened?
I would expect that when you call sc.pp.highly_variable_genes on the same dataset and request the same number of genes, that you would get the same output. The below example suggests that this is not the case.
Minimal code sample
Error output
Versions