bedapub / bedapub/besca

Expanded cell filtering for datasets with protein data

Open
#160 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
50
Forks
17
Avg merge
1d 4h
Merged PRs (30d)
3

Description

When citeseq = True and both adata (gene counts) + adata_prot (antibody counts) are loaded, we should include some cell filtering based on the protein counts metric. I already spotted 2 scenarios requiring filtering:

1) If a cell has 0 counts for all antibodies, normalization function `bc.st.clr_normalize(adata_prot, os.path.join(results_folder_citeseq, 'citeseq'))` will raise this error:
```
ValueError: Input matrix cannot have rows with all zeros
```
Suggestion: add a param `min_protein_counts` = 1, so that cells with antibody_counts sum = 0 will be excluded

2) During sample prep antibodies can aggregate leading to exceptionally high counts in few cells (see this [10X note](https://kb.10xgenomics.com/hc/en-us/articles/360042247271-High-fraction-of-reads-coming-from-barcodes-with-very-high-UMI-counts)). 1 solution is to work with the filtered cellranger matrix (which already excludes such cells), another solution (not exclusive) is to include a parameter `max_protein_counts` to exclude cells above a threshold.

**Add in this issue other possible scenarios to be considered.**

_Note: the filtering should be performed at the beginning of besca, so that the gene analysis part has the same cells than the protein analysis._

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the beginning of besca and the call to bc.st.clr_normalize(adata_prot, os.path.join(results_folder_citeseq, 'citeseq')). Determine where protein-based filtering must occur so gene and protein analyses use the same cells. Done means the requested minimum and maximum protein-count handling, plus any agreed additional scenarios, are defined and applied consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.