[Gmod-ajax] Inserting extra configuration with flatfile-to-json.pl

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

[Gmod-ajax] Inserting extra configuration with flatfile-to-json.pl

Mikael Brandström Durling
Hi,

I was trying to set the glyph of a CanvasFeatyre track on the flat file-to-json.pl command line. In the documentation, there is a —clientConfig option, which to me gives the impression that the json supplied there will be merged into the main config. However, it seems that it is merged into the style part of the configuration, rather than the main part. Is this the intended function? If so, i think the documentation from —help should be updated. It would be good to be able to insert any arguments into the main track config with such an argument though.

Best regards,
Mikael


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Inserting extra configuration with flatfile-to-json.pl

Robert Buels-2
Yes, that is what --clientConfig does, it merges into the `style`
section.  This behavior is kind of left over from when HTMLFeatures were
the only track type.  I'll update the POD in release 1.11.2 to clarify this.

Robert Buels
Lead Developer
JBrowse - http://jbrowse.org

On 02/07/2014 09:26 AM, Mikael Brandström Durling wrote:

> Hi,
>
> I was trying to set the glyph of a CanvasFeatyre track on the flat file-to-json.pl command line. In the documentation, there is a —clientConfig option, which to me gives the impression that the json supplied there will be merged into the main config. However, it seems that it is merged into the style part of the configuration, rather than the main part. Is this the intended function? If so, i think the documentation from —help should be updated. It would be good to be able to insert any arguments into the main track config with such an argument though.
>
> Best regards,
> Mikael
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> Gmod-ajax mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-ajax
>

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Inserting extra configuration with flatfile-to-json.pl

Mikael Brandström Durling
7 feb 2014 kl. 15:44 skrev Robert Buels <[hidden email]>:

> Yes, that is what --clientConfig does, it merges into the `style` section.  This behavior is kind of left over from when HTMLFeatures were the only track type.  I'll update the POD in release 1.11.2 to clarify this.

Good.

Would it be possible to implement a new option, where one can supply a boilerplate for the configuration, where further options are replacing any collisions? Eg like the patch below. What I’m after is to be able to supply glyph and subParts to a CanvasFeature track.

Mikael

--- FlatFileToJson.pm.orig 2014-02-07 16:58:33.056784001 +0100
+++ FlatFileToJson.pm 2014-02-07 17:15:54.120784001 +0100
@@ -51,6 +51,7 @@
         "subfeatureClasses=s",
         "maxLookback=i",
         "clientConfig=s",
+        "config=s",
         "metadata=s",
         "thinType=s",
         "thickType=s",
@@ -86,14 +87,15 @@
         $self->opt( nclChunk => $nclChunk );
     }
 
-    for my $optname ( qw( clientConfig subfeatureClasses metadata ) ) {
+    for my $optname ( qw( clientConfig subfeatureClasses metadata config ) ) {
         if( my $o = $self->opt($optname) ) {
             $self->opt( $optname => Bio::JBrowse::JSON->new->decode( $o ));
         }
     }
 
 
-    my %config = (
+    # Merge configurations
+    my %tmp_config = (
         trackType      => $self->opt('trackType'),
         style          => {
             %{ $self->opt('clientConfig') || {} },
@@ -108,6 +110,13 @@
         compress     => $self->opt('compress'),
      );
 
+    my %config = ();
+    if($self->opt('config')){
+        @config{keys $self->opt('config')} = values $self->opt('config');
+    }
+    @config{keys %tmp_config} = values %tmp_config;
+
+
     my $feature_stream = $self->opt('gff') ? $self->make_gff_stream :
                          $self->opt('bed') ? $self->make_bed_stream :
                          $self->opt('gbk') ? $self->make_gbk_stream :


>
> Robert Buels
> Lead Developer
> JBrowse - http://jbrowse.org
>
> On 02/07/2014 09:26 AM, Mikael Brandström Durling wrote:
>> Hi,
>>
>> I was trying to set the glyph of a CanvasFeatyre track on the flat file-to-json.pl command line. In the documentation, there is a —clientConfig option, which to me gives the impression that the json supplied there will be merged into the main config. However, it seems that it is merged into the style part of the configuration, rather than the main part. Is this the intended function? If so, i think the documentation from —help should be updated. It would be good to be able to insert any arguments into the main track config with such an argument though.
>>
>> Best regards,
>> Mikael
>>
>>
>> ------------------------------------------------------------------------------
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Gmod-ajax mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gmod-ajax
>>


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Inserting extra configuration with flatfile-to-json.pl

Robert Buels-2
Ah, thanks a lot for the patch!  It will be in 1.11.2.


Robert Buels
Lead Developer
JBrowse - http://jbrowse.org

On 02/07/2014 11:23 AM, Mikael Brandström Durling wrote:

> 7 feb 2014 kl. 15:44 skrev Robert Buels <[hidden email]>:
>
>> Yes, that is what --clientConfig does, it merges into the `style` section.  This behavior is kind of left over from when HTMLFeatures were the only track type.  I'll update the POD in release 1.11.2 to clarify this.
>
> Good.
>
> Would it be possible to implement a new option, where one can supply a boilerplate for the configuration, where further options are replacing any collisions? Eg like the patch below. What I’m after is to be able to supply glyph and subParts to a CanvasFeature track.
>
> Mikael
>
> --- FlatFileToJson.pm.orig 2014-02-07 16:58:33.056784001 +0100
> +++ FlatFileToJson.pm 2014-02-07 17:15:54.120784001 +0100
> @@ -51,6 +51,7 @@
>           "subfeatureClasses=s",
>           "maxLookback=i",
>           "clientConfig=s",
> +        "config=s",
>           "metadata=s",
>           "thinType=s",
>           "thickType=s",
> @@ -86,14 +87,15 @@
>           $self->opt( nclChunk => $nclChunk );
>       }
>
> -    for my $optname ( qw( clientConfig subfeatureClasses metadata ) ) {
> +    for my $optname ( qw( clientConfig subfeatureClasses metadata config ) ) {
>           if( my $o = $self->opt($optname) ) {
>               $self->opt( $optname => Bio::JBrowse::JSON->new->decode( $o ));
>           }
>       }
>
>
> -    my %config = (
> +    # Merge configurations
> +    my %tmp_config = (
>           trackType      => $self->opt('trackType'),
>           style          => {
>               %{ $self->opt('clientConfig') || {} },
> @@ -108,6 +110,13 @@
>           compress     => $self->opt('compress'),
>        );
>
> +    my %config = ();
> +    if($self->opt('config')){
> +        @config{keys $self->opt('config')} = values $self->opt('config');
> +    }
> +    @config{keys %tmp_config} = values %tmp_config;
> +
> +
>       my $feature_stream = $self->opt('gff') ? $self->make_gff_stream :
>                            $self->opt('bed') ? $self->make_bed_stream :
>                            $self->opt('gbk') ? $self->make_gbk_stream :
>
>
>>
>> Robert Buels
>> Lead Developer
>> JBrowse - http://jbrowse.org
>>
>> On 02/07/2014 09:26 AM, Mikael Brandström Durling wrote:
>>> Hi,
>>>
>>> I was trying to set the glyph of a CanvasFeatyre track on the flat file-to-json.pl command line. In the documentation, there is a —clientConfig option, which to me gives the impression that the json supplied there will be merged into the main config. However, it seems that it is merged into the style part of the configuration, rather than the main part. Is this the intended function? If so, i think the documentation from —help should be updated. It would be good to be able to insert any arguments into the main track config with such an argument though.
>>>
>>> Best regards,
>>> Mikael
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Managing the Performance of Cloud-Based Applications
>>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>>> Read the Whitepaper.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Gmod-ajax mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/gmod-ajax
>>>
>
>

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax