Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dahsboard APIs for statistics panel #169

Closed
2 tasks done
YuanTian1991 opened this issue Aug 23, 2020 · 10 comments
Closed
2 tasks done

Dahsboard APIs for statistics panel #169

YuanTian1991 opened this issue Aug 23, 2020 · 10 comments
Assignees

Comments

@YuanTian1991
Copy link
Collaborator

YuanTian1991 commented Aug 23, 2020

Based on current front-end progress, 2 more API is needed:

  1. For the dashboard, we are going to show the number of genes/hpo/patient/variants one user have access to. So one API is needed.
    image
  • This is done
  1. A API to get all individual record, this is to allow admin to view/delete/update patients. (similar to current myPatient page below, but I hope contains all individual information, like external_id .etg), which is not for users to view, but for Admin management.

image

Please return the data in the format as other table format (gene/hpo/individual), to fit in the complex front-end table

  • This is done

Personally, I hope to have an additional two API below, but the above two are important:

  1. Similar to 2, A API to fetch all genes one user could have, there is a gene list table going to be shows, similar to patient table we have now.

  2. Similar to 2, A API to fetch all hpo one user could have, there is a hpo list table going to be shows, similar to patient table we have now.

@pontikos
Copy link
Contributor

hi @YuanTian1991 thanks for this. I like the UI for the new dashboard! I think we should split the issue up into several issues though.

@pontikos
Copy link
Contributor

I think except for the statistic panel this is is done?

@YuanTian1991
Copy link
Collaborator Author

Um...in theory, I hope to create other 3 pages like myPatient page, showing all user available genes/hpo/variant. As you can see, there is a "VIEW DETAILS" button in each block. Are these APIs ready?

If it's too complicated, I can remove these buttons, and yes if so, only the statistic panel is not yet done.

@pontikos pontikos changed the title New APIs required Dahsboard APIs for statistics panel May 18, 2021
@pontikos pontikos added this to the Fast API milestone May 18, 2021
@alanwilter
Copy link
Collaborator

Ok, I'm working on it.

@alanwilter
Copy link
Collaborator

alanwilter commented May 26, 2021

I need to do:

  • 1. Create an endpoint to return all Genes for a given user;
  • 2. Create an endpoint to return all HPOs for a given user;
  • 3. Create an endpoint to return all Variants for a given user.

However, I need to check which conflicts these actions may have with refactoring of the code for migrating to new schema. I won't invest time creating endpoints that may still use the old schema.

@alanwilter
Copy link
Collaborator

alanwilter commented Jun 16, 2021

Gene is addressed by #374

But @YuanTian1991, when one does http:https://localhost:8888/api/my_genes (as demo user in Demo_DB) the gene objects does not have the transcripts expanded as when one does http:https://localhost:8888/gene/ENSG00000119685.

So endpoint my_genes is currently providing this::

[ { "assembly": "GRCh37", "band": "q21.2", "biotype": "protein_coding", "chrom": "17", "full_gene_name": "gastrin", "gene_id": "ENSG00000184502", "gene_name": "GAST", "hgnc_id": "4164.0", "other_names": [ "GAS" ], "percentage_gene_gc_content": 49.73, "start": 39868578, "stop": 39872221, "strand": 1, "transcripts": [ "ENST00000329402@ENSP00000331358@t" ], "uniprot": [ "P01350" ], "version": 3 }, { "assembly": "GRCh37", "band": "q24.3", "biotype": "protein_coding", "chrom": "14", "full_gene_name": "tubulin tyrosine ligase-like family, member 5", "gene_id": "ENSG00000119685", "gene_name": "TTLL5", "hgnc_id": "19963.0", "other_names": [ "KIAA0998", "STAMP" ], "percentage_gene_gc_content": 40.03, "start": 76099968, "stop": 76421421, "strand": 1, "transcripts": [ "ENST00000286650@ENSP00000286650@f", "ENST00000298832@ENSP00000298832@f", "ENST00000554510@ENSP00000451946@f", "ENST00000556893@ENSP00000452524@f", "ENST00000556977@ENSP00000451917@f", "ENST00000557636@ENSP00000450713@t" ], "uniprot": [ "Q6EMB2" ], "version": 15 }, { "assembly": "GRCh37", "band": "p13.3", "biotype": "protein_coding", "chrom": "1", "full_gene_name": "DNA-damage regulated autophagy modulator 2", "gene_id": "ENSG00000156171", "gene_name": "DRAM2", "hgnc_id": "28769.0", "other_names": [ "MGC54289", "PRO180", "RP5-1180E21.1", "TMEM77", "WWFQ154" ], "percentage_gene_gc_content": 37.94, "start": 111659955, "stop": 111682838, "strand": -1, "transcripts": [ "ENST00000286692@ENSP00000286692@f", "ENST00000539140@ENSP00000437718@t" ], "uniprot": [ "Q6UX65" ], "version": 10 } ]

Transcripts json objects are in a compact form (as the result of the query in the new schema):

        "transcripts": [
            "ENST00000286692@ENSP00000286692@f",
            "ENST00000539140@ENSP00000437718@t"
        ],

where @ split the fields and the last value is either t (True) or f (False) for canonical. So this could either be easily processed in the javascript side of python side, I just want to to know what would you guys @pontikos and @YuanTian1991 would like to see in the my_genes page table.

@alanwilter
Copy link
Collaborator

@pontikos I'm working on my_variants endpoint and I realise I need some input here. Get the list of variants and display in with chips in a table is no big deal, but I'm wondering what else you'd like to see there? Which other attributes you'd like to see in the variants table? I don't think giving all one sees in the variant page (that have 5 tabs, from frequency to genotypes) seem reasonable.

So I'd ask you to look at the variant page, e.g., https://dev-live.phenopolis.org/variant/12-7241974-C-T, and tell me what you'd like to see in a summarised table for my_variants page.

And note I chose variant 12-7241974-C-T on purpose because it has different attributes depending on the patient.

@pontikos
Copy link
Contributor

Hi @alanwilter don't spend too long on this issues as my_genes and and my_variants are not very important pages for now.

my_gene should be a list of genes that are candidate genes for my_patients
So in the case of demo user this should be DRAM2 and TTLL5.
The columns should be gene name and individuals. For demo each gene row will have two individuals.

my_variants should be a list of variants that are candidate variants for my_patients
I am aware for now we don't have any candidate variants at the moment, but we will have.
Again columns like the variant columns from the variants tables.

So both pages just simple tables, no extra tabs needed.

@alanwilter
Copy link
Collaborator

See my comments at #374. I'm done with that for moment and HPO will definitely wait.

For now (demo user):

https://dev-live.phenopolis.org/api/my_genes

gives:

[
    {
        "assembly": "GRCh37",
        "band": "q24.3",
        "biotype": "protein_coding",
        "chrom": "14",
        "full_gene_name": "tubulin tyrosine ligase-like family, member 5",
        "gene_id": "ENSG00000119685",
        "gene_symbol": [
            {
                "display": "TTLL5"
            }
        ],
        "hgnc_id": "19963.0",
        "other_names": [
            "KIAA0998",
            "STAMP"
        ],
        "percentage_gene_gc_content": 40.03,
        "start": 76099968,
        "stop": 76421421,
        "strand": 1,
        "transcripts": [
            "ENST00000286650@ENSP00000286650@f",
            "ENST00000298832@ENSP00000298832@f",
            "ENST00000554510@ENSP00000451946@f",
            "ENST00000556893@ENSP00000452524@f",
            "ENST00000556977@ENSP00000451917@f",
            "ENST00000557636@ENSP00000450713@t"
        ],
        "uniprot": [
            "Q6EMB2"
        ],
        "version": 15
    },
    {
        "assembly": "GRCh37",
        "band": "p13.3",
        "biotype": "protein_coding",
        "chrom": "1",
        "full_gene_name": "DNA-damage regulated autophagy modulator 2",
        "gene_id": "ENSG00000156171",
        "gene_symbol": [
            {
                "display": "DRAM2"
            }
        ],
        "hgnc_id": "28769.0",
        "other_names": [
            "MGC54289",
            "PRO180",
            "RP5-1180E21.1",
            "TMEM77",
            "WWFQ154"
        ],
        "percentage_gene_gc_content": 37.94,
        "start": 111659955,
        "stop": 111682838,
        "strand": -1,
        "transcripts": [
            "ENST00000286692@ENSP00000286692@f",
            "ENST00000539140@ENSP00000437718@t"
        ],
        "uniprot": [
            "Q6UX65"
        ],
        "version": 10
    }
]

https://dev-live.phenopolis.org/api/my_variants?limit=3

gives:

[
    {
        "ALT": "TC",
        "CHROM": "22",
        "POS": 32044245,
        "REF": "T",
        "cadd_phred": null,
        "dann": null,
        "dbsnp": null,
        "fathmm_score": null,
        "revel": null,
        "variant_class": null,
        "variant_id": [
            {
                "display": "22-32044245-T-TC",
                "end_href": "22-32044245-T-TC"
            }
        ]
    },
    {
        "ALT": "A",
        "CHROM": "9",
        "POS": 116798763,
        "REF": "G",
        "cadd_phred": null,
        "dann": null,
        "dbsnp": null,
        "fathmm_score": null,
        "revel": null,
        "variant_class": null,
        "variant_id": [
            {
                "display": "9-116798763-G-A",
                "end_href": "9-116798763-G-A"
            }
        ]
    },
    {
        "ALT": "A",
        "CHROM": "14",
        "POS": 95236097,
        "REF": "C",
        "cadd_phred": null,
        "dann": null,
        "dbsnp": null,
        "fathmm_score": null,
        "revel": null,
        "variant_class": null,
        "variant_id": [
            {
                "display": "14-95236097-C-A",
                "end_href": "14-95236097-C-A"
            }
        ]
    }
]

These endpoints make automatic use of limit (default 10) and offset. For example, demo user has 4099 variants (https://dev-live.phenopolis.org/api/my_variants?limit=6000).

@alanwilter alanwilter pinned this issue Jun 22, 2021
alanwilter added a commit that referenced this issue Nov 11, 2021
@alanwilter
Copy link
Collaborator

alanwilter commented Nov 11, 2021

HPOs for demo user:

https://dev-live.phenopolis.org/api/my_hpos?limit=3

gives:

[
    {
        "hpo_id": "HP:0000479",
        "name": "Abnormal retinal morphology"
    },
    {
        "hpo_id": "HP:0000003",
        "name": "Multicystic kidney dysplasia"
    },
    {
        "hpo_id": "HP:0007754",
        "name": "Macular dystrophy"
    }
]

alanwilter added a commit that referenced this issue Nov 11, 2021
* More tests for variants

* Add test for enabling a non-existing user

* Add my_hpos endpoint #169
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants