]> git.donarmstrong.com Git - biopieces.git/commitdiff
fixed SAM.pm qual scores from phred-33 to phred-64
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 13 Oct 2010 10:19:37 +0000 (10:19 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 13 Oct 2010 10:19:37 +0000 (10:19 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1127 74ccb610-7750-0410-82ae-013aeee3265d

code_perl/Maasha/SAM.pm

index 197a957619021f11718b923e4940e2dab4bdf657..ff8cb66e61dc8682db2aea75bec1b84fe2bbbdf7 100644 (file)
@@ -118,6 +118,7 @@ sub sam2biopiece
     $record->{ 'ISIZE' }    = $entry->[ ISIZE ];
     $record->{ 'SEQ' }      = $entry->[ SEQ ];
     $record->{ 'SCORES' }   = $entry->[ QUAL ];
+    $record->{ 'SCORES' }   =~ s/(.)/chr( ( ord( $1 ) - 33 ) + 64 )/ge; # convert phred-33 to phred-64 scores
     $record->{ 'SCORE' }    = sprintf( "%.2f", Maasha::Fastq::phred_str_mean( $entry->[ QUAL ] ) );
 
     $record->{ 'S_BEG' } -= 1 if $record->{ 'S_BEG' }  != 0;