robinandeer / puzzle

Variant caller GUI + genetic disease analysis
https://robinandeer.gitbooks.io/puzzle/content/
MIT License
22 stars 7 forks source link

Access gemini's --gt-filter for custom queries in gemini adapter? #167

Open vasiliosz opened 8 years ago

vasiliosz commented 8 years ago

I use these all the time when working directly against gemini. http://gemini.readthedocs.org/en/latest/content/querying.html#gt-filter-filtering-on-genotypes

For example:

gemini query --header \
-q "SELECT chrom,start,end,gene,impact,impact_severity,codon_change,aa_change,aa_length, \
    cadd_scaled,clinvar_gene_phenotype,(gts).(*),(gt_ref_depths).(*),(gt_alt_depths).(*) \
    FROM variants WHERE (max_aaf_all<=0.005 AND impact_severity!='LOW')" \
--gt-filter "(gt_types).(phenotype==2).(!=HOM_REF).(all) and \
    (gt_types).(phenotype==1).(!=HOM_REF).(count==1)" gemini.db
vasiliosz commented 8 years ago

Or similar filters when using the built-in tools of gemini

gemini de_novo \
      --columns "chrom, start, end, ref, alt" \
      --filter "impact_severity != 'LOW' and max_aaf_all <= 0.005" \
      --gt-pl-max 10 \
      gemini.db
moonso commented 8 years ago

Sure this will be relevant when we add functionality for doing analysis on multiple families/individuals at the same time

vasiliosz commented 8 years ago

Relevant for single families (trios for example), but maybe that's what you mean.

moonso commented 8 years ago

So @vasiliosz is this a way to build inheritance queries in sql format? We hope to be able to use the built in tools from the python api, think @guillermo-carrasco is looking at that...

vasiliosz commented 8 years ago

It works as an extension of both "normal" queries (via the -q flag) and the "built-in tools" (such as de_novo, comp_hets, etc)