Convert a string 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 String dna)
| 259 | * @return the byte array. |
| 260 | */ |
| 261 | public static byte[] stringDNAtoByte(final String dna) { |
| 262 | final byte[] dnaBytes = new byte[dna.length()]; |
| 263 | for (int i = 0; i < dna.length(); ++i) { |
| 264 | dnaBytes[i] = (byte) getDNA(dna.charAt(i)); |
| 265 | } |
| 266 | return dnaBytes; |
| 267 | } |
| 268 | |
| 269 | /** |
| 270 | * Convert a byte array containing valid nucleotide characters into a byte array |