if ( $record = Maasha::Fastq::fastq2biopiece( $entry ) )
{
Maasha::Fastq::softmask_phred_str( $record->{ 'SEQ' }, $record->{ 'SCORES' }, $options->{ 'cutoff' } ) if $options->{ 'soft_mask' };
+ $record->{ 'SCORES' } = Maasha::Fastq::phred_str2dec_str( $record->{ 'SCORES' } ) if $options->{ 'convert2dec' };
Maasha::Biopieces::put_record( $record, $out );
}
if ( $record = Maasha::Fastq::fastq2biopiece( $entry ) )
{
Maasha::Fastq::softmask_solexa_str( $record->{ 'SEQ' }, $record->{ 'SCORES' }, $options->{ 'cutoff' } ) if $options->{ 'soft_mask' };
+ $record->{ 'SCORES' } = Maasha::Fastq::solexa_str2dec_str( $record->{ 'SCORES' } ) if $options->{ 'convert2dec' };
Maasha::Biopieces::put_record( $record, $out );
}
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+sub solexa_str2dec_str
+{
+ # Martin A. Hansen, September 2009
+
+ # Converts a string of Solexa octal scores to a ; separated
+ # string of decimal scores.
+
+ my ( $scores, # Solexa scores
+ ) = @_;
+
+ # Returns a string.
+
+ $scores =~ s/(.)/ solexa2dec( $1 ) . ";"/eg;
+
+ return $scores;
+}
+
+
+sub phred_str2dec_str
+{
+ # Martin A. Hansen, September 2009
+
+ # Converts a string of Phred octal scores to a ; separated
+ # string of decimal scores.
+
+ my ( $scores, # Phred scores
+ ) = @_;
+
+ # Returns a string.
+
+ $scores =~ s/(.)/ phred2dec( $1 ) . ";"/eg;
+
+ return $scores;
+}
+
+
sub get_entry
{
# Martin A. Hansen, July 2009.