From: martinahansen Date: Wed, 25 Nov 2009 15:02:46 +0000 (+0000) Subject: fixed color palette in KISS X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ad34bf968468bed4573a9c14f350e5a0543c83ef;p=biopieces.git fixed color palette in KISS git-svn-id: http://biopieces.googlecode.com/svn/trunk@772 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_perl/Maasha/GFF.pm b/code_perl/Maasha/GFF.pm index 0a5608d..407a326 100644 --- a/code_perl/Maasha/GFF.pm +++ b/code_perl/Maasha/GFF.pm @@ -91,6 +91,8 @@ sub gff_entry_get @fields = split /\t/, $line; + next if scalar @fields < 9; + return wantarray ? @fields : \@fields; } } diff --git a/code_perl/Maasha/KISS/IO.pm b/code_perl/Maasha/KISS/IO.pm index f4f5605..bfcc7ba 100644 --- a/code_perl/Maasha/KISS/IO.pm +++ b/code_perl/Maasha/KISS/IO.pm @@ -165,7 +165,7 @@ sub kiss_sort # Returns nothing. - `sort -k 2,2n -k 3,3n > $file.sort`; + `sort -k 2,2n -k 3,3n $file > $file.sort`; rename "$file.sort", $file; } diff --git a/www/cgi-bin/index.cgi b/www/cgi-bin/index.cgi index a2328e6..3d1a118 100755 --- a/www/cgi-bin/index.cgi +++ b/www/cgi-bin/index.cgi @@ -570,9 +570,9 @@ sub sec_browse for ( $i = 0; $i < @tracks; $i++ ) { - push @features, [ Maasha::KISS::Track::track_feature( $tracks[ $i ], $draw_metrics, $cookie ) ]; + $draw_metrics->{ 'FEAT_COLOR' } = palette( $i ); - $draw_metrics->{ 'FEAT_COLOR' } = [ 0, 0, 1 ]; + push @features, [ Maasha::KISS::Track::track_feature( $tracks[ $i ], $draw_metrics, $cookie ) ]; } $file = "fisk.png"; @@ -621,6 +621,28 @@ sub sec_browse } +sub palette +{ + my ( $i, + ) = @_; + + my ( $palette, $color ); + + $palette = [ + [ 30, 130, 130 ], + [ 30, 50, 150 ], + [ 130, 130, 50 ], + [ 130, 90, 130 ], + [ 130, 70, 70 ], + ]; + + $color = $palette->[ $i ]; + + map { $_ /= 255 } @{ $color }; + + return $color; +} + # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<