Cohort node - minimum sample count per gene (not per variant)
- Dominant language
- Python
- Stars
- 30
- Forks
- 3
- Avg merge
- 9h 28m
- Merged PRs (30d)
- 42
Description
🤖 Written by Claude
Split out of #24 (2020 wishlist), which is now closed.
### Ask
Cohort node minimum counts are per-variant: "this variant is het/hom in at least N samples". We also want per-gene: **"at least N samples have *some* qualifying variant in this gene"**.
That's a different shape of query - it aggregates the node's variants up to gene level, then filters variants back down to the genes that pass.
### Where the pieces already are
- `AbstractZygosityCountNode.get_zygosity_count_arg_q_dict()` (`analysis/models/nodes/zygosity_count_node.py`) - the current per-variant min/max counts, on `CohortNode` and `AllVariantsNode`.
- `NodeGenesCountCollection.get_or_create_gene_counts_qs_for_node()` (`analysis/models/gene_counts.py`) - already does node → per-gene counts, and `ZygosityNode` uses it for compound het (`gene_counts_qs.filter(count__gte=2).values('gene_id')`). That is the closest existing pattern, though it counts variants per gene rather than samples per gene.
### Open questions
- Does a sample count per gene need its own collection/cache, or can `NodeGenesCountCollection` be extended?
- Which node does this live on - `CohortNode`'s Counts accordion, or its own filter node (cf. #406 Gene based analysis)?
- Transcript vs gene-level aggregation, given #297.
Related: #406, #297.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading AbstractZygosityCountNode.get_zygosity_count_arg_q_dict() in analysis/models/nodes/zygosity_count_node.py and NodeGenesCountCollection.get_or_create_gene_counts_qs_for_node() in analysis/models/gene_counts.py. Compare the existing ZygosityNode compound-het pattern, then resolve the collection, node placement, and transcript-versus-gene questions. Done means cohort filtering supports a minimum sample count for qualifying variants aggregated per gene.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100