phenopolis / phenopolis_genomics_browser

Python API and React frontend for the Phenopolis Genomics Browser
https://dev-live.phenopolis.org
MIT License
31 stars 2 forks source link

An attempt to migrate variants to new schema #340

Closed alanwilter closed 3 years ago

alanwilter commented 3 years ago

Considering to MERGE!

HOWEVER: some patients like PH00000168 may not work without limit and offset parameters, it's just too many rows, tens of thousands. See #342 for details.

Though it pass all pytest and new function _get_variants() works for "gene web view", it fails for "variant web view" very awkwardly:

....
frontend_1  | ��� Proxying to http://host.docker.internal:5000/variant/14-76156575-A-G
frontend_1  | [HPM] Proxy created: /  -> http://host.docker.internal:5000
db_1        | 2021-04-27 19:57:02.444 UTC [38] LOG:  unexpected EOF on client connection with an open transaction
db_1        | 2021-04-27 19:57:02.445 UTC [43] LOG:  unexpected EOF on client connection with an open transaction
db_1        | 2021-04-27 19:57:02.455 UTC [31] LOG:  unexpected EOF on client connection with an open transaction
app_1       | sh: line 1:    12 Segmentation fault      python3 /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 -m flask run --no-debugger --no-reload --host 0.0.0.0 --port 5000
db_1        | 2021-04-27 19:57:02.457 UTC [34] LOG:  unexpected EOF on client connection with an open transaction
frontend_1  | [HPM] Error occurred while trying to proxy request /variant/14-76156575-A-G from localhost:8888 to http://host.docker.internal:5000 (ECONNRESET) (https://nodejs.org/api/errors.html#errors_common_system_errors)

UPDATE: the real issue here is cyvcf2 on my Mac.

netlify[bot] commented 3 years ago

:heavy_check_mark: Deploy Preview for phenopolis-dev canceled.

:hammer: Explore the source changes: a8351c2eff642373ec9f67d660f13a4d50f3c9dc

:mag: Inspect the deploy log: https://app.netlify.com/sites/phenopolis-dev/deploys/60b95abcb904940007c428e8

alanwilter commented 3 years ago

Running via curl and all seems to work fine:

curl -c cookies.txt --header "Content-Type: application/json" \
  --request POST \
  --data '{"user": "Admin","password": "admin123"}' \
  http://localhost:5000/login

curl -b cookies.txt --header "Content-Type: application/json" \
  --request GET \
  http://localhost:8888/api/variant/14-76113806-T-C
Click here to see full JSON result

```yaml { "consequence": { "colNames": [ { "default": "true", "description": "HGVS cDNA mutation", "key": "hgvsc", "name": "HGVSc" }, { "default": "true", "description": "HGVS protein mutation", "key": "hgvsp", "name": "HGVSp" }, { "default": "true", "description": "DANN score", "key": "dann", "name": "DANN" }, { "default": "true", "description": "Strand on which lies variant", "key": "FS", "name": "strand" }, { "default": "true", "description": "Transcript on which lies variant", "key": "transcript", "name": "transcript" }, { "default": "true", "description": "Protein encoded by transcript", "key": "protein", "name": "protein" }, { "default": "true", "description": "Consequence of variant on transcript", "key": "consequence_terms", "name": "consequence terms" }, { "default": "true", "description": "Impact of variant on transcript", "key": "impact", "name": "impact" }, { "default": true, "description": "Combined Annotation Dependent Depletion", "key": "cadd_phred", "name": "CADD" }, { "default": "true", "description": "Polyphen score", "key": "polyphen", "name": "polyphen" }, { "default": "true", "description": "SIFT score", "key": "sift", "name": "sift" }, { "default": "true", "description": "Carol score", "key": "carol", "name": "carol" } ], "data": [ { "AC": 2, "AF": 1.0, "ALT": "C", "AN": 2, "CHROM": "14", "DP": 1, "FILTER": "PASS", "FS": 0.0, "HET": [], "HET_COUNT": 0, "HOM": [ { "display": "PH00008727", "end_href": "PH00008727" } ], "HOM_COUNT": 1, "ID": "", "MLEAC": "", "MLEAF": "", "MQ": 60.0, "POS": 76113806, "REF": "T", "af_converge": "", "af_gnomad_genomes": null, "af_hgvd": "", "af_jirdc": "", "af_kaviar": null, "af_krgdb": "", "af_tommo": "", "cadd_phred": null, "dann": null, "fathmm_score": null, "gene_id": ",ENSG00000119685", "gene_symbol": [ { "display": "TTLL5" } ], "genes": [ "@", "TTLL5@ENSG00000119685" ], "hgvsc": "ENST00000238667.4:c.*991T>C,ENST00000556265.1:n.176+12450T>C", "hgvsp": null, "most_severe_consequence": "3_prime_UTR_variant", "revel": null, "variant_id": [ { "display": "14-76113806-T-C", "end_href": "14-76113806-T-C" } ], "zigosity": [ "HOM" ] } ] }, "frequency": { "colNames": [ { "default": "true", "description": "Allele count in Phenopolis", "key": "AC", "name": "AC" }, { "default": "true", "description": "Allele frequency in Phenopolis", "key": "AF", "name": "AF" }, { "default": "true", "description": "Number of alleles in Phenopolis", "key": "an", "name": "AN" }, { "default": "true", "description": "Number of heterozygote individuals in Phenopolis", "key": "HET_COUNT", "name": "Het Count" }, { "default": "true", "description": "Number of homozygote individuals in Phenopolis", "key": "HOM_COUNT", "name": "Hom Count" }, { "default": true, "description": "Allele frequency in the KAVIAR database", "key": "af_kaviar", "name": "AF Kaviar" }, { "default": "true", "description": "Allele frequency in the GnomAD database", "key": "af_gnomad_genomes", "name": "AF Gnomad" }, { "default": "true", "description": "Allele frequency in HGVD database", "key": "af_hgvd", "name": "AF HGVD" }, { "default": "true", "description": "Allele frequency in KRGDB database", "key": "af_krgdb", "name": "AF KRGDB" }, { "default": "true", "description": "Allele frequency in the Japanese Inherited Retinal Disease Consortium", "key": "af_jirdc", "name": "AF JIRDC" }, { "default": "true", "description": "Allele frequency in the Tommo database", "key": "af_tommo", "name": "AF TOMMO" } ], "data": [ { "AC": 2, "AF": 1.0, "ALT": "C", "AN": 2, "CHROM": "14", "DP": 1, "FILTER": "PASS", "FS": 0.0, "HET": [], "HET_COUNT": 0, "HOM": [ { "display": "PH00008727", "end_href": "PH00008727" } ], "HOM_COUNT": 1, "ID": "", "MLEAC": "", "MLEAF": "", "MQ": 60.0, "POS": 76113806, "REF": "T", "af_converge": "", "af_gnomad_genomes": null, "af_hgvd": "", "af_jirdc": "", "af_kaviar": null, "af_krgdb": "", "af_tommo": "", "cadd_phred": null, "dann": null, "fathmm_score": null, "gene_id": ",ENSG00000119685", "gene_symbol": [ { "display": "TTLL5" } ], "genes": [ "@", "TTLL5@ENSG00000119685" ], "hgvsc": "ENST00000238667.4:c.*991T>C,ENST00000556265.1:n.176+12450T>C", "hgvsp": null, "most_severe_consequence": "3_prime_UTR_variant", "revel": null, "variant_id": [ { "display": "14-76113806-T-C", "end_href": "14-76113806-T-C" } ], "zigosity": [ "HOM" ] } ] }, "genotypes": { "colNames": [ { "base_href": "/individual/", "class": "preview_onhover", "default": "true", "description": "Individuals", "key": "sample", "name": "Individuals", "type": "links" }, { "default": "true", "description": "Genotypes", "key": "GT", "name": "Genotypes" }, { "default": "true", "description": "Allele Depth", "key": "AD", "name": "Allele Depth" }, { "default": "true", "description": "Total Depth", "key": "DP", "name": "Total Depth" } ], "data": [ { "AD": [ 0, 0 ], "DP": 0, "GT": [ null, null ], "sample": [ { "display": "PH00008256" } ] }, { "AD": [ 0, 0 ], "DP": 0, "GT": [ null, null ], "sample": [ { "display": "PH00008258" } ] }, { "AD": [ 0, 0 ], "DP": 0, "GT": [ null, null ], "sample": [ { "display": "PH00008267" } ] }, { "AD": [ 0, 0 ], "DP": 0, "GT": [ null, null ], "sample": [ { "display": "PH00008268" } ] } ] }, "individuals": { "colNames": [ { "base_href": "/individual/", "class": "preview_onhover", "default": "true", "description": "Individuals who are homozygous", "key": "HOM", "name": "HOM", "type": "links" }, { "base_href": "/individual/", "class": "preview_onhover", "default": "true", "description": "Individuals how are heterozygous", "key": "HET", "name": "HET", "type": "links" } ], "data": [ { "AC": 2, "AF": 1.0, "ALT": "C", "AN": 2, "CHROM": "14", "DP": 1, "FILTER": "PASS", "FS": 0.0, "HET": [], "HET_COUNT": 0, "HOM": [ { "display": "PH00008727", "end_href": "PH00008727" } ], "HOM_COUNT": 1, "ID": "", "MLEAC": "", "MLEAF": "", "MQ": 60.0, "POS": 76113806, "REF": "T", "af_converge": "", "af_gnomad_genomes": null, "af_hgvd": "", "af_jirdc": "", "af_kaviar": null, "af_krgdb": "", "af_tommo": "", "cadd_phred": null, "dann": null, "fathmm_score": null, "gene_id": ",ENSG00000119685", "gene_symbol": [ { "display": "TTLL5" } ], "genes": [ "@", "TTLL5@ENSG00000119685" ], "hgvsc": "ENST00000238667.4:c.*991T>C,ENST00000556265.1:n.176+12450T>C", "hgvsp": null, "most_severe_consequence": "3_prime_UTR_variant", "revel": null, "variant_id": [ { "display": "14-76113806-T-C", "end_href": "14-76113806-T-C" } ], "zigosity": [ "HOM" ] } ] }, "metadata": { "colNames": [ { "default": "true", "description": "", "key": "FILTER", "name": "Filter Status" }, { "base_href": "/gene/", "default": "true", "description": "", "key": "gene_symbol", "name": "Gene", "type": "links" }, { "default": "true", "description": "", "key": "most_severe_consequence", "name": "Consequence" }, { "default": "true", "description": "HGVS cDNA mutation", "key": "hgvsc", "name": "HGVSc" }, { "default": "true", "description": "HGVS protein mutation", "key": "hgvsp", "name": "HGVSp" }, { "default": "true", "description": "SNP in db", "key": "dbsnp", "name": "dbSNP" }, { "default": "true", "description": "Allele frequency in Phenopolis", "key": "AF", "name": "Allele Frequency" }, { "default": "true", "description": "Allele count in Phenopolis", "key": "AC", "name": "Allele Count" }, { "default": "true", "description": "Allele frequency in KAVIAR", "key": "af_kaviar", "name": "Kaviar" } ], "data": [ { "AC": 2, "AF": 1.0, "ALT": "C", "AN": 2, "CHROM": "14", "DP": 1, "FILTER": "PASS", "FS": 0.0, "HET": [], "HET_COUNT": 0, "HOM": [ { "display": "PH00008727", "end_href": "PH00008727" } ], "HOM_COUNT": 1, "ID": "", "MLEAC": "", "MLEAF": "", "MQ": 60.0, "POS": 76113806, "REF": "T", "af_converge": "", "af_gnomad_genomes": null, "af_hgvd": "", "af_jirdc": "", "af_kaviar": null, "af_krgdb": "", "af_tommo": "", "cadd_phred": null, "dann": null, "fathmm_score": null, "gene_id": ",ENSG00000119685", "gene_symbol": [ { "display": "TTLL5" } ], "genes": [ "@", "TTLL5@ENSG00000119685" ], "hgvsc": "ENST00000238667.4:c.*991T>C,ENST00000556265.1:n.176+12450T>C", "hgvsp": null, "most_severe_consequence": "3_prime_UTR_variant", "revel": null, "variant_id": [ { "display": "14-76113806-T-C", "end_href": "14-76113806-T-C" } ], "zigosity": [ "HOM" ] } ] }, "preview": [], "quality": { "colNames": [], "data": [] } } ```

alanwilter commented 3 years ago

I've just found out that though https://dev-live.phenopolis.org/variant/14-76156575-A-G may work, dev-live on localhost won't work with Firefox (http://localhost:8888/variant/14-76156575-A-G), yet it does with Safari and Chrome.

Whatever is the source of this issue, it is already in the code and I may rewind some commits till find out one where Firefox won't complain.