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

Get Started Wizard #18

Open
1 task
chrtannus opened this issue May 8, 2024 · 4 comments
Open
1 task

Get Started Wizard #18

chrtannus opened this issue May 8, 2024 · 4 comments
Assignees

Comments

@chrtannus
Copy link
Member

Wizard (or cards) appears after the user clicks the Get Started button:

  • Add three, stubbed out, simple, initial cards -- one for genes, one for enrichment, one for network
get-started-sketch
@chrtannus
Copy link
Member Author

  1. Should we limit the number of query genes (e.g. 20)?
  2. What about the the number of gene cards?

@chrtannus
Copy link
Member Author

By the way, Pathway Commons has an API endpoint for gene info--including a nice description and useful link outs--which is used by the PC web app to show the gene info when clicking a node:

pc-node-info

If you use an app such as Postman to send a POST to https://apps.pathwaycommons.org/api/search/genes with {"query":"TP53"} as the request body, it returns this json:

[
    {
        "query": "TP53",
        "geneSymbol": "TP53",
        "summary": {
            "namespace": "ncbigene",
            "displayName": "tumor protein p53",
            "localId": "7157",
            "description": "This gene encodes a tumor suppressor protein containing transcriptional activation, DNA binding, and oligomerization domains. The encoded protein responds to diverse cellular stresses to regulate expression of target genes, thereby inducing cell cycle arrest, apoptosis, senescence, DNA repair, or changes in metabolism. Mutations in this gene are associated with a variety of human cancers, including hereditary cancers such as Li-Fraumeni syndrome. Alternative splicing of this gene and the use of alternate promoters result in multiple transcript variants and isoforms. Additional isoforms have also been shown to result from the use of alternate translation initiation codons from identical transcript variants (PMIDs: 12032546, 20937277). [provided by RefSeq, Dec 2016]",
            "aliases": [
                "cellular tumor antigen p53",
                "antigen NY-CO-13",
                "mutant tumor protein 53",
                "phosphoprotein p53",
                "transformation-related protein 53",
                "tumor protein 53",
                "tumor supressor p53"
            ],
            "aliasIds": [
                "BCC7",
                "BMFS5",
                "LFS1",
                "P53",
                "TRP53"
            ],
            "xrefLinks": [
                {
                    "namespace": "hgnc.symbol",
                    "uri": "http://bioregistry.io/hgnc.symbol:TP53"
                },
                {
                    "namespace": "genecards",
                    "uri": "http://bioregistry.io/genecards:TP53"
                },
                {
                    "namespace": "ncbigene",
                    "uri": "http://bioregistry.io/ncbigene:7157"
                },
                {
                    "uri": "http://bioregistry.io/uniprot:P04637.300",
                    "namespace": "uniprot"
                }
            ]
        }
    }
]

However, when I tried to fetch it from the Cytoscape Home UI, I got this error:

Access to fetch at 'https://apps.pathwaycommons.org/api/search/genes' from origin 
'http://localhost:5173' has been blocked by CORS policy: Response to preflight request 
doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present 
on the requested resource. 
If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch 
the resource with CORS disabled.

Setting mode to 'no-cors', as suggested, did not work--it just returns this error:

https://apps.pathwaycommons.org/api/search/genes 500 (Internal Server Error)

This is the JS code:

    const response = await fetch('https://apps.pathwaycommons.org/api/search/genes', {
      method: 'POST',
      mode: 'no-cors',
      body: JSON.stringify({
        query: 'TP53',
      }),
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
      },
    });

Anyway, It would be nice to use this endpoint for the gene cards, but because the fetch is done by the client side, the browser is blocking this cross-domain request.
I guess we only have 2 options here:

  1. Add a server (e.g. Express) to our project, so it can be used as a proxy to avoid the browser's preflight request and the consequent CORS issue.
  2. Change the Pathway Commons server to allow requests by our app's domain, though I'm not sure what we need to configure for it to accept requests from our development ('localhost') instances as well.

@chrtannus
Copy link
Member Author

Initial version of the Gene Analysis Results:

GeneAnalysisResults

chrtannus added a commit that referenced this issue Jul 16, 2024
…ns EM-Web and Cytoscape Web); a few minor UI improvements and fixes -- #18
chrtannus added a commit that referenced this issue Jul 17, 2024
…cytoscape div).

Destroys Cytoscape when component unmounts.
Prevents Cytoscape from being created (async function) if component unmounted.
-- #18
chrtannus added a commit that referenced this issue Jul 18, 2024
…cause the browsers require an https request/fetch -- #18
@chrtannus
Copy link
Member Author

New version of the Gene Analysis results -- removes the Gene cards, adds NDEx networks card:

results-ndex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant