Skip to content

Cohort node - minimum sample count per gene (not per variant) #1807

Description

@davmlaw

🤖 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

Related: #406, #297.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions