- for ( i = 0; i < strlen( scores ); i++ )
- {
- score = solexa2score( scores[ i ] );
- c = score2phred( score );
+ dec = solexa2dec( score );
+ c = dec2phred( c );
+
+ return c;
+}
+
+
+char phred2solexa( char score )
+{
+ /* Martin A. Hansen, September 2009 */
+
+ /* Converts an octal score in the Solexa range to an octal score */
+ /* in the Pred range, which is returned. */
+
+ int dec = 0;
+ char c = 0;
+
+ dec = phred2dec( score );
+ c = dec2solexa( c );
+
+ return c;
+}
+
+
+void solexa_str2phred_str( char *scores )
+{
+ /* Martin A. Hansen, September 2009 */
+
+ /* Converts a string of Solexa octal scores to Phred octal scores in-line. */
+
+ int i = 0;
+
+ for ( i = 0; i < strlen( scores ); i++ ) {
+ scores[ i ] = solexa2phred( scores[ i ] );
+ }
+}
+
+
+void phred_str2solexa_str( char *scores )
+{
+ /* Martin A. Hansen, September 2009 */
+
+ /* Converts a string of Phred octal scores to Solexa octal scores in-line. */
+
+ int i = 0;
+
+ for ( i = 0; i < strlen( scores ); i++ ) {
+ scores[ i ] = phred2solexa( scores[ i ] );
+ }
+}
+
+
+double phred_str_mean( char *scores )
+{
+ /* Martin A. Hansen, November 2009 */
+
+ /* Calculates the mean score as a float which is retuned. */
+
+ int len = 0;
+ int i = 0;
+ int sum = 0;
+ double mean = 0.0;
+
+ len = strlen( scores );