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

Fixed Single cell RNA seq #372

Open
archana433 opened this issue Jul 8, 2024 · 1 comment
Open

Fixed Single cell RNA seq #372

archana433 opened this issue Jul 8, 2024 · 1 comment

Comments

@archana433
Copy link

Hi,
I just want to ask , can we use CellBender for Single Cell Gene Expression Flex Fixed RNA Profiling (FRP) seq samples to remove backgroud noise / Ambient RNA / empty Droplets because this seq is probe based sequencing.

Thank you

@LinearParadox
Copy link

I've used it and it worked well! You have to do some manual preprocessing because of duplicated features.

I've discussed it here:
#234

My most recent code for summing features in a non memory hungry way is:

import scanpy as sc
import numpy as np
import anndata
from scipy.sparse import csr_matrix
import sys
path = sys.argv[1]
adata = sc.read_10x_h5(path+"/sample_raw_feature_bc_matrix.h5")
var = adata[:, adata.var_names.duplicated()].var[~adata[:, adata.var_names.duplicated()].var.index.duplicated(keep='first')]
adata_x=csr_matrix(np.concatenate([adata[:, n].X.sum(axis=1) for n in var.index], axis=1))
double_probes = anndata.AnnData(X=adata_x, obs=adata.obs, var=var)
final=anndata.concat([adata[:, ~(adata.var.index.isin(double_probes.var.index))], double_probes], axis=1)
del adata
adata_filtered = sc.read_10x_h5(path+"/sample_filtered_feature_bc_matrix.h5") 
adata_filtered_feature = final[:, final.var.gene_ids.isin(adata_filtered.var.gene_ids)].copy()
adata_filtered_feature.write(path+"/my_feature_filtered_file.h5ad")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants