brentp / slivar

genetic variant expressions, annotation, and filtering for great good.
MIT License
248 stars 23 forks source link

Variant-Level labelling #121

Closed MattWellie closed 2 years ago

MattWellie commented 2 years ago

(There may be something related to this in the documentation, but I've not been able to find it)

I would like to use Slivar for a classification workflow. There will be a first-pass assigning categories to variants based principally consequence and frequency annotations. There will be a number of different filters applied, each for a different 'class', which will result in variant labelling.

So far I can implement this using:

Is there a way using only Slivar to apply variant-level labels to variants, in the same way that the family/group/sample expressions are able to apply the results to the VCF output? Those expressions are technically usable, but they add every sample's ID into the resulting field if the filter only includes variant-level attributes.

e.g. I would like to be able to use

slivar \
  -v VCF \
  -j JS \
  -p PED \
  --info '<basic filters>' \
  --variant-expr 'ClassA:passes_class_a(variant)' \
  --variant-expr 'ClassB:passes_class_b(variant)'

and a flag "ClassA" or "ClassB" would be annotated into the INFO of relevant variants.

brentp commented 2 years ago

Hi, that's not possible currently. I see the utility, but it would be a lot of work to add. I'll have a look at the code in the next few weeks, but I suggest to find another way to do it.