Quantcast

Display GFF "Note" attribute but not in the "Description" field

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Display GFF "Note" attribute but not in the "Description" field

Loraine Guéguen
Hi,

For an evidence track featuring RNAs, is it possible that the attribute
"Note=" of a GFF (which is normally displayed in the "Description" of
the "Primary Data" section ) can be displayed somewhere else ? In the
"Attributes" section maybe ? And how ? Can we configure the
trackList.json file to do that ?
Because we want to display a "product=" information in the "Description"
of the "Primary Data" section and we don't want to lose the attribute
"Note=".

NB : We use Apollo 2.0.4 and we have generated the evidence track with
the biodb-to-json tool.

Thank you so much for your attention.


Loraine Guéguen and Misharl Monsoor

--
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: ++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/





This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display GFF "Note" attribute but not in the "Description" field

nathandunn

Loriane / Misharl,

You would have to modify the code.    You are basically over-riding / changing these method in JBrowse:



and



You could over-ride this in JBrowse directly or in the Apollo plugin via something like like below (over-riding the methods above).  

I haven’t tested it and not sure if you have to do something more special to get the “showProduct” flag to show up in the track (or if you want to only show the product everywhere).  Also, if you want this behavior to be over-ridden for Canvas, I believe you can do that here in WebApolloCanvasFeature.  

diff --git a/client/apollo/js/View/Track/DraggableHTMLFeatures.js b/client/apollo/js/View/Track/DraggableHTMLFeatures.js
index 21c072d..81c9587 100644
--- a/client/apollo/js/View/Track/DraggableHTMLFeatures.js
+++ b/client/apollo/js/View/Track/DraggableHTMLFeatures.js
@@ -83,6 +83,53 @@ var draggableTrack = declare( HTMLFeatureTrack,
         );
     },
 
+    _renderCoreDetails: function(track, f, featDiv, container){
+        var coreDetails = dojo.create('div', { className: 'core' }, container );
+        var fmt = dojo.hitch( this, 'renderDetailField', coreDetails );
+        coreDetails.innerHTML += '<h2 class="sectiontitle">Primary Data</h2>';
+
+        fmt( 'Name', this.getFeatureLabel( f ),f );
+        fmt( 'Type', f.get('type'),f );
+        fmt( 'Score', f.get('score'),f );
+        if(track.showProduct){
+            fmt( 'Description', f.get('product'),f );
+        }
+        else{
+            fmt( 'Description', this.getFeatureDescription( f ),f );
+        }
+        fmt(
+            'Position',
+            Util.assembleLocString({ start: f.get('start'),
+                end: f.get('end'),
+                ref: this.refSeq.name,
+                strand: f.get('strand')
+            }),f
+        );
+        fmt( 'Length', Util.addCommas(f.get('end')-f.get('start'))+' bp',f );
+    },
+
+    _renderAdditionalTagsDetail: function( track, f, featDiv, container ) {
+        var additionalTags = array.filter( f.tags(), function(t) {
+            return ! this._isReservedTag( t );
+        },this);
+
+        if(track.showProduct){
+            fmt( 'Note', this.getFeatureDescription( f ),f );
+        }
+
+        if( additionalTags.length ) {
+            var atElement = domConstruct.create(
+                'div',
+                { className: 'additional',
+                    innerHTML: '<h2 class="sectiontitle">Attributes</h2>'
+                },
+                container );
+            array.forEach( additionalTags.sort(), function(t) {
+                this.renderDetailField( container, t, f.get(t), f );
+            }, this );
+        }
+    },
+




Nathan

On Apr 12, 2017, at 2:43 AM, Loraine Guéguen <[hidden email]> wrote:

Hi,

For an evidence track featuring RNAs, is it possible that the attribute "Note=" of a GFF (which is normally displayed in the "Description" of the "Primary Data" section ) can be displayed somewhere else ? In the "Attributes" section maybe ? And how ? Can we configure the trackList.json file to do that ?
Because we want to display a "product=" information in the "Description" of the "Primary Data" section and we don't want to lose the attribute "Note=".

NB : We use Apollo 2.0.4 and we have generated the evidence track with the biodb-to-json tool.

Thank you so much for your attention.


Loraine Guéguen and Misharl Monsoor

--
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: ++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/




This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.






This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display GFF "Note" attribute but not in the "Description" field

Loraine Guéguen
Thanks Nathan,

We would prefer not patch the code, because it would make the updates tricky, and this is only for one organism of the Apollo instance.

In fact, it is easy to display what we want into the description field, just by configuring the trackList.json:

         "style" : {
            "description" : "product, note, description",
         },

Which means (and indeed does): display by priority the product attribute, then the note, then the description.
The challenge is to be able to display the note attribute in another field (create one ?). Is a similar configuration possible into the trackList.json ?

Thanks,

Loraine



Le 12/04/2017 22:33, Nathan Dunn a écrit :

Loriane / Misharl,

You would have to modify the code.    You are basically over-riding / changing these method in JBrowse:



and



You could over-ride this in JBrowse directly or in the Apollo plugin via something like like below (over-riding the methods above).  

I haven’t tested it and not sure if you have to do something more special to get the “showProduct” flag to show up in the track (or if you want to only show the product everywhere).  Also, if you want this behavior to be over-ridden for Canvas, I believe you can do that here in WebApolloCanvasFeature.  

diff --git a/client/apollo/js/View/Track/DraggableHTMLFeatures.js b/client/apollo/js/View/Track/DraggableHTMLFeatures.js
index 21c072d..81c9587 100644
--- a/client/apollo/js/View/Track/DraggableHTMLFeatures.js
+++ b/client/apollo/js/View/Track/DraggableHTMLFeatures.js
@@ -83,6 +83,53 @@ var draggableTrack = declare( HTMLFeatureTrack,
         );
     },
 
+    _renderCoreDetails: function(track, f, featDiv, container){
+        var coreDetails = dojo.create('div', { className: 'core' }, container );
+        var fmt = dojo.hitch( this, 'renderDetailField', coreDetails );
+        coreDetails.innerHTML += '<h2 class="sectiontitle">Primary Data</h2>';
+
+        fmt( 'Name', this.getFeatureLabel( f ),f );
+        fmt( 'Type', f.get('type'),f );
+        fmt( 'Score', f.get('score'),f );
+        if(track.showProduct){
+            fmt( 'Description', f.get('product'),f );
+        }
+        else{
+            fmt( 'Description', this.getFeatureDescription( f ),f );
+        }
+        fmt(
+            'Position',
+            Util.assembleLocString({ start: f.get('start'),
+                end: f.get('end'),
+                ref: this.refSeq.name,
+                strand: f.get('strand')
+            }),f
+        );
+        fmt( 'Length', Util.addCommas(f.get('end')-f.get('start'))+' bp',f );
+    },
+
+    _renderAdditionalTagsDetail: function( track, f, featDiv, container ) {
+        var additionalTags = array.filter( f.tags(), function(t) {
+            return ! this._isReservedTag( t );
+        },this);
+
+        if(track.showProduct){
+            fmt( 'Note', this.getFeatureDescription( f ),f );
+        }
+
+        if( additionalTags.length ) {
+            var atElement = domConstruct.create(
+                'div',
+                { className: 'additional',
+                    innerHTML: '<h2 class="sectiontitle">Attributes</h2>'
+                },
+                container );
+            array.forEach( additionalTags.sort(), function(t) {
+                this.renderDetailField( container, t, f.get(t), f );
+            }, this );
+        }
+    },
+




Nathan

On Apr 12, 2017, at 2:43 AM, Loraine Guéguen <[hidden email]> wrote:

Hi,

For an evidence track featuring RNAs, is it possible that the attribute "Note=" of a GFF (which is normally displayed in the "Description" of the "Primary Data" section ) can be displayed somewhere else ? In the "Attributes" section maybe ? And how ? Can we configure the trackList.json file to do that ?
Because we want to display a "product=" information in the "Description" of the "Primary Data" section and we don't want to lose the attribute "Note=".

NB : We use Apollo 2.0.4 and we have generated the evidence track with the biodb-to-json tool.

Thank you so much for your attention.


Loraine Guéguen and Misharl Monsoor

--
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: ++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/




This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.






This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank. 


-- 
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: ++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/





This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display GFF "Note" attribute but not in the "Description" field

Colin
This is sort of similar to https://github.com/GMOD/jbrowse/issues/555

There are a couple workarounds presented there but don't know if any of them are a perfect fix because when you change style.description to product, then it makes the normal Note attribute go away from the detail popup

The reason is sort of weird but basically the logic is

1) render "reserved tags" in the "Primary data" part of the popup, which includes whatever is determined to go in the "Description" field which by default is "Note".
2) render everything except "reserved tags" in the "Attributes" part of the view details popup

The problem is that since the "Description" is changed to be something other than "note", and since "note" is a reserved tag, it decides not to render "note" anywhere in the popup

One workaround would be to not to use "Note" to store stuff.... but that might not be a very satisfying answer. Would be interesting to get fix for that issue though, possibly requires an update to jbrowse


-Colin

On Thu, Apr 13, 2017 at 10:14 AM, Loraine Guéguen <[hidden email]> wrote:
Thanks Nathan,

We would prefer not patch the code, because it would make the updates tricky, and this is only for one organism of the Apollo instance.

In fact, it is easy to display what we want into the description field, just by configuring the trackList.json:

         "style" : {
            "description" : "product, note, description",
         },

Which means (and indeed does): display by priority the product attribute, then the note, then the description.
The challenge is to be able to display the note attribute in another field (create one ?). Is a similar configuration possible into the trackList.json ?

Thanks,

Loraine




Le 12/04/2017 22:33, Nathan Dunn a écrit :

Loriane / Misharl,

You would have to modify the code.    You are basically over-riding / changing these method in JBrowse:



and



You could over-ride this in JBrowse directly or in the Apollo plugin via something like like below (over-riding the methods above).  

I haven’t tested it and not sure if you have to do something more special to get the “showProduct” flag to show up in the track (or if you want to only show the product everywhere).  Also, if you want this behavior to be over-ridden for Canvas, I believe you can do that here in WebApolloCanvasFeature.  

diff --git a/client/apollo/js/View/Track/DraggableHTMLFeatures.js b/client/apollo/js/View/Track/DraggableHTMLFeatures.js
index 21c072d..81c9587 100644
--- a/client/apollo/js/View/Track/DraggableHTMLFeatures.js
+++ b/client/apollo/js/View/Track/DraggableHTMLFeatures.js
@@ -83,6 +83,53 @@ var draggableTrack = declare( HTMLFeatureTrack,
         );
     },
 
+    _renderCoreDetails: function(track, f, featDiv, container){
+        var coreDetails = dojo.create('div', { className: 'core' }, container );
+        var fmt = dojo.hitch( this, 'renderDetailField', coreDetails );
+        coreDetails.innerHTML += '<h2 class="sectiontitle">Primary Data</h2>';
+
+        fmt( 'Name', this.getFeatureLabel( f ),f );
+        fmt( 'Type', f.get('type'),f );
+        fmt( 'Score', f.get('score'),f );
+        if(track.showProduct){
+            fmt( 'Description', f.get('product'),f );
+        }
+        else{
+            fmt( 'Description', this.getFeatureDescription( f ),f );
+        }
+        fmt(
+            'Position',
+            Util.assembleLocString({ start: f.get('start'),
+                end: f.get('end'),
+                ref: this.refSeq.name,
+                strand: f.get('strand')
+            }),f
+        );
+        fmt( 'Length', Util.addCommas(f.get('end')-f.get('start'))+' bp',f );
+    },
+
+    _renderAdditionalTagsDetail: function( track, f, featDiv, container ) {
+        var additionalTags = array.filter( f.tags(), function(t) {
+            return ! this._isReservedTag( t );
+        },this);
+
+        if(track.showProduct){
+            fmt( 'Note', this.getFeatureDescription( f ),f );
+        }
+
+        if( additionalTags.length ) {
+            var atElement = domConstruct.create(
+                'div',
+                { className: 'additional',
+                    innerHTML: '<h2 class="sectiontitle">Attributes</h2>'
+                },
+                container );
+            array.forEach( additionalTags.sort(), function(t) {
+                this.renderDetailField( container, t, f.get(t), f );
+            }, this );
+        }
+    },
+




Nathan

On Apr 12, 2017, at 2:43 AM, Loraine Guéguen <[hidden email]> wrote:

Hi,

For an evidence track featuring RNAs, is it possible that the attribute "Note=" of a GFF (which is normally displayed in the "Description" of the "Primary Data" section ) can be displayed somewhere else ? In the "Attributes" section maybe ? And how ? Can we configure the trackList.json file to do that ?
Because we want to display a "product=" information in the "Description" of the "Primary Data" section and we don't want to lose the attribute "Note=".

NB : We use Apollo 2.0.4 and we have generated the evidence track with the biodb-to-json tool.

Thank you so much for your attention.


Loraine Guéguen and Misharl Monsoor

--
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: <a href="tel:+33%202%2098%2029%2056%2046" value="+33298295646" target="_blank">++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/




This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.




This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank. 


-- 
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: <a href="tel:+33%202%2098%2029%2056%2046" value="+33298295646" target="_blank">++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/





This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.







This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display GFF "Note" attribute but not in the "Description" field

nathandunn

Loriane,

Per Colin’s notes and thinking about this a bit more (I wasn’t aware of this configuration) some possible solutions:

1 - You could modify the incoming GFF3 so that “Note” is “Product_Note” or something like that.  And then in trackList.json you could call this:

        "style" : {
            "description" : "product, product_note, description",
         },

I’m not sure if that if that will work, but it can’t hurt to try.   (I think this is what Colin is suggesting below).


2 - Leave the GFF3 as is but in trackList.json add 

showNoteInAttributes : true

add add this in DraggableHTMLFeatures (or create a subclass Draggable HTMLFeatures and add this method).  Highlighted important difference here:

_renderAdditionalTagsDetail: function( track, f, featDiv, container ) {
        var additionalTags = array.filter( f.tags(), function(t) {
            
            if(t.showNoteInAttributes && t==‘Notes’){
                 return true ;
            }

            return ! this._isReservedTag( t );
        },this);


        if( additionalTags.length ) {
            var atElement = domConstruct.create(
                'div',
                { className: 'additional',
                    innerHTML: '<h2 class="sectiontitle">Attributes</h2>'
                },
                container );
            array.forEach( additionalTags.sort(), function(t) {
                this.renderDetailField( container, t, f.get(t), f );
            }, this );
        }
    },


If this works, we can add a PR either in JBrowse or Apollo so you don’t have to patch it every time there is an upgrade.  Not sure if there is a good way to make this a bit more generic, though.  Thoughts welcome.  

Nathan

On Apr 13, 2017, at 8:07 AM, Colin <[hidden email]> wrote:

This is sort of similar to https://github.com/GMOD/jbrowse/issues/555

There are a couple workarounds presented there but don't know if any of them are a perfect fix because when you change style.description to product, then it makes the normal Note attribute go away from the detail popup

The reason is sort of weird but basically the logic is

1) render "reserved tags" in the "Primary data" part of the popup, which includes whatever is determined to go in the "Description" field which by default is "Note".
2) render everything except "reserved tags" in the "Attributes" part of the view details popup

The problem is that since the "Description" is changed to be something other than "note", and since "note" is a reserved tag, it decides not to render "note" anywhere in the popup

One workaround would be to not to use "Note" to store stuff.... but that might not be a very satisfying answer. Would be interesting to get fix for that issue though, possibly requires an update to jbrowse


-Colin

On Thu, Apr 13, 2017 at 10:14 AM, Loraine Guéguen <[hidden email]> wrote:
Thanks Nathan,

We would prefer not patch the code, because it would make the updates tricky, and this is only for one organism of the Apollo instance.

In fact, it is easy to display what we want into the description field, just by configuring the trackList.json:

         "style" : {
            "description" : "product, note, description",
         },

Which means (and indeed does): display by priority the product attribute, then the note, then the description.
The challenge is to be able to display the note attribute in another field (create one ?). Is a similar configuration possible into the trackList.json ?

Thanks,

Loraine




Le 12/04/2017 22:33, Nathan Dunn a écrit :

Loriane / Misharl,

You would have to modify the code.    You are basically over-riding / changing these method in JBrowse:



and



You could over-ride this in JBrowse directly or in the Apollo plugin via something like like below (over-riding the methods above).  

I haven’t tested it and not sure if you have to do something more special to get the “showProduct” flag to show up in the track (or if you want to only show the product everywhere).  Also, if you want this behavior to be over-ridden for Canvas, I believe you can do that here in WebApolloCanvasFeature.  

diff --git a/client/apollo/js/View/Track/DraggableHTMLFeatures.js b/client/apollo/js/View/Track/DraggableHTMLFeatures.js
index 21c072d..81c9587 100644
--- a/client/apollo/js/View/Track/DraggableHTMLFeatures.js
+++ b/client/apollo/js/View/Track/DraggableHTMLFeatures.js
@@ -83,6 +83,53 @@ var draggableTrack = declare( HTMLFeatureTrack,
         );
     },
 
+    _renderCoreDetails: function(track, f, featDiv, container){
+        var coreDetails = dojo.create('div', { className: 'core' }, container );
+        var fmt = dojo.hitch( this, 'renderDetailField', coreDetails );
+        coreDetails.innerHTML += '<h2 class="sectiontitle">Primary Data</h2>';
+
+        fmt( 'Name', this.getFeatureLabel( f ),f );
+        fmt( 'Type', f.get('type'),f );
+        fmt( 'Score', f.get('score'),f );
+        if(track.showProduct){
+            fmt( 'Description', f.get('product'),f );
+        }
+        else{
+            fmt( 'Description', this.getFeatureDescription( f ),f );
+        }
+        fmt(
+            'Position',
+            Util.assembleLocString({ start: f.get('start'),
+                end: f.get('end'),
+                ref: this.refSeq.name,
+                strand: f.get('strand')
+            }),f
+        );
+        fmt( 'Length', Util.addCommas(f.get('end')-f.get('start'))+' bp',f );
+    },
+
+    _renderAdditionalTagsDetail: function( track, f, featDiv, container ) {
+        var additionalTags = array.filter( f.tags(), function(t) {
+            return ! this._isReservedTag( t );
+        },this);
+
+        if(track.showProduct){
+            fmt( 'Note', this.getFeatureDescription( f ),f );
+        }
+
+        if( additionalTags.length ) {
+            var atElement = domConstruct.create(
+                'div',
+                { className: 'additional',
+                    innerHTML: '<h2 class="sectiontitle">Attributes</h2>'
+                },
+                container );
+            array.forEach( additionalTags.sort(), function(t) {
+                this.renderDetailField( container, t, f.get(t), f );
+            }, this );
+        }
+    },
+




Nathan

On Apr 12, 2017, at 2:43 AM, Loraine Guéguen <[hidden email]> wrote:

Hi,

For an evidence track featuring RNAs, is it possible that the attribute "Note=" of a GFF (which is normally displayed in the "Description" of the "Primary Data" section ) can be displayed somewhere else ? In the "Attributes" section maybe ? And how ? Can we configure the trackList.json file to do that ?
Because we want to display a "product=" information in the "Description" of the "Primary Data" section and we don't want to lose the attribute "Note=".

NB : We use Apollo 2.0.4 and we have generated the evidence track with the biodb-to-json tool.

Thank you so much for your attention.


Loraine Guéguen and Misharl Monsoor

--
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: <a href="tel:+33%202%2098%2029%2056%2046" value="+33298295646" target="_blank" class="">++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/




This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.




This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank. 


-- 
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: <a href="tel:+33%202%2098%2029%2056%2046" value="+33298295646" target="_blank" class="">++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/





This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.






This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.






This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display GFF "Note" attribute but not in the "Description" field

Colin
I think that the patch that Nathan has is probably the right idea, do you just want to add that to jbrowse master? 

The only sort of "enhancement" would be to try to automatically determine if note is being hidden by the existing description config, but that is kind of complicated and just having a "fallback" showNoteInAttributes seems ok for cases like this.

-Colin

On Thu, Apr 13, 2017 at 3:07 PM, Nathan Dunn <[hidden email]> wrote:

Loriane,

Per Colin’s notes and thinking about this a bit more (I wasn’t aware of this configuration) some possible solutions:

1 - You could modify the incoming GFF3 so that “Note” is “Product_Note” or something like that.  And then in trackList.json you could call this:

        "style" : {
            "description" : "product, product_note, description",
         },

I’m not sure if that if that will work, but it can’t hurt to try.   (I think this is what Colin is suggesting below).


2 - Leave the GFF3 as is but in trackList.json add 

showNoteInAttributes : true

add add this in DraggableHTMLFeatures (or create a subclass Draggable HTMLFeatures and add this method).  Highlighted important difference here:

_renderAdditionalTagsDetail: function( track, f, featDiv, container ) {
        var additionalTags = array.filter( f.tags(), function(t) {
            
            if(t.showNoteInAttributes && t==‘Notes’){
                 return true ;
            }

            return ! this._isReservedTag( t );
        },this);


        if( additionalTags.length ) {
            var atElement = domConstruct.create(
                'div',
                { className: 'additional',
                    innerHTML: '<h2 class="sectiontitle">Attributes</h2>'
                },
                container );
            array.forEach( additionalTags.sort(), function(t) {
                this.renderDetailField( container, t, f.get(t), f );
            }, this );
        }
    },


If this works, we can add a PR either in JBrowse or Apollo so you don’t have to patch it every time there is an upgrade.  Not sure if there is a good way to make this a bit more generic, though.  Thoughts welcome.  

Nathan

On Apr 13, 2017, at 8:07 AM, Colin <[hidden email]> wrote:

This is sort of similar to https://github.com/GMOD/jbrowse/issues/555

There are a couple workarounds presented there but don't know if any of them are a perfect fix because when you change style.description to product, then it makes the normal Note attribute go away from the detail popup

The reason is sort of weird but basically the logic is

1) render "reserved tags" in the "Primary data" part of the popup, which includes whatever is determined to go in the "Description" field which by default is "Note".
2) render everything except "reserved tags" in the "Attributes" part of the view details popup

The problem is that since the "Description" is changed to be something other than "note", and since "note" is a reserved tag, it decides not to render "note" anywhere in the popup

One workaround would be to not to use "Note" to store stuff.... but that might not be a very satisfying answer. Would be interesting to get fix for that issue though, possibly requires an update to jbrowse


-Colin

On Thu, Apr 13, 2017 at 10:14 AM, Loraine Guéguen <[hidden email]> wrote:
Thanks Nathan,

We would prefer not patch the code, because it would make the updates tricky, and this is only for one organism of the Apollo instance.

In fact, it is easy to display what we want into the description field, just by configuring the trackList.json:

         "style" : {
            "description" : "product, note, description",
         },

Which means (and indeed does): display by priority the product attribute, then the note, then the description.
The challenge is to be able to display the note attribute in another field (create one ?). Is a similar configuration possible into the trackList.json ?

Thanks,

Loraine




Le 12/04/2017 22:33, Nathan Dunn a écrit :

Loriane / Misharl,

You would have to modify the code.    You are basically over-riding / changing these method in JBrowse:



and



You could over-ride this in JBrowse directly or in the Apollo plugin via something like like below (over-riding the methods above).  

I haven’t tested it and not sure if you have to do something more special to get the “showProduct” flag to show up in the track (or if you want to only show the product everywhere).  Also, if you want this behavior to be over-ridden for Canvas, I believe you can do that here in WebApolloCanvasFeature.  

diff --git a/client/apollo/js/View/Track/DraggableHTMLFeatures.js b/client/apollo/js/View/Track/DraggableHTMLFeatures.js
index 21c072d..81c9587 100644
--- a/client/apollo/js/View/Track/DraggableHTMLFeatures.js
+++ b/client/apollo/js/View/Track/DraggableHTMLFeatures.js
@@ -83,6 +83,53 @@ var draggableTrack = declare( HTMLFeatureTrack,
         );
     },
 
+    _renderCoreDetails: function(track, f, featDiv, container){
+        var coreDetails = dojo.create('div', { className: 'core' }, container );
+        var fmt = dojo.hitch( this, 'renderDetailField', coreDetails );
+        coreDetails.innerHTML += '<h2 class="sectiontitle">Primary Data</h2>';
+
+        fmt( 'Name', this.getFeatureLabel( f ),f );
+        fmt( 'Type', f.get('type'),f );
+        fmt( 'Score', f.get('score'),f );
+        if(track.showProduct){
+            fmt( 'Description', f.get('product'),f );
+        }
+        else{
+            fmt( 'Description', this.getFeatureDescription( f ),f );
+        }
+        fmt(
+            'Position',
+            Util.assembleLocString({ start: f.get('start'),
+                end: f.get('end'),
+                ref: this.refSeq.name,
+                strand: f.get('strand')
+            }),f
+        );
+        fmt( 'Length', Util.addCommas(f.get('end')-f.get('start'))+' bp',f );
+    },
+
+    _renderAdditionalTagsDetail: function( track, f, featDiv, container ) {
+        var additionalTags = array.filter( f.tags(), function(t) {
+            return ! this._isReservedTag( t );
+        },this);
+
+        if(track.showProduct){
+            fmt( 'Note', this.getFeatureDescription( f ),f );
+        }
+
+        if( additionalTags.length ) {
+            var atElement = domConstruct.create(
+                'div',
+                { className: 'additional',
+                    innerHTML: '<h2 class="sectiontitle">Attributes</h2>'
+                },
+                container );
+            array.forEach( additionalTags.sort(), function(t) {
+                this.renderDetailField( container, t, f.get(t), f );
+            }, this );
+        }
+    },
+




Nathan

On Apr 12, 2017, at 2:43 AM, Loraine Guéguen <[hidden email]> wrote:

Hi,

For an evidence track featuring RNAs, is it possible that the attribute "Note=" of a GFF (which is normally displayed in the "Description" of the "Primary Data" section ) can be displayed somewhere else ? In the "Attributes" section maybe ? And how ? Can we configure the trackList.json file to do that ?
Because we want to display a "product=" information in the "Description" of the "Primary Data" section and we don't want to lose the attribute "Note=".

NB : We use Apollo 2.0.4 and we have generated the evidence track with the biodb-to-json tool.

Thank you so much for your attention.


Loraine Guéguen and Misharl Monsoor

--
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: <a href="tel:+33%202%2098%2029%2056%2046" value="+33298295646" target="_blank">++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/




This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.




This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank. 


-- 
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: <a href="tel:+33%202%2098%2029%2056%2046" value="+33298295646" target="_blank">++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/





This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.






This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.






This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.







This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display GFF "Note" attribute but not in the "Description" field

Loraine Guéguen-2
thanks!
I'll try the patch and make a PR

Le 13/04/2017 21:48, Colin a écrit :
I think that the patch that Nathan has is probably the right idea, do you just want to add that to jbrowse master? 

The only sort of "enhancement" would be to try to automatically determine if note is being hidden by the existing description config, but that is kind of complicated and just having a "fallback" showNoteInAttributes seems ok for cases like this.

-Colin

On Thu, Apr 13, 2017 at 3:07 PM, Nathan Dunn <[hidden email]> wrote:

Loriane,

Per Colin’s notes and thinking about this a bit more (I wasn’t aware of this configuration) some possible solutions:

1 - You could modify the incoming GFF3 so that “Note” is “Product_Note” or something like that.  And then in trackList.json you could call this:

        "style" : {
            "description" : "product, product_note, description",
         },

I’m not sure if that if that will work, but it can’t hurt to try.   (I think this is what Colin is suggesting below).


2 - Leave the GFF3 as is but in trackList.json add 

showNoteInAttributes : true

add add this in DraggableHTMLFeatures (or create a subclass Draggable HTMLFeatures and add this method).  Highlighted important difference here:

_renderAdditionalTagsDetail: function( track, f, featDiv, container ) {
        var additionalTags = array.filter( f.tags(), function(t) {
            
            if(t.showNoteInAttributes && t==‘Notes’){
                 return true ;
            }

            return ! this._isReservedTag( t );
        },this);


        if( additionalTags.length ) {
            var atElement = domConstruct.create(
                'div',
                { className: 'additional',
                    innerHTML: '<h2 class="sectiontitle">Attributes</h2>'
                },
                container );
            array.forEach( additionalTags.sort(), function(t) {
                this.renderDetailField( container, t, f.get(t), f );
            }, this );
        }
    },


If this works, we can add a PR either in JBrowse or Apollo so you don’t have to patch it every time there is an upgrade.  Not sure if there is a good way to make this a bit more generic, though.  Thoughts welcome.  

Nathan

On Apr 13, 2017, at 8:07 AM, Colin <[hidden email]> wrote:

This is sort of similar to https://github.com/GMOD/jbrowse/issues/555

There are a couple workarounds presented there but don't know if any of them are a perfect fix because when you change style.description to product, then it makes the normal Note attribute go away from the detail popup

The reason is sort of weird but basically the logic is

1) render "reserved tags" in the "Primary data" part of the popup, which includes whatever is determined to go in the "Description" field which by default is "Note".
2) render everything except "reserved tags" in the "Attributes" part of the view details popup

The problem is that since the "Description" is changed to be something other than "note", and since "note" is a reserved tag, it decides not to render "note" anywhere in the popup

One workaround would be to not to use "Note" to store stuff.... but that might not be a very satisfying answer. Would be interesting to get fix for that issue though, possibly requires an update to jbrowse


-Colin

On Thu, Apr 13, 2017 at 10:14 AM, Loraine Guéguen <[hidden email]> wrote:
Thanks Nathan,

We would prefer not patch the code, because it would make the updates tricky, and this is only for one organism of the Apollo instance.

In fact, it is easy to display what we want into the description field, just by configuring the trackList.json:

         "style" : {
            "description" : "product, note, description",
         },

Which means (and indeed does): display by priority the product attribute, then the note, then the description.
The challenge is to be able to display the note attribute in another field (create one ?). Is a similar configuration possible into the trackList.json ?

Thanks,

Loraine




Le 12/04/2017 22:33, Nathan Dunn a écrit :

Loriane / Misharl,

You would have to modify the code.    You are basically over-riding / changing these method in JBrowse:

https://github.com/GMOD/jbrowse/blob/master/src/JBrowse/View/Track/_FeatureDetailMixin.js#L73

https://github.com/GMOD/jbrowse/blob/master/src/JBrowse/View/Track/_FeatureDetailMixin.js#L92

and

https://github.com/GMOD/jbrowse/blob/master/src/JBrowse/View/Track/_FeatureDetailMixin.js#L137


You could over-ride this in JBrowse directly or in the Apollo plugin via something like like below (over-riding the methods above).  

I haven’t tested it and not sure if you have to do something more special to get the “showProduct” flag to show up in the track (or if you want to only show the product everywhere).  Also, if you want this behavior to be over-ridden for Canvas, I believe you can do that here in WebApolloCanvasFeature.  

diff --git a/client/apollo/js/View/Track/DraggableHTMLFeatures.js b/client/apollo/js/View/Track/DraggableHTMLFeatures.js
index 21c072d..81c9587 100644
--- a/client/apollo/js/View/Track/DraggableHTMLFeatures.js
+++ b/client/apollo/js/View/Track/DraggableHTMLFeatures.js
@@ -83,6 +83,53 @@ var draggableTrack = declare( HTMLFeatureTrack,
         );
     },
 
+    _renderCoreDetails: function(track, f, featDiv, container){
+        var coreDetails = dojo.create('div', { className: 'core' }, container );
+        var fmt = dojo.hitch( this, 'renderDetailField', coreDetails );
+        coreDetails.innerHTML += '<h2 class="sectiontitle">Primary Data</h2>';
+
+        fmt( 'Name', this.getFeatureLabel( f ),f );
+        fmt( 'Type', f.get('type'),f );
+        fmt( 'Score', f.get('score'),f );
+        if(track.showProduct){
+            fmt( 'Description', f.get('product'),f );
+        }
+        else{
+            fmt( 'Description', this.getFeatureDescription( f ),f );
+        }
+        fmt(
+            'Position',
+            Util.assembleLocString({ start: f.get('start'),
+                end: f.get('end'),
+                ref: this.refSeq.name,
+                strand: f.get('strand')
+            }),f
+        );
+        fmt( 'Length', Util.addCommas(f.get('end')-f.get('start'))+' bp',f );
+    },
+
+    _renderAdditionalTagsDetail: function( track, f, featDiv, container ) {
+        var additionalTags = array.filter( f.tags(), function(t) {
+            return ! this._isReservedTag( t );
+        },this);
+
+        if(track.showProduct){
+            fmt( 'Note', this.getFeatureDescription( f ),f );
+        }
+
+        if( additionalTags.length ) {
+            var atElement = domConstruct.create(
+                'div',
+                { className: 'additional',
+                    innerHTML: '<h2 class="sectiontitle">Attributes</h2>'
+                },
+                container );
+            array.forEach( additionalTags.sort(), function(t) {
+                this.renderDetailField( container, t, f.get(t), f );
+            }, this );
+        }
+    },
+




Nathan

On Apr 12, 2017, at 2:43 AM, Loraine Guéguen <[hidden email]> wrote:

Hi,

For an evidence track featuring RNAs, is it possible that the attribute "Note=" of a GFF (which is normally displayed in the "Description" of the "Primary Data" section ) can be displayed somewhere else ? In the "Attributes" section maybe ? And how ? Can we configure the trackList.json file to do that ?
Because we want to display a "product=" information in the "Description" of the "Primary Data" section and we don't want to lose the attribute "Note=".

NB : We use Apollo 2.0.4 and we have generated the evidence track with the biodb-to-json tool.

Thank you so much for your attention.


Loraine Guéguen and Misharl Monsoor

--
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: <a moz-do-not-send="true" href="tel:+33%202%2098%2029%2056%2046" value="+33298295646" target="_blank">++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/




This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.




This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank. 


-- 
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: <a moz-do-not-send="true" href="tel:+33%202%2098%2029%2056%2046" value="+33298295646" target="_blank">++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/





This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.






This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.






This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.







This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank. 


-- 
Loraine Guéguen

Plateforme ABiMS (Analyses and Bioinformatics for Marine Sciences)
Service Informatique et Bioinformatique
Station Biologique de Roscoff
FR 2424 CNRS UPMC
Place Georges Teissier
CS 90074
29688 Roscoff cedex
tel: ++33 (0)2 98 29 56 46 (interne : 415)
http://abims.sb-roscoff.fr/
http://www.sb-roscoff.fr/





This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.

Loading...