brentp / slivar

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

Solo analysis, phased data #167

Open karoliinas opened 3 months ago

karoliinas commented 3 months ago

Hi Brent, first of all thank you for the work – Slivar, Mosdepth and Smoove are my go-to tools these days!

I'm currently analysing a rare disease in a cohort of singletons using long-read data, thus most of the variants are phased. Does comp-hets take into account the phase information? Or would you recommend some other method?

Also, I'd need some help on how to select variants present only in the affected samples without family structure? I've been playing around with --sample-expr 'aff_only:sample.every(function(s) { return s.het == s.affected && s.hom_ref == !s.affected }) but keep getting the error unknown attribute:every.

When you get the chance, I'd much appreciate some insight into how to write slivar functions.

Many thanks, a good day to you, sir!

-Karoliina

brentp commented 3 months ago

Hi Karoliina, glad to hear the tools are useful. Slivar does not use phase information. So you'll probably need another script or tool for that. I think you could do it with cyvcf2 or other library pretty easily just checking the order of the alleles and testing all variants in the same gene.

For your expression, sample is not an array, so you only need:

--sample-expr 'aff_only:sample.het && sample.affected && sample.GQ > 20'
karoliinas commented 3 months ago

Right on! I will check cyvcf2, it's one of yours so I'll likely get back to that with more questions.. xD Thanks for the quick response, --sample-expr makes sense now!