X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=code_perl%2FMaasha%2FFastq.pm;h=d70bf3e6cbbf2675e47feec6523976ae92c7bc9e;hb=0253e2b8737fba111f4ec7406704dacaa4877d8d;hp=b48279c24781b3722cbae9976c776eeb25639eec;hpb=123dbbd20d587b61d0589aa17031ff1796998313;p=biopieces.git diff --git a/code_perl/Maasha/Fastq.pm b/code_perl/Maasha/Fastq.pm index b48279c..d70bf3e 100644 --- a/code_perl/Maasha/Fastq.pm +++ b/code_perl/Maasha/Fastq.pm @@ -443,6 +443,23 @@ sub dec_str2solexa_str return $scores; } +sub dec_str2phred_str +{ + # Martin A. Hansen, November 2013. + + # Converts a ; separated string of decimal scores to a + # string of Phred scores. + + my ( $scores, # Decimal score string + ) = @_; + + # Returns a string. + + $scores =~ s/(-\d{1,2})/0/g; + $scores =~ s/(\d{1,2});?/dec2phred( $1 )/eg; + + return $scores; +} sub get_entry {