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:
parent
20601f034e
commit
9e76e8aa0b
|
|
@ -1,5 +1,6 @@
|
||||||
package org.broadinstitute.sting.utils;
|
package org.broadinstitute.sting.utils;
|
||||||
|
|
||||||
|
import net.sf.samtools.util.StringUtil;
|
||||||
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
|
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -444,29 +445,8 @@ public class BaseUtils {
|
||||||
* @param bases the bases
|
* @param bases the bases
|
||||||
* @return the upper cased version
|
* @return the upper cased version
|
||||||
*/
|
*/
|
||||||
static public byte[] convertToUpperCase(final byte[] bases) {
|
static public void convertToUpperCase(final byte[] bases) {
|
||||||
for ( int i = 0; i < bases.length; i++ ) {
|
StringUtil.toUpperCase(bases);
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ public class Allele implements Comparable<Allele> {
|
||||||
if ( isRef ) throw new IllegalArgumentException("Cannot tag a symbolic allele as the reference allele");
|
if ( isRef ) throw new IllegalArgumentException("Cannot tag a symbolic allele as the reference allele");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bases = BaseUtils.convertToUpperCase(bases);
|
BaseUtils.convertToUpperCase(bases);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isRef = isRef;
|
this.isRef = isRef;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue