[med-svn] [Git][med-team/jebl2][upstream] New upstream version 0.1+git20201011.969bd4b
Pierre Gruet
gitlab at salsa.debian.org
Mon Oct 12 20:32:52 BST 2020
Pierre Gruet pushed to branch upstream at Debian Med / jebl2
Commits:
b57cdf8e by Pierre Gruet at 2020-10-12T21:23:20+02:00
New upstream version 0.1+git20201011.969bd4b
- - - - -
3 changed files:
- src/jebl/evolution/sequences/NucleotideState.java
- src/jebl/evolution/sequences/Nucleotides.java
- src/jebl/evolution/sequences/State.java
Changes:
=====================================
src/jebl/evolution/sequences/NucleotideState.java
=====================================
@@ -16,12 +16,14 @@ package jebl.evolution.sequences;
*/
public final class NucleotideState extends State {
- NucleotideState(String name, String stateCode, int index) {
+ NucleotideState(String name, String stateCode, int index, byte bitCode) {
super(name, stateCode, index);
+ this.bitCode = bitCode;
}
- NucleotideState(String name, String stateCode, int index, NucleotideState[] ambiguities) {
+ NucleotideState(String name, String stateCode, int index, byte bitCode, NucleotideState[] ambiguities) {
super(name, stateCode, index, ambiguities);
+ this.bitCode = bitCode;
}
@Override
@@ -31,10 +33,17 @@ public final class NucleotideState extends State {
return super.compareTo(that);
}
+ @Override
+ public boolean possiblyEqual(State other) {
+ return (bitCode & ((NucleotideState)other).bitCode) > 0;
+ }
+
public boolean isGap() {
return this == Nucleotides.GAP_STATE;
}
public SequenceType getType() { return SequenceType.NUCLEOTIDE; }
+ // a set of bits representing nucleotide states 0b0001 = A, 0b0010 = C, etc
+ public final byte bitCode;
}
=====================================
src/jebl/evolution/sequences/Nucleotides.java
=====================================
@@ -28,30 +28,40 @@ public final class Nucleotides {
public static final int CANONICAL_STATE_COUNT = 4;
public static final int STATE_COUNT = 17;
- public static final NucleotideState A_STATE = new NucleotideState("Adenine", "A", 0);
- public static final NucleotideState C_STATE = new NucleotideState("Cytosine", "C", 1);
- public static final NucleotideState G_STATE = new NucleotideState("Guanine", "G", 2);
- public static final NucleotideState T_STATE = new NucleotideState("Thymine", "T", 3);
-
- // The following line has been removed since it's never used and if it
- // was used would cause all sorts of bugs with various analysis code.
- // T_STATE represents either a U or a T depending on the context.
- //public static final NucleotideState U_STATE = new NucleotideState("U", "U", 3);
-
- public static final NucleotideState R_STATE = new NucleotideState("A/G", "R", 4, new NucleotideState[] {A_STATE, G_STATE});
- public static final NucleotideState Y_STATE = new NucleotideState("C/T", "Y", 5, new NucleotideState[] {C_STATE, T_STATE});
- public static final NucleotideState M_STATE = new NucleotideState("A/C", "M", 6, new NucleotideState[] {A_STATE, C_STATE});
- public static final NucleotideState W_STATE = new NucleotideState("A/T", "W", 7, new NucleotideState[] {A_STATE, T_STATE});
- public static final NucleotideState S_STATE = new NucleotideState("C/G", "S", 8, new NucleotideState[] {C_STATE, G_STATE});
- public static final NucleotideState K_STATE = new NucleotideState("G/T", "K", 9, new NucleotideState[] {G_STATE, T_STATE});
- public static final NucleotideState B_STATE = new NucleotideState("C/G/T", "B", 10, new NucleotideState[] {C_STATE, G_STATE, T_STATE});
- public static final NucleotideState D_STATE = new NucleotideState("A/G/T", "D", 11, new NucleotideState[] {A_STATE, G_STATE, T_STATE});
- public static final NucleotideState H_STATE = new NucleotideState("A/C/T", "H", 12, new NucleotideState[] {A_STATE, C_STATE, T_STATE});
- public static final NucleotideState V_STATE = new NucleotideState("A/C/G", "V", 13, new NucleotideState[] {A_STATE, C_STATE, G_STATE});
- public static final NucleotideState N_STATE = new NucleotideState("Unknown base", "N", 14, new NucleotideState[] {A_STATE, C_STATE, G_STATE, T_STATE});
-
- public static final NucleotideState UNKNOWN_STATE = new NucleotideState("Unknown base", "?", 15, new NucleotideState[] {A_STATE, C_STATE, G_STATE, T_STATE});
- public static final NucleotideState GAP_STATE = new NucleotideState("Gap", "-", 16, new NucleotideState[] {A_STATE, C_STATE, G_STATE, T_STATE});
+ public static final NucleotideState A_STATE = new NucleotideState("Adenine", "A", 0, (byte)0b0001);
+ public static final NucleotideState C_STATE = new NucleotideState("Cytosine", "C",1, (byte)0b0010);
+ public static final NucleotideState G_STATE = new NucleotideState("Guanine", "G", 2, (byte)0b0100);
+ public static final NucleotideState T_STATE = new NucleotideState("Thymine", "T", 3, (byte)0b1000);
+
+ // A: 0b0001 1
+ // C: 0b0010 2
+ // G: 0b0100 4
+ // T: 0b1000 8
+ // R: (byte)0b0101 5
+ // Y: (byte)0b1010 10
+ // M: (byte)0b0011 3
+ // W: (byte)0b1001 9
+ // S: (byte)0b0110 6
+ // K: (byte)0b1100 12
+ // B: (byte)0b1110 14
+ // D: (byte)0b1101 13
+ // H: (byte)0b1011 11
+ // V: (byte)0b0111 7
+
+ public static final NucleotideState R_STATE = new NucleotideState("A/G", "R", 4, (byte)0b0101, new NucleotideState[] {A_STATE, G_STATE});
+ public static final NucleotideState Y_STATE = new NucleotideState("C/T", "Y", 5, (byte)0b1010, new NucleotideState[] {C_STATE, T_STATE});
+ public static final NucleotideState M_STATE = new NucleotideState("A/C", "M", 6, (byte)0b0011, new NucleotideState[] {A_STATE, C_STATE});
+ public static final NucleotideState W_STATE = new NucleotideState("A/T", "W", 7, (byte)0b1001, new NucleotideState[] {A_STATE, T_STATE});
+ public static final NucleotideState S_STATE = new NucleotideState("C/G", "S", 8, (byte)0b0110, new NucleotideState[] {C_STATE, G_STATE});
+ public static final NucleotideState K_STATE = new NucleotideState("G/T", "K", 9, (byte)0b1100, new NucleotideState[] {G_STATE, T_STATE});
+ public static final NucleotideState B_STATE = new NucleotideState("C/G/T", "B", 10, (byte)0b1110, new NucleotideState[] {C_STATE, G_STATE, T_STATE});
+ public static final NucleotideState D_STATE = new NucleotideState("A/G/T", "D", 11, (byte)0b1101, new NucleotideState[] {A_STATE, G_STATE, T_STATE});
+ public static final NucleotideState H_STATE = new NucleotideState("A/C/T", "H", 12, (byte)0b1011, new NucleotideState[] {A_STATE, C_STATE, T_STATE});
+ public static final NucleotideState V_STATE = new NucleotideState("A/C/G", "V", 13, (byte)0b0111, new NucleotideState[] {A_STATE, C_STATE, G_STATE});
+ public static final NucleotideState N_STATE = new NucleotideState("Unknown base", "N", 14, (byte)0b1111, new NucleotideState[] {A_STATE, C_STATE, G_STATE, T_STATE});
+
+ public static final NucleotideState UNKNOWN_STATE = new NucleotideState("Unknown base", "?", 15, (byte)0b1111, new NucleotideState[] {A_STATE, C_STATE, G_STATE, T_STATE});
+ public static final NucleotideState GAP_STATE = new NucleotideState("Gap", "-", 16, (byte)0b1111, new NucleotideState[] {A_STATE, C_STATE, G_STATE, T_STATE});
// Making an array public allows a client to modify its contents. Deprecating on 2007-10-10
// and will become private in the future. Use {@link #getCanonicalStates} instead.
=====================================
src/jebl/evolution/sequences/State.java
=====================================
@@ -68,7 +68,7 @@ public abstract class State implements Comparable {
}
/**
- * @param other another state to check for the quality with.
+ * @param other another state to check for the equality with.
* @return true if the other state is or possibly is equal to this state, taking ambiguities into account,
* i.e. if the ambiguity sets of this and the other state intersect.
*/
@@ -99,7 +99,7 @@ public abstract class State implements Comparable {
/**
* Determine how much in common these potentially ambigous states have as a fraction between 0 and 1
* 2 non-ambiguous states will return 0.
- * 2 identical non-ambigoues states will 1.
+ * 2 identical non-ambiguous states will return 1.
* e.g. for Nucleotides
* R,A = 0.5
* R,G = 0.5
View it on GitLab: https://salsa.debian.org/med-team/jebl2/-/commit/b57cdf8e8222385ec3a1388d943603efcc5b13cb
--
View it on GitLab: https://salsa.debian.org/med-team/jebl2/-/commit/b57cdf8e8222385ec3a1388d943603efcc5b13cb
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20201012/e092ccc0/attachment-0001.html>
More information about the debian-med-commit
mailing list