]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_perl/Maasha/Fastq.pm
fixed issues in fastq handling
[biopieces.git] / code_perl / Maasha / Fastq.pm
index 38ce4712705e49898dcd6e50ccc32fd2c81a5901..cc895203672dc241ffe90773994508e4b73c178c 100644 (file)
@@ -105,24 +105,6 @@ char score2phred( int score )
 }
 
 
-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 */
@@ -135,8 +117,8 @@ void solexa2phred( char *scores )
 
     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 );
 
@@ -145,6 +127,24 @@ void solexa2phred( char *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 ] );
+        }
+    }
+}
+
+
 END_C