MCPcopy Create free account
hub / github.com/RealTimeGenomics/rtg-tools / byteDNAtoByte

Method byteDNAtoByte

src/main/java/com/rtg/mode/DNA.java:275–281  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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)

Callers 2

testByteDNAtoByteMethod · 0.95
sequenceDataMethod · 0.95

Calls 1

getDNAMethod · 0.95

Tested by 1

testByteDNAtoByteMethod · 0.76