perl
logs about perl
1 2009-2-4 custom GBrowse GFF3
1.2 steps
if the last column of a non-chromosome line has 'ID' in it, find corresponding gene id using its value and add gene_symbol as 'Alias' and description as 'description'. Escape ; and , with %3B and %2C. code is variation/src/ImproveTAIRGeneGFF.py.
re-initialize and load the new GFF file into db by dazhe's init_db.pl and load.pl
add following configuration into arabidopsis1.conf:
label = sub { my $feature = shift; #my @aliases = $feature->aliases; my @aliases = $feature->attributes('Alias'); #2009-2-4 both above and this works #my @gene_symbol = $feature->attributes('gene_symbol'); #2009-2-4 gene_symbol is not built into the gbrowse search engine. but Alias is. return "@aliases"; #return "@gene_symbol"; } balloon hover = sub { my $feature = shift; my $n = $feature->name(); my $ref = $feature->seq_id(); my $start = $feature->start(); my $end = $feature->end(); my @description = $feature->attributes("description"); #my @notes = $feature->notes; #if the description is put under 'Note' return "Protein Coding Gene: $n $ref:$start..$end. @description"; #return "@description"; }
One tricky thing is that feature->attributes("xxx") returns an array (@) and array has to be wrapped within ", i.e. "@description".