Just noticed that the efficient conversion to uppercase method is redundant since it's already implemented efficiently in Picard; let's just have a single implementation.

This commit is contained in:
Eric Banks 2012-08-22 11:26:08 -04:00
parent 20601f034e
commit 9e76e8aa0b
2 changed files with 4 additions and 24 deletions

View File

@ -1,5 +1,6 @@
package org.broadinstitute.sting.utils;
import net.sf.samtools.util.StringUtil;
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
import java.util.Arrays;
@ -444,29 +445,8 @@ public class BaseUtils {
* @param bases the bases
* @return the upper cased version
*/
static public byte[] convertToUpperCase(final byte[] bases) {
for ( int i = 0; i < bases.length; i++ ) {
if ( (char)bases[i] >= 'a' )
bases[i] = toUpperCaseBase(bases[i]);
}
return bases;
}
static public byte toUpperCaseBase(final byte base) {
switch (base) {
case 'a':
return 'A';
case 'c':
return 'C';
case 'g':
return 'G';
case 't':
return 'T';
case 'n':
return 'N';
default:
return base;
}
static public void convertToUpperCase(final byte[] bases) {
StringUtil.toUpperCase(bases);
}
/**

View File

@ -105,7 +105,7 @@ public class Allele implements Comparable<Allele> {
if ( isRef ) throw new IllegalArgumentException("Cannot tag a symbolic allele as the reference allele");
}
else {
bases = BaseUtils.convertToUpperCase(bases);
BaseUtils.convertToUpperCase(bases);
}
this.isRef = isRef;