From: Fox, R. <Ric...@co...> - 2009-12-22 17:14:30
|
Hi, Apologies if this as already been answered but I'm not able to get the urlTemplate functionality working using the extraData approach that's given in the Dmel.json example. It's not clear from the just the Dmel.json file what "load_id" is referring to. I assumed it was referring to something in the GFF file but the obvious failed to work, namely (in the last field): Name=myname;load_id=my_load_id_for_use_in_urlTemplate Does anyone know how to place data into a GFF file for use in the urlTemplate? Thanks for the help! Richard |
From: Giles V. <gv...@sa...> - 2009-12-22 17:19:17
|
In my GFF files I have an ID field, this seems to work for me. On 22 Dec 2009, at 17:01, Fox, Richard wrote: > Hi, > > Apologies if this as already been answered but I’m not able to get > the urlTemplate functionality working using the extraData approach > that’s given in the Dmel.json example. It’s not clear from the just > the Dmel.json file what “load_id” is referring to. I assumed it was > referring to something in the GFF file but the obvious failed to > work, namely (in the last field): > > Name=myname;load_id=my_load_id_for_use_in_urlTemplate > > Does anyone know how to place data into a GFF file for use in the > urlTemplate? > > Thanks for the help! > > Richard > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast > and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Gmod-ajax mailing list > Gmo...@li... > https://lists.sourceforge.net/lists/listinfo/gmod-ajax -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a compa ny registered in England with number 2742969, whose registered office is 2 15 Euston Road, London, NW1 2BE. |
From: <gv...@sa...> - 2009-12-22 23:31:31
|
Hi Richard, Sorry I should have been more specific, I think the ID attribute needs to be in the GFF file. Like this: BB chado gene 1 1920 . + . ID=BB0001;Name=BB0001 In my JSON config I have : ... "TRACK DEFAULTS": { "class": "feature", "autocomplete": "all", "type" : "true", "phase" : "true", "extraData": {"load_id": "sub {shift->attributes(\"load_id\");}"}, "urlTemplate": "/gene/{load_id}" }, ... I think the load_id variable is populated from the GFF's ID attribute inside column 9. Regards, Giles > Thanks so much Giles, > > > > This is what I've tried: > > > > contig_103 example contig 1 1350 > . . . Name=contig_103 > > contig_103 AUGUSTUS gene 127 1350 > 0.67 + . > Name=Genepred:contig_103:127..1350;ID=foo > > contig_103 AUGUSTUS CDS 127 653 > 0.72 + 0 > Name=CDSpred:contig_103:127..653;ID=bar > > contig_103 AUGUSTUS CDS 785 1350 > 0.9 + 1 > Name=CDSpred:contig_103:785..1350;ID=bam > > > > And in the .json file: > > > > "tracks": [ > > { > > "track": "PredictedCDS", > > "key": "Predicted CDS", > > "feature": ["CDS:AUGUSTUS"], > > "class": "cds", > > "phase": 1, > > "urlTemplate": > "http://localhost/cgi-bin/jbrowse/C1wt/feature.cgi?{ID}" > > }, > > { > > "track": "PredictedGenes", > > "key": "Predicted Genes", > > "feature": ["gene:AUGUSTUS"], > > "class": "dblhelix", > > "subfeatures":true, > > "urlTemplate": > "http://localhost/cgi-bin/jbrowse/C1wt/feature.cgi?{ID}", > > "extraData": {"ID": "sub {shift->attributes(\"ID\");}"} > > } > > ] > > > > Neither approach seems to work. The first construct (PredictedCDS) > gives '...feature.cgi?undefined' while the second construct > (PredictedGenes) gives '...feature.cgi?null'. > > > > Any ideas? I'm sure I'm missing something basic. > > > > Best, > > > > Richard > > > > From: Giles Velarde [mailto:gv...@sa... -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE. |
From: Mitch S. <mit...@be...> - 2009-12-22 23:48:25
|
Hi, sorry this isn't documented better. The jbrowse scripts get data from a data source and put a subset of that data into JSON-formatted files that the client can consume. In those JSON files, each feature has a set of attributes, and each of those attributes has a name. The required attributes are named "start", "end", and "strand"; there are also some optional attributes named "type", "phase", "subfeatures", and "label" that you can optionally include in the JSON by setting a config setting or using a command line parameter. These names are what you can put in curly brackets in a urlTemplate. You can use the extraData config setting to include more attributes in the JSON. extraData is a set of name: callback pairs. The bioperl feature object is passed to the callback (which should be a perl sub); whatever the callback returns is included in the JSON in the slot with the given name. Then you can use that name in curly brackets in a urlTemplate and whatever was in that slot for the given feature will be substituted into the urlTemplate. In the example from the Dmel demo config: "urlTemplate": "http://flybase.org/cgi-bin/fbidq.html?{load_id}", "extraData": {"load_id": "sub {shift->attributes(\"load_id\");}"} "load_id" is something the Bio::DB::SeqFeature::Store code generates. That code needs to guarantee unique IDs in its database, so it generates its own IDs. If the GFF file that the data came from originally had an ID attribute, it goes into the "load_id" attribute. And you can get the attribute from the bioperl object with ->attributes("load_id") Any piece of information that you could pull out of the bioperl object can be extracted by the callback and included in the JSON, and you can name it whatever you want as long as it's not a name that's already reserved (maybe JBrowse should do something like GFF3 and reserve capitalized names or something). Giles is right; if it's "ID" in the GFF3 named attribute column, it'll be "load_id" on the bioperl object because of the way Bio::DB::SeqFeature::Store works. Upper-case attributes may get renamed or otherwise moved around because the GFF3 parser treats them specially, but if it's a lower-case attribute then it shouldn't get mangled, I think. Unless it's "load_id", in which case I guess it gets replaced by the bioperl code? HTH, Mitch On 12/22/2009 09:01 AM, Fox, Richard wrote: > > Hi, > > Apologies if this as already been answered but I'm not able to get the > urlTemplate functionality working using the extraData approach that's > given in the Dmel.json example. It's not clear from the just the > Dmel.json file what "load_id" is referring to. I assumed it was > referring to something in the GFF file but the obvious failed to work, > namely (in the last field): > > Name=myname;load_id=my_load_id_for_use_in_urlTemplate > > Does anyone know how to place data into a GFF file for use in the > urlTemplate? > > Thanks for the help! > > Richard > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > > > _______________________________________________ > Gmod-ajax mailing list > Gmo...@li... > https://lists.sourceforge.net/lists/listinfo/gmod-ajax > |