From: David B. <dav...@gm...> - 2010-07-03 09:56:51
|
Thanks a lot Mitch. On Fri, Jul 2, 2010 at 7:26 PM, Mitch Skinner <mit...@be...> wrote: > On 07/02/2010 09:57 AM, David Breimann wrote: >> >> Thank you! >> >> 1. Is it possible to call a subroutine defined in extraData from label >> (e.g. "label": "load_id")? I tried playing with the syntax, but >> couldn't figure it out. >> > > The "label" callback and the "extraData" callback both operate on bioperl > feature objects. So data doesn't go from the extraData outputs to the label > callback, as you seem to be assuming. Instead, in your "label" callback you > get data straight from the source. So, for example, you could so something > like > > "label": "sub { return \"foo\" . $_[0]->attributes(\"load_id\"); }", > > to get whatever information you wanted, directly from the bioperl feature > object. > >> 2. What is the structure of a feature object (read from a GFF)? >> > > That's a bioperl thing; refer to the bioperl documentation. When I want to > experiment to learn a perl API, I often use Devel::REPL (installed from > cpan), something like this: > > $ re.pl > > $ use Bio::DB::SeqFeature::Store > > $ my $db = Bio::DB::SeqFeature::Store->new(-dsn => "dbi:mysql:dmel_5_13") > $Bio_DB_SeqFeature_Store_DBI_mysql1 = > Bio::DB::SeqFeature::Store::DBI::mysql=HASH(0x97cae84); > > $ my @genes = $db->features(-seq_id => "4", -type => "gene") > > $ $genes[0]->attributes("load_id") > FBgn0040037 > > > Mitch > |