+
+ if (data != null && data.size() > 1 && data.first().getMethod().equals(
+ AlifoldResult.contactProbabilities.toString()))
+ {
+
+ // The base pair probabilities are stored in a set in scoreholder. we want a map
+ LinkedHashMap<Range, Float> basePairs = new LinkedHashMap<Range, Float>();
+ for (Score score : data) {
+ // The Score objects contain a set of size one containing the range and
+ // an ArrayList<float> of size one containing the probabilty
+ basePairs.put(score.getRanges().first(), new Float(score.getScores().get(0)));
+ }
+ for (int i = 0; i < struct.length(); i++) {
+
+ // Return all the contacts associated with position i
+ LinkedHashMap<Range, Float> contacts = isContact(basePairs, i+1);
+
+ String description = "";
+ float prob = 0f;
+
+ if (contacts.size() == 0) {
+ description = "No Data";
+ }
+ else {
+ for (Range contact : contacts.keySet()) {
+ float t = contacts.get(contact);
+ if (t > prob) prob = t;
+ description += Integer.toString(contact.from) + "->"
+ + Integer.toString(contact.to) + ": " + Float.toString(t) + "% | ";
+ }
+ }
+
+ anns[i] = new Annotation(struct.substring(i, i+1), description,
+ isSS(struct.charAt(i)), prob);
+ }
+ }
+ else if (data == null || data.size() == 1) {
+ for (int i = 0; i < struct.length(); i++) {
+
+ anns[i] = new Annotation(struct.substring(i, i+1), "",
+ isSS(struct.charAt(i)), Float.NaN);
+ }
+
+ annotation.graph = 0; // No graph