broadinstitute / CellBender

CellBender is a software package for eliminating technical artifacts from high-throughput single-cell RNA sequencing (scRNA-seq) data.
https://cellbender.rtfd.io
BSD 3-Clause "New" or "Revised" License
294 stars 54 forks source link

Increased number of UMIs per barcode after running remove-background #376

Closed hhvu0102 closed 3 months ago

hhvu0102 commented 3 months ago

Hello,

Thank you for such a great tool!

I have a quick question about the UMI counts per barcode after running remove-background. I noticed that the number of UMIs in my samples went up greatly, sometimes 2 to 5 folds. I used all default parameters for my runs, and use v0.3.0. I saw a thread with a similar issue but it seems like v0.3.0 should have fixed this behavior (https://github.com/broadinstitute/CellBender/issues/338). I have only run cellbender once previously with a different sample, but UMI counts after remove-background generally stayed in a very reasonable range with the raw counts. The learning curve does not seem like the cleanest but the report said it was good enough (see attached plots here lr-default.cellbender.pdf). However, I tried lowering the learning-rate anyway, and it did not help with the discrepancy of UMI counts before and after remove-background. Here is some of the log:

cellbender:remove-background: Command:
cellbender remove-background --cuda --epochs 150 --fpr 0.01 0.05 0.1 --input . --output ./file-hg38.cellbender.h5
cellbender:remove-background: CellBender 0.3.0
cellbender:remove-background: (Workflow hash 5b2151db70)
cellbender:remove-background: 2024-07-18 18:49:13
cellbender:remove-background: Running remove-background
cellbender:remove-background: Loading data from .
cellbender:remove-background: CellRanger v2 format
cellbender:remove-background: Features in dataset: 58962 NA
cellbender:remove-background: Trimming features for inference.
cellbender:remove-background: 40226 features have nonzero counts.
cellbender:remove-background: Prior on counts for cells is 20787
cellbender:remove-background: Prior on counts for empty droplets is 658
cellbender:remove-background: Excluding 21114 features that are estimated to have <= 0.1 background counts in cells.
cellbender:remove-background: Including 19112 features in the analysis.
cellbender:remove-background: Trimming barcodes for inference.
cellbender:remove-background: Excluding barcodes with counts below 329
cellbender:remove-background: Using 5734 probable cell barcodes, plus an additional 18611 barcodes, and 58124 empty droplets.
cellbender:remove-background: Largest surely-empty droplet has 845 UMI counts.
cellbender:remove-background: Attempting to unpack tarball "ckpt.tar.gz" to /tmp/tmpq05us6fc

Have you seen this behavior with remove-background in v0.3.0 before? Do you think it's suggesting some issue with this sample? Thank you so much for your time! I look forward to hearing from you.

hhvu0102 commented 3 months ago

Solved, mistake in the code I used to calculate number of UMIs pre cellbender. Not a cellbender problem.