From c397116261239c31546edc3721d27ff1120ee158 Mon Sep 17 00:00:00 2001 From: isaak Date: Fri, 29 Oct 2010 16:45:27 +0200 Subject: [PATCH] peak cM position displayed now also when the QTL's peak is not on a genetic marker... --- cgi-bin/phenome/qtl.pl | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/cgi-bin/phenome/qtl.pl b/cgi-bin/phenome/qtl.pl index 69e60e5b3..f5ac6d407 100755 --- a/cgi-bin/phenome/qtl.pl +++ b/cgi-bin/phenome/qtl.pl @@ -129,7 +129,11 @@ sub confidence_interval my @rows = grep { /\t$lg\t/ } read_file( $ci_lod_file ); - my (@marker_lods, @all_lods); + my (@marker_lods, @all_lods, @marker_html); + my ( $peak_marker_lod, $highest_lod, $peak_pos ); + + my $rnd = Number::Format->new(); + my $peak_position; foreach my $row (@rows) { my ( $m, $m_chr, $m_pos, $m_lod ) = split (/\t/, $row); @@ -140,33 +144,26 @@ sub confidence_interval unless ( !$marker ) { push @marker_lods, $m_lod; } - } - - my $rnd = Number::Format->new(); - my $peak_marker_lod = $rnd->round(max(@marker_lods), 2); - my $highest_lod = $rnd->round(max(@all_lods), 2); - - - my @marker_html; - my $peak_position; + $peak_marker_lod = $rnd->round(max(@marker_lods), 2); + $highest_lod = $rnd->round(max(@all_lods), 2); + $peak_position = $m_pos if ($rnd->round($m_lod, 2) == $highest_lod); + } + foreach my $row (@rows) { my ( $m, $m_chr, $m_pos, $m_lod ) = split (/\t/, $row); $m_pos = $rnd->round($m_pos, 1); $m_lod = $rnd->round($m_lod, 2); - - if ($m_lod == $highest_lod) { $peak_position = $m_pos;} - + my $marker = CXGN::Marker->new_with_name( $dbh, $m ); unless ( !$marker ) { my $m_id = $marker->marker_id(); - - my $remark1 = "Highest LOD score is $highest_lod at $peak_position cM." if ( $m_lod == $peak_marker_lod ); - my $remark2 = "The Closest marker to the peak position ($peak_position cM)." if ( $m eq $p_m ); + my $remark1 = " Highest LOD score is $highest_lod at $peak_position cM." if ( $m_lod == $peak_marker_lod ); + my $remark2 = " The closest marker to the peak position ($peak_position cM)." if ( $m eq $p_m ); push @marker_html, [ -- 2.11.4.GIT