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

No empty droplets with UMI counts over the lower cut off erorr #85

Closed
vkjain0006 opened this issue Dec 3, 2020 · 6 comments
Closed
Assignees

Comments

@vkjain0006
Copy link

First time user of cellbender on snRNA seq data where cellranger reports presence of ambient RNA (using cellranger latest version 5). Trying to clean up the empty droplets using cellbender, bit it's giving following error:-
"AssertionError: There are no empty droplets with UMI counts over the lower cutoff of 1219. Some empty droplets are necessary for the analysis. Reduce the --low-count-threshold parameter"

Below is the command I used and also varied low count threshold parameter form 5 to 100 but still getting the same error everytime.
cellbender remove-background --inputs pathof cellranger matrix file/filtered_feature_bc_matrix --output cellbender_out --expected-cells 11203 --total-droplets-included 25000 --low-count-threshold 5 (tired 5,10,15,100)

Output when command is run
cellbender:remove-background: 2020-12-03 13:18:52
cellbender:remove-background: Running remove-background
cellbender:remove-background: Loading data from directory outs/filtered_feature_bc_matrix
cellbender:remove-background: CellRanger v3 format
cellbender:remove-background: Trimming dataset for inference.
cellbender:remove-background: Including 23891 genes that have nonzero counts.
cellbender:remove-background: Prior on counts in empty droplets is 2439
cellbender:remove-background: Prior on counts for cells is 6043
cellbender:remove-background: Excluding barcodes with counts below 1219
Traceback (most recent call last):
File "/data/Conda/anaconda3/envs/cellbender/bin/cellbender", line 33, in
sys.exit(load_entry_point('cellbender', 'console_scripts', 'cellbender')())
File "/data/Conda/anaconda3/envs/cellbender/CellBender/cellbender/base_cli.py", line 101, in main
cli_dict[args.tool].run(args)
File "/data/Conda/anaconda3/envs/cellbender/CellBender/cellbender/remove_background/cli.py", line 103, in run
main(args)
File "/data/Conda/anaconda3/envs/cellbender/CellBender/cellbender/remove_background/cli.py", line 196, in main
run_remove_background(args)
File "/data/Conda/anaconda3/envs/cellbender/CellBender/cellbender/remove_background/cli.py", line 153, in run_remove_background
fpr=args.fpr)
File "/data/Conda/anaconda3/envs/cellbender/CellBender/cellbender/remove_background/data/dataset.py", line 100, in init
gene_blacklist=gene_blacklist)
File "/data/Conda/anaconda3/envs/cellbender/CellBender/cellbender/remove_background/data/dataset.py", line 271, in _trim_dataset_for_analysis
f"There are no empty droplets with UMI counts over the lower "
AssertionError: There are no empty droplets with UMI counts over the lower cutoff of 1219. Some empty droplets are necessary for the analysis. Reduce the --low-count-threshold parameter.

Also please find rank plot below generated by cellranger for the sample

newplot(1)
72d8700-356b-11eb-8455-1fe66a1d9ca8.png)

It will be great if someone can please share what parameters would be right for this dataset so that I can get to working.
I need to run cellbender on 2 more similar samples from this experiment.

Thanks!

@sjfleming
Copy link
Member

Hi @vkjain0006 !
(Thanks for reaching out via email, I have neglected to keep up with issues for a few weeks...)

I will reply here as well so that other people might see the answer if they have the same question:

I believe the problem is that you're using the "filtered" feature_bc_matrix file. The algorithm depends on having empty droplets in order to properly learn the ambient RNA profile. So you need to use the "raw" feature_bc_matrix (including all droplets, even empties) as the --input.

@sjfleming sjfleming self-assigned this Dec 18, 2020
@vkjain0006
Copy link
Author

Thanks @sjfleming for sharing the solution and it worked once I changed the input file.

But I am facing a new challenge now, as Seurat is giving error when I am trying to import filtered file generated by cellbender.

Here's what I am running and the error I am getting:-

d1 <- Read10X_h5(filepath, use.names = TRUE, unique.features = TRUE)
Error in [[.H5File(infile, paste0(genome, "/", feature_slot)) :
An object with name matrix/gene_names does not exist in this group

Can someone please share what I am doing wrong here ?

Thanks

@sjfleming
Copy link
Member

Hm, I will need to check on the latest version of Seurat and make sure loading is still working with any new changes they've made.

Which Seurat version are you using?

In the meantime, I know that loading the data in scanpy works.

Is this a CellRanger v3 format file?

@vkjain0006
Copy link
Author

I am using latest seurat 3.9, files are generated from cellranger version 5.0.

I did find a way to get around the issue, mentioned by someone in the comments section of related issue that deleting PYTABLES attributes fixes the issue and it did work for me too.

@sjfleming
Copy link
Member

@vkjain0006 okay great, I'm glad you got it to work. I'm surprised that this Seurat fix
satijalab/seurat#3653
did not solve the issue... or maybe that fix hasn't been included in the Seurat 3.9 distribution?

@sjfleming sjfleming mentioned this issue Mar 28, 2023
@sjfleming sjfleming mentioned this issue Aug 6, 2023
@sjfleming
Copy link
Member

Closed by #238

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