From: martinahansen Date: Mon, 22 Mar 2010 08:28:47 +0000 (+0000) Subject: ugly fix of BGB ladder problem X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a18e01da7b3510b9a21afca8c091a151657cfb4d;p=biopieces.git ugly fix of BGB ladder problem git-svn-id: http://biopieces.googlecode.com/svn/trunk@938 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_perl/Maasha/BGB/Track.pm b/code_perl/Maasha/BGB/Track.pm index a4f8c90..e4f35b7 100644 --- a/code_perl/Maasha/BGB/Track.pm +++ b/code_perl/Maasha/BGB/Track.pm @@ -369,14 +369,13 @@ sub track_linear { $x1 = sprintf( "%.0f", ( $entry->[ S_BEG ] - $beg ) * $factor ); $x2 = $x1 + $w; + $x1 = 0 if $x1 < 0; + $x2 = $cookie->{ 'IMG_WIDTH' } if $x2 > $cookie->{ 'IMG_WIDTH' }; for ( $y_step = 0; $y_step < @ladder; $y_step++ ) { last if $x1 >= $ladder[ $y_step ] + 1; } - $x1 = 0 if $x1 < 0; - $x2 = $cookie->{ 'IMG_WIDTH' } if $x2 > $cookie->{ 'IMG_WIDTH' }; - $y1 = $cookie->{ 'TRACK_OFFSET' } + ( ( 1.1 + $cookie->{ 'FEAT_WIDTH' } ) * $y_step ); $y2 = $y1 + $cookie->{ 'FEAT_WIDTH' }; @@ -406,7 +405,8 @@ sub track_linear push @features, feature_align( $entry, $beg, $y1, $factor, $cookie->{ 'FEAT_WIDTH' } ) if $entry->[ ALIGN ] ne '.'; - $ladder[ $y_step ] = $x1 + $w; + # $ladder[ $y_step ] = $x1 + $w; + $ladder[ $y_step ] = sprintf( "%.0f", ( $entry->[ S_BEG ] - $beg ) * $factor ) + $w; } }