Comments (3)
I'm not sure I understand what you mean? Do you mean you want to connect client-side javascript directly to your database? That is not possible.
You have to write a web server to extract results from the database and format then into a JSON which is consumable by Genoverse. You then need to set the URL of your track's model to be the URL of the web server which returns the data you want for that track.
from genoverse.
Thanks for your reply, Simon.
I have several sequences stored in a database. These sequences are currently under analisys and Genoverse would come in handy to visualize these sequences and help people during the annotation process. So what I need to do is exactly what you mentioned: create a web service that generates a JSON which will be consumed by Genoverse.
Do you have any examples on how to make Genoverse consume a JSON? Or how is the format of that JSON? Maybe the steps needed to "load" a JSON into Genoverse?
Another question: for every sequence I must have a JS like "tomato.js" or "grch38.js"?
Thanks in advance,
Carlos.
from genoverse.
Ok, so sequences are a little different - you don't want them to be JSON, you just want to return the sequence of letters for a given chr, start and end position (content-type should be text/plain).
You can set up a sequence track as follows:
Genoverse.Track.extend({
name : 'Sequence',
controller : Genoverse.Track.Controller.Sequence,
model : Genoverse.Track.Model.Sequence.extend({ url: '/path/to/your/server?chr=__CHR__&start=__START__&end=__END__' }),
view : Genoverse.Track.View.Sequence,
100000 : false,
resizable : 'auto'
})
You can do this once for each sequence file you have, with different URLs.
Alternatively, if you have FASTA files for your sequences, you can use
Genoverse.Track.Model.Sequence.Fasta.extend({ url: '/path/to/your/server/where/the/fasta/file/is' })
Doing that will mean you don't have to worry about creating a web server that extracts sequences from the database, instead you just have to expose your fasta files to the web server instead, which is much simpler to do!
Your question about genome files ("tomato.js") concerns me slightly however. Genoverse requires one genome file per instance (tomato.js is the minimum amount of data you need - chromosome names as keys in the hash, with the size of each chromosome and an empty bands array). If your sequence files come from different genomes, they might not render properly on the same instance of Genoverse - see the following example:
sequence 1: AAAATTTTCCCCGGGG
sequence 2: ATCGATCGATCGATCGATCG
genome file says chr has size of 16 (based on sequence 1).
when rendering sequence 2, the last 4 bases are out of range, and won't be drawn.
If this is a problem for you, but all you care about is the sequences (i.e., you have no other datasets that you want to display alongside the sequences), you can cheat by creating a genome file where the size of each chromosome is the length of the longest sequence you have for that chromosome. That way everything will be drawn, and you'll have shorter sequences ending before the end of the chromosome.
Does that make sense?
from genoverse.
Related Issues (20)
- jquery-ui clashes with d3 for mouseup event HOT 3
- Can you make a bundle without jquery and other standard dependencies, available via npm? HOT 6
- How to display highlights? What's the difference between highlights and mouse drag action mode highlights? HOT 2
- In new Genoverse exon-intron structure is not displayed, what's wrong with my parseData? HOT 1
- Convert highlights to histogram HOT 7
- Sequence track dissapears HOT 1
- Track for read coverage 2018
- Track for Coverage 2018 HOT 4
- genoverse leaves some dangling deferreds after browser.destroy() HOT 2
- Is it possible to use pyensembl local database with Genoverse? HOT 1
- How practical HOT 1
- ScatterPlots? HOT 1
- website is broken HOT 1
- How to configure local BED/BAM file as data source? HOT 3
- Does Genoverse browser fit .bb(bigbed) file? HOT 1
- How to load my own genome feature in the Genoverse tracks?
- How to load my own genome feature in the Genoverse tracks?
- How can i load my local genome feature file and perform it in the web? HOT 4
- When performing a location query, the URL makes two requests.
- Vue2 templates HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from genoverse.