Convert a byte array containing valid nucleotide characters into a byte array with values (0=N, ... 4=T). @param dna the string to be converted. @return the byte array.
(final byte[] dna)
| 273 | * @return the byte array. |
| 274 | */ |
| 275 | public static byte[] byteDNAtoByte(final byte[] dna) { |
| 276 | final byte[] dnaBytes = new byte[dna.length]; |
| 277 | for (int i = 0; i < dna.length; ++i) { |
| 278 | dnaBytes[i] = (byte) getDNA((char) dna[i]); |
| 279 | } |
| 280 | return dnaBytes; |
| 281 | } |
| 282 | |
| 283 | /** |
| 284 | * Get an integer in the range (0=N, ... 4=T) |