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 gene sequence #2643

Open
mictadlo opened this issue Mar 10, 2022 · 2 comments
Open

Get gene sequence #2643

mictadlo opened this issue Mar 10, 2022 · 2 comments

Comments

@mictadlo
Copy link

Hi all,
Apollo allows to drag-n-drop a gene into the yellow field, and from the gene menu, you can select Get Sequence and get, for example, the peptide sequence for the gene as shown below:

image

image

The above solution works, but most users forget to delete the genes from the yellow Apollo's annotation field. Therefore, I wrote a small web app based on Python's Flask framework, which can be found here. To add it to Apollo, I need to add the following lines to trackList.json for the gene track:

{
  "menuTemplate": [
    {},
    {},
    {
      "action": "iframeDialog",
      "label": "Get Sequence",
      "title": "{Name}",
      "iconClass": "dijitIconDatabase",
      "url": "[https://apollo.nbenth.com/getseq/{ID}](https://apollo.nbenth.com/getseq/%7BID%7D)"
    }
  ],
  "storeClass": "JBrowse/Store/SeqFeature/NCList",
  "urlTemplate": "tracks/SeqViewer-test/{refseq}/trackData.jsonz",
  "style": {
    "className": "feature"
  },
  "label": "SeqViewer-test",
  "apollo": {
    "topType": "mRNA",
    "source": "upload",
    "type": "GFF3_JSON"
  },
  "type": "JBrowse/View/Track/HTMLFeatures",
  "key": "SeqViewer-test"
}

The user needs to select a gene and click right-mouse click and select Get Sequence from the menu:

image

However, the problem with my solution is that I need to create a new database for each annotation. How is it possible to access Apollo's database, or how can Get Sequence be extracted from Apollo and replace my code?

I really appreciate any help you can provide.
Michal

@cmdcolin
Copy link
Collaborator

this doesn't necessarily help with your apollo and jbrowse 1, but jbrowse 2 has code that can calculate the protein sequence client side. example screenshot (can get live demo at https://jbrowse.org/jb2 also)

Screenshot from 2022-03-09 17-55-29

@garrettjstevens
Copy link
Contributor

I am not able to see the code on BitBucket you linked (looks like I don't have permission), but I might have an idea. You can access the sequence by using Apollo's Web Service APIs. Here is an example of how this would look using a feature on our demo sequence:

curl --header 'Content-Type:application/json' --data '{"organismString":"Honeybee","sequenceName":"Group1.25","featureName":"afaad855-7b99-4e86-8828-b3b7cfb5891d","type":"peptide","username":"demo@demo.com","password":"demo"}' http://demo.genomearchitect.io/Apollo2/sequence/sequenceByName

or equivalently in JS

fetch('http://demo.genomearchitect.io/Apollo2/sequence/sequenceByName', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    organismString: 'Honeybee',
    sequenceName: 'Group1.25',
    featureName: 'afaad855-7b99-4e86-8828-b3b7cfb5891d',
    type: 'peptide',
    username: 'demo@demo.com',
    password: 'demo',
  }),
})
  .then(response => response.text())
  .then(console.log)

The possible types are genomic, cds, cdna, and peptide. Let me know if this doesn't work for you.

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

3 participants