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

Migrate gene to new schema #374

Closed alanwilter closed 3 years ago

alanwilter commented 3 years ago

Address part of #371. This is basically done.

Note that it adds new features to gene but to get them, e.g., canonical_peptide or uniprot, in metadata, I'm not sure if we need to change something in public.users_config gene page or it can be done just in the frontend.

see the data json object example for gene TTLL5:

{
    "data": [
        {
            "assembly": "GRCh37",
            "band": "q24.3",
            "biotype": "protein_coding",
            "canonical_peptide": "ENSP00000450713",
            "canonical_transcript": "ENST00000557636",
            "chrom": "14",
            "external_services": [
                {
                    "display": "GnomAD Browser",
                    "href": "http://gnomad.broadinstitute.org/gene/ENSG00000119685"
                },
                {
                    "display": "GeneCards",
                    "href": "http://www.genecards.org/cgi-bin/carddisp.pl?gene=TTLL5"
                }
            ],
            "full_gene_name": "tubulin tyrosine ligase-like family, member 5",
            "gene_id": "ENSG00000119685",
            "gene_name": "TTLL5",
            "genome_browser": [
                {
                    "display": "Ensembl Browser",
                    "href": "http://grch37.ensembl.org/Homo_sapiens/Gene/Summary?g=ENSG00000119685"
                },
                {
                    "display": "UCSC Browser",
                    "href": "http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chr14:76099968-76421421"
                }
            ],
            "hgnc_id": "19963.0",
            "number_of_variants": 335,
            "other": [
                {
                    "display": "Wikipedia",
                    "href": "http://en.wikipedia.org/TTLL5"
                },
                {
                    "display": "Pubmed Search",
                    "href": "http://www.ncbi.nlm.nih.gov/pubmed?term=TTLL5"
                },
                {
                    "display": "Wikigenes",
                    "href": "http://www.wikigenes.org/?search=TTLL5"
                },
                {
                    "display": "GTEx (expression)",
                    "href": "http://www.gtexportal.org/home/gene/TTLL5"
                }
            ],
            "other_names": [
                "KIAA0998",
                "STAMP"
            ],
            "peptide_id": "ENSP00000286650,ENSP00000298832,ENSP00000451946,ENSP00000452524,ENSP00000451917,ENSP00000450713",
            "percentage_gene_gc_content": 40.03,
            "related_hpo": [],
            "start": 76099968,
            "stop": 76421421,
            "strand": 1,
            "transcript_ids": "ENST00000286650,ENST00000298832,ENST00000554510,ENST00000556893,ENST00000556977,ENST00000557636",
            "transcripts": [
                "ENST00000286650@ENSP00000286650@f",
                "ENST00000298832@ENSP00000298832@f",
                "ENST00000554510@ENSP00000451946@f",
                "ENST00000556893@ENSP00000452524@f",
                "ENST00000556977@ENSP00000451917@f",
                "ENST00000557636@ENSP00000450713@t"
            ],
            "uniprot": [
                "Q6EMB2"
            ],
            "version": 15
        }
    ]
}
netlify[bot] commented 3 years ago

:heavy_check_mark: Deploy Preview for phenopolis-dev canceled.

:hammer: Explore the source changes: 689e896f3425a7e0d63d16106af3289d3463d639

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

alanwilter commented 3 years ago

@pontikos Sorry if it seems I spend extra time on these my_genes and my_variants endpoints but they are intertwined with the changes I'm doing for the migration, for example, now statistics is free from old schema, but to have statistics to show one number for the user then to go to the my_blabla page and to see something different, that does not help, besides, the core query that give the stats numbers is essentially the one for all other operations related, be it one gene, all genes or just stats (same for variants). Patients is similar but sorted long ago.

HPO is a completely different beast and for that I agree to wait.

For now, it's just autocomplete.py to refactor (but won't be straightforward I'm afraid).

Last but not least, spent some extra time trying to figure it out why github actions were failing. It happened to be that I really don't know but moving some tests to the end of the queue seem to have sorted the issue. It seems like if the Demo_DB was not fully ready by the time a test requested a specific data.