Show scores from bigWigSet in GBrowse
1
0
Entering edit mode
9.8 years ago
Leszek 4.2k

I would like to access scores from Bio::DB::BigSet track in GBrowse. When I use in /etc/gbrowse/genome.conf:

balloon click = sub { my $f = shift; return join ' ',$f->score() }

GBrowse returns some hash values ie. HASH(0x6bf7cc0) instead of scores.

Do you have an idea how to get scores by clicking, or at least given region min and max scores?

bigWig GBrowse • 1.7k views
ADD COMMENT
0
Entering edit mode
9.8 years ago
mxs ▴ 530

Hi,

If you are getting a reference address that means you are not accessing the value. To fix this you can do two things. Either, read the documentation where it says that score function is a part of Bio::DB::BigWig module (unless I missed something -> which is an option):

"the score() method returns a hash of statistical summary information containing the keys validCount, maxVal, minVal, sumData and sumSquares as described earlier."

which explains the "error". Or use Data::Dumper in order to see the structure of the returned hash value and then decide how would you like to proceed.

Also, if you want to join hash values then you cannot just invoke jon function on the hash but you need to let the interpreter know what to join, keys or values. for example (this is not the only way to to this):


my %hash = (a => "m1", 2 => "mb"); 
my $str = join(", ", values %hash);
print $str;

or something like :

my %hash = (a => "m1", 2 => "mb"); 
my $str = join(", ", map{"$_ -> $hash{$_}"}keys %hash);
print $str;
ADD COMMENT

Login before adding your answer.

Traffic: 1493 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6