[Gmod-ajax] JBrowse - Configuring Genes track with CanvasFeatures and REST

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Gmod-ajax] JBrowse - Configuring Genes track with CanvasFeatures and REST

Okke Meeuwes

Dear JBrowse developers and users,

 

I have recently started trying to use JBrowse in combination with a REST webservice. Currently I am trying to load a track containing genes using the CanvasFeatures track type. In the examples on the main page of JBrowse there are some very nice looking CanvasFeature tracks (http://jbrowse.org/code/JBrowse-1.12.1/?loc=ctgA%3A1..50001&tracks=Genes%2CCDS%2CTranscript&data=sample_data%2Fjson%2Fvolvox&highlight=&tracklist=1&nav=1&overview=1). My expectation was that I would get the similar looks for my Gene tracks if I specify everything correctly in JSON format. So introns for example would get an angled connector line, exons a colored box, UTR white bordered box, etc.

 

Now I got my track working so that the right JSON format is send to JBrowse (see below the disclaimer). However, JBrowse is not displaying everything as I had expected. It seems that by default the exons and introns are not shown and the rest is just rendered as a yellow/golden(?) box. By adding subparts and style color callback to the track configuration (see below the genefeature JSON data example) I managed to show all the subfeatures (CDS, exon, intron, five_prime_UTR, three_prime_UTR) with different colors, but I was expecting this to work out of the box.

 

So now my questions are:

1.       Am I doing something wrong or is this how it is supposed to work out of the box?

2.       How can I make JBrowse show introns as an angled connector line (not sure what term to use for it?)?

a.       If this is a separate FeatureGlyph type, how can I make JBrowse use a different featureglyph for different subfeature in a CanvasFeatures track. (I tried this with a callback on the glyph property in the track configuration, but then it always passes the main parent featureObject, so the gene object)

               

I hope you understand my problem and that some of you may have an idea how to solve it.

Thanks in advance!

 

Greetings,

 

Okke Meeuwes

 

 

Mail_Signature

 

Disclaimer

This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom/which they are addressed. If you have received this e-mail in error please notify the sender immediately, delete this e-mail from your system and do not disseminate, distribute or copy this e-mail. This e-mail shall not constitute a binding agreement unless expressly confirmed in writing by one of the Directors of Genetwister. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Genetwister. Finally, the recipient should check this e-mail and any attachments for the presence of viruses. Genetwister accepts no liability for any damage caused by any virus transmitted by this e-mail or damage caused by the use of the information contained in this e-mail. / Chamber of Commerce Arnhem, The Netherlands no.: 11043533

 

 

Example gene feature JSON  data:

{"features":      

                [{"type":"gene",

                "name":"gene:myGene",

                "start":870847,

                "end":881688,

                "strand":1,

                "uniqueID":"someUniqueID",

                "subfeatures":[

                               {"type":"transcript",

                               "name":"mRNA:myTranscript",

                               "start":870847,

                               "end":881688,

                               "strand":1,

                               "subfeatures":[

                                               {"type":"CDS",

                                               "name":"CDS:myCDS",

                                               "start":870847,

                                               "end":870879,

                                               "strand":1,

                                               "phase":0},

                                               {"type":"exon",

                                               "name":"exon:myExon",

                                               "start":870847,

                                               "end":870879,

                                               "strand":1,

                                               "phase":0},

                                               {"type":"three_prime_UTR",

                                               "name":"three_prime_UTR:myThree_prime_UTR",

                                               "start":881384,

                                               "end":881688,

                                               "strand":1},

                                               {"type":"intron",

                                               "name":"intron:myIntron",

                                               "start":870880,

                                               "end":870961,

                                               "strand":1},

                                               {Etc…}

                                               ]

                               }]

                }]

}

 

Tracklist.json:

{"label":"Genes":"Genes",

"type":"JBrowse/View/Track/CanvasFeatures",

"storeClass":"JBrowse/Store/SeqFeature/REST",

"baseUrl":"/mysite/rest/jbrowse/data/123/456/genes",

"category":"Genes",

"subfeatures":true,

"transcriptType":"transcript",

"subParts":"transcript,three_prime_UTR,five_prime_UTR,CDS,exon,intron",

"style":{"color":"function(feature, variableName, glyphObject, track){if(feature.get('type') === 'CDS'){return '#9CFBF5';} else if(feature.get('type') === 'exon'){return '#43A47F';} else if(feature.get('type') === 'intron'){return '#E8E8E8';} else if(feature.get('type') === 'five_prime_UTR'){return '#F192FE';} else if(feature.get('type') === 'three_prime_UTR'){return '#FEC892';} else {return '#FF0000';}}"}}

 

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: JBrowse - Configuring Genes track with CanvasFeatures and REST

nathandunn

Okke,

To get the angled connectors you have to use the NeatCanvasFeatures plugin.   These are distributed by default when you clone JBrowse. 

You can activate at the top-level using these instructions:


or activating at the trackList.json level as shown on the plugin directly:


That, hopefully answered part of your question.

Nathan

On Jan 23, 2017, at 8:27 AM, Okke Meeuwes <[hidden email]> wrote:

Dear JBrowse developers and users,
 
I have recently started trying to use JBrowse in combination with a REST webservice. Currently I am trying to load a track containing genes using the CanvasFeatures track type. In the examples on the main page of JBrowse there are some very nice looking CanvasFeature tracks (http://jbrowse.org/code/JBrowse-1.12.1/?loc=ctgA%3A1..50001&tracks=Genes%2CCDS%2CTranscript&data=sample_data%2Fjson%2Fvolvox&highlight=&tracklist=1&nav=1&overview=1). My expectation was that I would get the similar looks for my Gene tracks if I specify everything correctly in JSON format. So introns for example would get an angled connector line, exons a colored box, UTR white bordered box, etc.
 
Now I got my track working so that the right JSON format is send to JBrowse (see below the disclaimer). However, JBrowse is not displaying everything as I had expected. It seems that by default the exons and introns are not shown and the rest is just rendered as a yellow/golden(?) box. By adding subparts and style color callback to the track configuration (see below the genefeature JSON data example) I managed to show all the subfeatures (CDS, exon, intron, five_prime_UTR, three_prime_UTR) with different colors, but I was expecting this to work out of the box.
 
So now my questions are:
1.       Am I doing something wrong or is this how it is supposed to work out of the box?
2.       How can I make JBrowse show introns as an angled connector line (not sure what term to use for it?)?
a.       If this is a separate FeatureGlyph type, how can I make JBrowse use a different featureglyph for different subfeature in a CanvasFeatures track. (I tried this with a callback on the glyph property in the track configuration, but then it always passes the main parent featureObject, so the gene object)
                
I hope you understand my problem and that some of you may have an idea how to solve it.
Thanks in advance!
 
Greetings,
 
Okke Meeuwes
 
 
<image001.png>
 
Disclaimer
This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom/which they are addressed. If you have received this e-mail in error please notify the sender immediately, delete this e-mail from your system and do not disseminate, distribute or copy this e-mail. This e-mail shall not constitute a binding agreement unless expressly confirmed in writing by one of the Directors of Genetwister. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Genetwister. Finally, the recipient should check this e-mail and any attachments for the presence of viruses. Genetwister accepts no liability for any damage caused by any virus transmitted by this e-mail or damage caused by the use of the information contained in this e-mail. / Chamber of Commerce Arnhem, The Netherlands no.: 11043533
 
 
Example gene feature JSON  data:
{"features":       
                [{"type":"gene",
                "name":"gene:myGene",
                "start":870847,
                "end":881688,
                "strand":1,
                "uniqueID":"someUniqueID",
                "subfeatures":[
                               {"type":"transcript",
                               "name":"mRNA:myTranscript",
                               "start":870847,
                               "end":881688,
                               "strand":1,
                               "subfeatures":[
                                               {"type":"CDS",
                                               "name":"CDS:myCDS",
                                               "start":870847,
                                               "end":870879,
                                               "strand":1,
                                               "phase":0},
                                               {"type":"exon",
                                               "name":"exon:myExon",
                                               "start":870847,
                                               "end":870879,
                                               "strand":1,
                                               "phase":0},
                                               {"type":"three_prime_UTR",
                                               "name":"three_prime_UTR:myThree_prime_UTR",
                                               "start":881384,
                                               "end":881688,
                                               "strand":1},
                                               {"type":"intron",
                                               "name":"intron:myIntron",
                                               "start":870880,
                                               "end":870961,
                                               "strand":1},
                                               {Etc…}
                                               ]
                               }]
                }]
}
 
Tracklist.json:
{"label":"Genes":"Genes",
"type":"JBrowse/View/Track/CanvasFeatures",
"storeClass":"JBrowse/Store/SeqFeature/REST",
"baseUrl":"/mysite/rest/jbrowse/data/123/456/genes",
"category":"Genes",
"subfeatures":true,
"transcriptType":"transcript",
"subParts":"transcript,three_prime_UTR,five_prime_UTR,CDS,exon,intron",
"style":{"color":"function(feature, variableName, glyphObject, track){if(feature.get('type') === 'CDS'){return '#9CFBF5';} else if(feature.get('type') === 'exon'){return '#43A47F';} else if(feature.get('type') === 'intron'){return '#E8E8E8';} else if(feature.get('type') === 'five_prime_UTR'){return '#F192FE';} else if(feature.get('type') === 'three_prime_UTR'){return '#FEC892';} else {return '#FF0000';}}"}}
 
 
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: JBrowse - Configuring Genes track with CanvasFeatures and REST

Okke Meeuwes

Dear Nathan,

 

Activating the plugin was indeed what I was missing, now it is working.

Thank you very much!

 

Okke

 

From: Nathan Dunn [mailto:[hidden email]]
Sent: dinsdag 24 januari 2017 22:49
To: Okke Meeuwes <[hidden email]>
Cc: [hidden email]
Subject: Re: [Gmod-ajax] JBrowse - Configuring Genes track with CanvasFeatures and REST

 

 

Okke,

 

To get the angled connectors you have to use the NeatCanvasFeatures plugin.   These are distributed by default when you clone JBrowse. 

 

You can activate at the top-level using these instructions:

 

 

or activating at the trackList.json level as shown on the plugin directly:

 

 

That, hopefully answered part of your question.

 

Nathan

 

On Jan 23, 2017, at 8:27 AM, Okke Meeuwes <[hidden email]> wrote:

 

Dear JBrowse developers and users,

 

I have recently started trying to use JBrowse in combination with a REST webservice. Currently I am trying to load a track containing genes using the CanvasFeatures track type. In the examples on the main page of JBrowse there are some very nice looking CanvasFeature tracks (http://jbrowse.org/code/JBrowse-1.12.1/?loc=ctgA%3A1..50001&tracks=Genes%2CCDS%2CTranscript&data=sample_data%2Fjson%2Fvolvox&highlight=&tracklist=1&nav=1&overview=1). My expectation was that I would get the similar looks for my Gene tracks if I specify everything correctly in JSON format. So introns for example would get an angled connector line, exons a colored box, UTR white bordered box, etc.

 

Now I got my track working so that the right JSON format is send to JBrowse (see below the disclaimer). However, JBrowse is not displaying everything as I had expected. It seems that by default the exons and introns are not shown and the rest is just rendered as a yellow/golden(?) box. By adding subparts and style color callback to the track configuration (see below the genefeature JSON data example) I managed to show all the subfeatures (CDS, exon, intron, five_prime_UTR, three_prime_UTR) with different colors, but I was expecting this to work out of the box.

 

So now my questions are:

1.       Am I doing something wrong or is this how it is supposed to work out of the box?

2.       How can I make JBrowse show introns as an angled connector line (not sure what term to use for it?)?

a.       If this is a separate FeatureGlyph type, how can I make JBrowse use a different featureglyph for different subfeature in a CanvasFeatures track. (I tried this with a callback on the glyph property in the track configuration, but then it always passes the main parent featureObject, so the gene object)

                

I hope you understand my problem and that some of you may have an idea how to solve it.

Thanks in advance!

 

Greetings,

 

Okke Meeuwes

 

 

<image001.png>

 

Disclaimer

This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom/which they are addressed. If you have received this e-mail in error please notify the sender immediately, delete this e-mail from your system and do not disseminate, distribute or copy this e-mail. This e-mail shall not constitute a binding agreement unless expressly confirmed in writing by one of the Directors of Genetwister. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Genetwister. Finally, the recipient should check this e-mail and any attachments for the presence of viruses. Genetwister accepts no liability for any damage caused by any virus transmitted by this e-mail or damage caused by the use of the information contained in this e-mail. / Chamber of Commerce Arnhem, The Netherlands no.: 11043533

 

 

Example gene feature JSON  data:

{"features":       

                [{"type":"gene",

                "name":"gene:myGene",

                "start":870847,

                "end":881688,

                "strand":1,

                "uniqueID":"someUniqueID",

                "subfeatures":[

                               {"type":"transcript",

                               "name":"mRNA:myTranscript",

                               "start":870847,

                               "end":881688,

                               "strand":1,

                               "subfeatures":[

                                               {"type":"CDS",

                                               "name":"CDS:myCDS",

                                               "start":870847,

                                               "end":870879,

                                               "strand":1,

                                               "phase":0},

                                               {"type":"exon",

                                               "name":"exon:myExon",

                                               "start":870847,

                                               "end":870879,

                                               "strand":1,

                                               "phase":0},

                                               {"type":"three_prime_UTR",

                                               "name":"three_prime_UTR:myThree_prime_UTR",

                                               "start":881384,

                                               "end":881688,

                                               "strand":1},

                                               {"type":"intron",

                                               "name":"intron:myIntron",

                                               "start":870880,

                                               "end":870961,

                                               "strand":1},

                                               {Etc…}

                                               ]

                               }]

                }]

}

 

Tracklist.json:

{"label":"Genes":"Genes",

"type":"JBrowse/View/Track/CanvasFeatures",

"storeClass":"JBrowse/Store/SeqFeature/REST",

"baseUrl":"/mysite/rest/jbrowse/data/123/456/genes",

"category":"Genes",

"subfeatures":true,

"transcriptType":"transcript",

"subParts":"transcript,three_prime_UTR,five_prime_UTR,CDS,exon,intron",

"style":{"color":"function(feature, variableName, glyphObject, track){if(feature.get('type') === 'CDS'){return '#9CFBF5';} else if(feature.get('type') === 'exon'){return '#43A47F';} else if(feature.get('type') === 'intron'){return '#E8E8E8';} else if(feature.get('type') === 'five_prime_UTR'){return '#F192FE';} else if(feature.get('type') === 'three_prime_UTR'){return '#FEC892';} else {return '#FF0000';}}"}}

 

 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, 
SlashDot.org! http://sdm.link/slashdot_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax