You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One thing to note is how the query is sorting the results, by CHROM, pos, etc.:
-- def _get_variants(target: str):select
array_agg(distinct iv.zygosityorder byiv.zygosity) as zigosity,
array_agg(distinct concat(g.hgnc_symbol,'@',g.ensembl_gene_id)) as genes, -- to splitv.chromas"CHROM", v.posas"POS", v."ref"as"REF", v.altas"ALT", v.cadd_phred, v.dann,
v.fathmm_score, v.revel, -- new added-- removed: v.idvg.most_severe_consequence, string_agg(distinct vg.hgvs_c,','order byvg.hgvs_c) as hgvsc,
string_agg(distinct vg.hgvs_p,','order byvg.hgvs_p) as hgvsp, -- via variant_geneiv.dpas"DP", iv."fs"as"FS", iv.mqas"MQ", iv."filter"as"FILTER", -- via individual_variant
(
select array_agg(i.phenopolis_idorder byi.id)
fromphenopolis.individual i
joinphenopolis.individual_variant iv2 oniv2.individual_id=i.idandiv2.zygosity='HOM'wherev.id=iv2.variant_id
) as"HOM",
(
select array_agg(i.phenopolis_idorder byi.id)
fromphenopolis.individual i
joinphenopolis.individual_variant iv2 oniv2.individual_id=i.idandiv2.zygosity='HET'wherev.id=iv2.variant_id
) as"HET",
(
select distincton (ah.chrom,ah.pos,ah."ref",ah.alt) ah.affromkaviar.annotation_hg19 ah
whereah.chrom=v.chromandah.pos=v.posand ah."ref"= v."ref"andah.alt=v.altorder byah.chrom,ah.pos,ah."ref",ah.alt,ah.acdesc
) as af_kaviar,
av.afas af_gnomad_genomes -- gnomad # NOTE: missing strand?-- deprecated: MLEAF, MLEAC-- need to be added (by Daniele): af_converge, af_hgvd, af_jirdc, af_krgdb, af_tommo,fromphenopolis.variant v
joinphenopolis.individual_variant iv oniv.variant_id=v.idjoinphenopolis.individual i2 oni2.id=iv.individual_idleft outer joinphenopolis.variant_gene vg onvg.variant_id=v.id-- variant_gene not complete?left outer joinensembl.gene g onvg.gene_id=g.ensembl_gene_idandg.assembly='GRCh37'andg.chromosome ~ '^X|^Y|^[0-9]{1,2}'left outer joingnomad.annotation_v3 av
onav.chrom=v.chromandav.pos=v.posand av."ref"= v."ref"andav.alt=v.alt--where v.chrom = '12' and v.pos = 7241974 and v."ref" = 'C' and v.alt = 'T' -- 2 rows--where v.chrom = '7' and v.pos = 2303057 and v."ref" = 'G' and v.alt = 'A' -- 1 row--where i2.phenopolis_id = 'PH00008256'--where vg.gene_id = 'ENSG00000144285'wherei2.phenopolis_id='PH00008697'group by"CHROM","POS","REF","ALT",cadd_phred,dann,fathmm_score,revel,most_severe_consequence,
"DP","FS","MQ","FILTER", -- need for array_agg but disambiguates depending on individual_variant"HOM","HET",af_kaviar,af_gnomad_genomes
order bysubstring(v.chromFROM'([0-9]+)')::int,
v.pos, v."ref", v.alt, iv.dpdesclimit10000 offset 0-- attempt to paginate
;
In this way, zigosityHET and HOM can be alternated in rows, so individual page, which has 3 tabs: RARE HOMOZYGOTES, RARE COMPOUND HETEROZYGOTES AND RARE HETEROZYGOTES, may not paginate as desired.
I'm investigating a better solution. Perhaps pagination could be better done in def _individual_complete_view(...) rather than in the query above since it's there where rare_comp_hets are processed.
The text was updated successfully, but these errors were encountered:
Spin off from #342.
Query in
variant.py
:def _get_variants(target: str):
need to have pagination since some patients, like http://dev-live.phenopolis.org/individual/PH00008697 has tens of thousands of variants.One thing to note is how the query is sorting the results, by CHROM, pos, etc.:
In this way,
zigosity
HET
andHOM
can be alternated in rows, soindividual
page, which has 3 tabs:RARE HOMOZYGOTES
,RARE COMPOUND HETEROZYGOTES
ANDRARE HETEROZYGOTES
, may not paginate as desired.I'm investigating a better solution. Perhaps pagination could be better done in
def _individual_complete_view(...)
rather than in the query above since it's there whererare_comp_hets
are processed.The text was updated successfully, but these errors were encountered: