commit | 4ead7d480f6e4f8684c9b92cc443b8302a346f32 | [log] [tgz] |
---|---|---|
author | jianfeng.jia@gmail.com <jianfeng.jia@gmail.com@123451ca-8445-de46-9d55-352943316053> | Fri Apr 05 07:02:26 2013 +0000 |
committer | jianfeng.jia@gmail.com <jianfeng.jia@gmail.com@123451ca-8445-de46-9d55-352943316053> | Fri Apr 05 07:02:26 2013 +0000 |
tree | 2de3bfad8911823db2a8707f6cedccebf9e8c694 | |
parent | 8af245bc3b0c9df46e315c832cf167a242800df2 [diff] |
add convertion from bitmap to gencode git-svn-id: https://hyracks.googlecode.com/svn/branches/fullstack_genomix@3321 123451ca-8445-de46-9d55-352943316053
diff --git a/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/type/Kmer.java b/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/type/Kmer.java index e405424..e4ff126 100644 --- a/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/type/Kmer.java +++ b/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/type/Kmer.java
@@ -82,6 +82,26 @@ return r; } + /** + * It works for path merge. + * Merge the kmer by his next, we need to make sure the @{t} is a single neighbor. + * @param t the neighbor code in BitMap + * @return the genecode + */ + public static byte getGeneCodeFromBitMap(byte t) { + switch (t) { + case 1 << A: + return A; + case 1 << C: + return C; + case 1 << G: + return G; + case 1 << T: + return T; + } + return -1; + } + public static byte mergePreNextAdj(byte pre, byte next) { return (byte) (pre << 4 | (next & 0x0f)); }