$options = Maasha::Biopieces::parse_options(
[
- { long => 'data_in', short => 'i', type => 'files!', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
- { long => 'num', short => 'n', type => 'uint', mandatory => 'no', default => undef, allowed => undef, disallowed => 0 },
- { long => 'quality', short => 'q', type => 'uint', mandatory => 'no', default => 20, allowed => undef, disallowed => undef },
- { long => 'skip_scores', short => 's', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
+ { long => 'data_in', short => 'i', type => 'files!', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
+ { long => 'num', short => 'n', type => 'uint', mandatory => 'no', default => undef, allowed => undef, disallowed => 0 },
+ { long => 'quality', short => 'q', type => 'uint', mandatory => 'no', default => 20, allowed => undef, disallowed => undef },
+ { long => 'skip_quality', short => 's', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
]
);
{
if ( $record = Maasha::Fastq::fastq2biopiece( $entry ) )
{
- if ( not $options->{ 'skip_scores' } )
+ if ( not $options->{ 'skip_quality' } )
{
Maasha::Fastq::lowercase_low_scores( $record->{ 'SEQ' }, $record->{ 'SCORES' }, $options->{ 'quality' } );
$options = Maasha::Biopieces::parse_options(
[
- { long => 'data_in', short => 'i', type => 'files!', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
- { long => 'num', short => 'n', type => 'uint', mandatory => 'no', default => undef, allowed => undef, disallowed => '0' },
- { long => 'format', short => 'f', type => 'string', mandatory => 'no', default => 'octal', allowed => 'octal,decimal', disallowed => undef },
- { long => 'quality', short => 'q', type => 'uint', mandatory => 'no', default => 20, allowed => undef, disallowed => undef },
- { long => 'skip_scores', short => 's', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
+ { long => 'data_in', short => 'i', type => 'files!', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
+ { long => 'num', short => 'n', type => 'uint', mandatory => 'no', default => undef, allowed => undef, disallowed => '0' },
+ { long => 'format', short => 'f', type => 'string', mandatory => 'no', default => 'octal', allowed => 'octal,decimal', disallowed => undef },
+ { long => 'quality', short => 'q', type => 'uint', mandatory => 'no', default => 20, allowed => undef, disallowed => undef },
+ { long => 'skip_quality', short => 's', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
]
);
{
if ( $record = Maasha::Fastq::fastq2biopiece( $entry ) )
{
- if ( not $options->{ 'skip_scores' } )
+ if ( not $options->{ 'skip_quality' } )
{
$record->{ 'SCORES' } =~ s/(\d+) ?/Maasha::Fastq::score2phred( $1 )/ge if $options->{ 'format' } eq 'decimal';
Maasha::Fastq::solexa2phred( $record->{ 'SCORES' } );
}
-void lowercase_low_scores( char *seq, char *scores, int threshold )
-{
- /* Martin A. Hansen, July 2009 */
-
- /* Given a sequence string and a score string (in FASTQ/Phread range) */
- /* lowercases all residues where the decimal score is below a given threshold. */
-
- int i = 0;
-
- for ( i = 0; i < strlen( seq ); i++ )
- {
- if ( phred2score( scores[ i ] ) < threshold ) {
- seq[ i ] = tolower( seq[ i ] );
- }
- }
-}
-
-
void solexa2phred( char *scores )
{
/* Martin A. Hansen, July 2009 */
for ( i = 0; i < strlen( scores ); i++ )
{
- score = solexa2score( scores[ i ] );
- c = score2phred( score );
+ score = solexa2score( scores[ i ] );
+ c = score2phred( score );
// printf( "scores[i]: %c score: %d char: %c\n", scores[ i ], score, c );
}
+void lowercase_low_scores( char *seq, char *scores, int threshold )
+{
+ /* Martin A. Hansen, July 2009 */
+
+ /* Given a sequence string and a score string (in FASTQ/Phread range) */
+ /* lowercases all residues where the decimal score is below a given threshold. */
+
+ int i = 0;
+
+ for ( i = 0; i < strlen( seq ); i++ )
+ {
+ if ( phred2score( scores[ i ] ) < threshold ) {
+ seq[ i ] = tolower( seq[ i ] );
+ }
+ }
+}
+
+
END_C