}
StringBuilder sb = new StringBuilder();
- sb.append(forwardStrand ? reference : Dna
- .getComplement((char) reference[0]));
+ sb.append(forwardStrand ? (char) reference[0] : complement(reference));
/*
* inspect alleles and record SNP variants (as the variant
if (alleleBase.length == 1)
{
sb.append(",").append(
- forwardStrand ? alleleBase : Dna
- .getComplement((char) alleleBase[0]));
+ forwardStrand ? (char) alleleBase[0]
+ : complement(alleleBase));
}
}
}
}
/**
+ * A convenience method to complement a dna base and return the string value
+ * of its complement
+ *
+ * @param reference
+ * @return
+ */
+ protected String complement(byte[] reference)
+ {
+ return String.valueOf(Dna.getComplement((char) reference[0]));
+ }
+
+ /**
* Determines the location of the query range (chromosome positions) in a
* different reference assembly.
* <p>