X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentAnnotation.java;h=4ebb27f5ee914cbc5e1d2928fb88707bbc0ae96e;hb=bea1d9b563d2fea018de3dbde9112dd59149126e;hp=0f418508abdd229bde007483606a24e5b448a996;hpb=0ae965fc73680bdc69b06986c060ff17342c4787;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 0f41850..4ebb27f 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -95,6 +95,10 @@ public class AlignmentAnnotation */ private long invalidrnastruc = -2; + private double bitScore; + + private double eValue; + /** * Updates the _rnasecstr field Determines the positions that base pair and * the positions of helices based on secondary structure from a Stockholm file @@ -596,7 +600,7 @@ public class AlignmentAnnotation } return null; } - + /** * Creates a new AlignmentAnnotation object. * @@ -708,7 +712,7 @@ public class AlignmentAnnotation } } } - + /** * Copy constructor creates a new independent annotation row with the same * associated sequenceRef @@ -718,6 +722,17 @@ public class AlignmentAnnotation public AlignmentAnnotation(AlignmentAnnotation annotation) { setAnnotationId(); + updateAlignmentAnnotationFrom(annotation); + } + + /** + * copy attributes and annotation from an existing annotation (used by copy + * constructor). This method does not update the unique annotationId + * + * @param annotation + */ + public void updateAlignmentAnnotationFrom(AlignmentAnnotation annotation) + { this.label = new String(annotation.label); if (annotation.description != null) { @@ -741,6 +756,9 @@ public class AlignmentAnnotation this.scaleColLabel = annotation.scaleColLabel; this.showAllColLabels = annotation.showAllColLabels; this.calcId = annotation.calcId; + this.bitScore = annotation.bitScore; + this.eValue = annotation.eValue; + if (annotation.properties != null) { properties = new HashMap<>(); @@ -972,6 +990,7 @@ public class AlignmentAnnotation * @param seqRef * @param startRes * @param alreadyMapped + * - annotation are at aligned columns */ public void createSequenceMapping(SequenceI seqRef, int startRes, boolean alreadyMapped) @@ -1173,7 +1192,7 @@ public class AlignmentAnnotation { return hasScore || !Double.isNaN(score); } - + /** * Score only annotation * @@ -1204,6 +1223,7 @@ public class AlignmentAnnotation makeVisibleAnnotation(hidden); } + public void setPadGaps(boolean padgaps, char gapchar) { this.padGaps = padgaps; @@ -1663,7 +1683,6 @@ public class AlignmentAnnotation Iterable list, SequenceI seq, String calcId, String label) { - ArrayList aa = new ArrayList<>(); for (AlignmentAnnotation ann : list) { @@ -1708,7 +1727,6 @@ public class AlignmentAnnotation public static Iterable findAnnotation( List list, String calcId) { - List aa = new ArrayList<>(); if (calcId == null) { @@ -1726,4 +1744,42 @@ public class AlignmentAnnotation return aa; } + public double getBitScore() + { + return bitScore; + } + + public void setBitScore(double bitScore) + { + this.bitScore = bitScore; + } + + public double getEValue() + { + return eValue; + } + + public void setEValue(double eValue) + { + this.eValue = eValue; + } + + public static AlignmentAnnotation findFirstAnnotation( + Iterable alignmentAnnotation, String name, + String calcId, boolean autoCalc, SequenceI seqRef, + SequenceGroup groupRef) + { + + for (AlignmentAnnotation annot : alignmentAnnotation) + { + if (annot.autoCalculated == autoCalc && (name.equals(annot.label)) + && (calcId == null || annot.getCalcId().equals(calcId)) + && annot.sequenceRef == seqRef && annot.groupRef == groupRef) + { + return annot; + } + } + return null; + } + }