MCPcopy Create free account
hub / github.com/BirolLab/RNA-Bloom / bitsToSeq

Method bitsToSeq

src/rnabloom/util/SeqBitsUtils.java:293–311  ·  view source on GitHub ↗
(byte[] bytes, int seqLen)

Source from the content-addressed store, hash-verified

291 }
292
293 public static String bitsToSeq(byte[] bytes, int seqLen) {
294 int numFullBytes = seqLen / 4;
295 int numExtraBases = seqLen % 4;
296
297 char[] sb = new char[seqLen];
298 for (int i=0; i<numFullBytes; ++i) {
299 getTetramer(bytes[i]).getChars(0, 4, sb, i*4);
300 }
301
302 if (numExtraBases > 0) {
303 String t = getTetramer(bytes[numFullBytes]);
304 int offset = numFullBytes*4;
305 for (int i=0; i<numExtraBases; ++i) {
306 sb[offset + i] = t.charAt(i);
307 }
308 }
309
310 return new String(sb);
311 }
312
313 public static String bitsToSeqParallelized(byte[] bytes, int seqLen) {
314 int numFullBytes = seqLen / 4;

Callers 3

nextMethod · 0.80
toStringMethod · 0.80
subStringMethod · 0.80

Calls 2

getTetramerMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected