KarchinLab / open-cravat

A modular annotation tool for genomic variants
MIT License
110 stars 27 forks source link

Filter by allele frequency in Filter Query Builder #149

Closed pmenzel closed 1 year ago

pmenzel commented 1 year ago

Hi,

when trying to filter variants by allele frequency in the OC GUI (Filter > Variant Properties > Query Builder), the dropdowns for VCF Info > Variant AF do not allow setting <= or >=, probably the data type is not set to numeric for this field.

grafik

using open-cravat 2.3.0 via Docker (image 7ca770899dcf)

best wishes, Peter

kmoad commented 1 year ago

That field is string type because for a variant in multiple samples it's a ; delimited list of allele frequencies i.e. 0.625;1.0.

We could make it a float for a vcf with a single sample.

Multi-sample querying on variant AF would be a more complicated. If that's what you're interested in, could you describe what filter you want?

pmenzel commented 1 year ago

I see.. I was only uploading single samples so far.

For multiple samples, it's more tricky of course. One could make it so that the variant is shown as long as at it occurs above the desired AF in at least one of the samples.

kmoad commented 1 year ago

This is now fixed in OpenCRAVAT version 2.3.1 and vcfinfo module version 2.0.0. You will need both. After installing oc 2.3.1, run a module update either in the store tab of the gui, or with oc module update.

This is a partial fix for single-sample vcfs. In a single sample vcf, the Variant AF and other columns in VCF Info group will have the right types and are filterable. In multi-sample vcfs, the VCF Info cannot be used in filters. This is to avoid confusion.

We're working on a way to enable VAF, Phred, etc filtering in multi-sample VCFs, but it's difficult to do with our architecture.

https://github.com/KarchinLab/open-cravat-modules-karchinlab/commit/cc25bc99036b373282618d6583b4f89804559a43 https://github.com/KarchinLab/open-cravat/commit/5e4209f4f390bc842fea887edbb508e6f65c64f5 https://github.com/KarchinLab/open-cravat/commit/fcb5d459d2d0a519879714881a71e66906e84216