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 > |