From 4e76afec97dd079aba6df9c1e1f4ba78652943b8 Mon Sep 17 00:00:00 2001 From: Rami Rauch Date: Wed, 19 Nov 2008 18:45:58 +0000 Subject: [PATCH] added: if peak score < zero put zero --- htswanalysis/scripts/QuEST_2_narrowPeak.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htswanalysis/scripts/QuEST_2_narrowPeak.pm b/htswanalysis/scripts/QuEST_2_narrowPeak.pm index 3545317..7f29b7a 100755 --- a/htswanalysis/scripts/QuEST_2_narrowPeak.pm +++ b/htswanalysis/scripts/QuEST_2_narrowPeak.pm @@ -5,7 +5,7 @@ use warnings; ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Transform QuEST peakcalling .out file to naarowPeak format (see doc at http://genomewiki.ucsc.edu/EncodeDCC/index.php/File_Formats) +# Transform QuEST peakcalling .out file to narrowPeak format (see doc at http://genomewiki.ucsc.edu/EncodeDCC/index.php/File_Formats) # Input rec example: chr8 w: 433 locmax: 5.68905 at: 126511693 nulls: 0.145256 ef: 27.6411204454239 # w: we don't need. # locmax:is the absolute height of the peak. it does not correspond to the actual tag reads, because not all tags contribute equally to the peak determination. @@ -98,8 +98,10 @@ while() if($graphscore > $max){$max = $graphscore;} $bigscore = int( ($graphscore/$max)*1000 ); - ##$BEDrec = "$chr\t$start\t$end\t$name\t$bigscore"; - $NPrec = sprintf("%s\t%d\t%d\t%s\t%d\t%s\t%0.3f\t%s\t%d",$chr,$start,$end,$name,$bigscore,'.',$graphscore,'-1',$seqwindow); ## DBG: ,$bigscore,$score,$locmax,$ef); + if($bigscore < 0){$bigscore = 0;} + if($graphscore < 0){$graphscore = 0;} + + $NPrec = sprintf("%s\t%d\t%d\t%s\t%d\t%s\t%0.3f\t%s\t%s\t%d",$chr,$start,$end,$name,$bigscore,'.',$graphscore,'-1','-1',$seqwindow); ##,'DBG:',$bigscore,$score,$locmax,$ef); print NPFILE "$NPrec\n"; } -- 2.30.2