1 package compbio.data.sequence;
5 import javax.xml.bind.annotation.XmlAccessType;
6 import javax.xml.bind.annotation.XmlAccessorType;
8 import compbio.util.annotation.Immutable;
11 * RNA secondary structure
14 @XmlAccessorType(XmlAccessType.FIELD)
15 public final class RNAstruct {
17 private String sequence;
18 private String structure; // needs to be array to deal with all output
19 private Float minEnergy;
20 private Float energySum1; private Float energySum2;
24 // default JaxB Constructor
27 public RNAstruct(String sequence, String structure, Float minEnergy
28 , Float energySum1, Float energySum2) {
29 this.sequence = sequence;
30 this.structure = structure;
31 this.minEnergy = minEnergy;
32 this.energySum1 = energySum1;
33 this.energySum2 = energySum2;
36 public String getSequence() {
40 public String getStructure() {
44 public Float getEnergy() {
50 public String toString() {
51 String newLine = System.getProperty("line.separator",".");
52 return sequence + newLine + structure + " (" + minEnergy.toString()
53 + " = " + energySum1.toString() + " + " + energySum2.toString()
58 public boolean equals(Object obj) {
62 if (!(obj instanceof RNAstruct)) {
65 RNAstruct st = (RNAstruct) obj;
66 if (!(this.getSequence() == st.getSequence() &&
67 this.getStructure() == st.getStructure() &&
68 this.getEnergy() == st.getEnergy())) {