return;
}
- currentAnnotation = av.getAlignment().getAlignmentAnnotation()[0];// annotations.getSelectedIndex()];
-
+ // This loop will find the first rna structure annotation by which to colour
+ // the sequences.
+ AlignmentAnnotation[] annotations = av.getAlignment().getAlignmentAnnotation();
+ for (int i = 0; i < annotations.length; i++) {
+
+ // is this a sensible way of determining type of annotation?
+ if (annotations[i].getRNAStruc() != null) {
+ currentAnnotation = annotations[i];
+ break;
+ }
+ }
+ if (currentAnnotation == null)
+ {
+ System.err.println("Jalview is about to try and colour by RNAHelices even"
+ + " though there are no RNA secondary structure annotations present!");
+ currentAnnotation = av.getAlignment().getAlignmentAnnotation()[0];// annotations.getSelectedIndex()];
+ }
+
RNAHelicesColour rhc = null;
rhc = new RNAHelicesColour(currentAnnotation);
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
import jalview.gui.AlignFrame;
+import jalview.ws.jws2.dm.AAConSettings;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.WsParamSetI;
import java.text.MessageFormat;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
import java.util.LinkedHashMap;
+import java.util.List;
import java.util.TreeSet;
import java.util.regex.Pattern;
nucleotidesAllowed = true;
proteinAllowed = false;
-
- }
+ initViewportParams();
+ }
+
+ protected void initViewportParams()
+ {
+ ((jalview.gui.AlignViewport) alignViewport).setCalcIdSettingsFor(
+ getCalcId(),
+ new AAConSettings(true, service, this.preset,
+ (arguments != null) ? JabaParamStore
+ .getJwsArgsfromJaba(arguments) : null), true);
+ }
@Override
public String getServiceActionText()
List<String> structs = ((RNAStructScoreManager) scoremanager).getStructs();
List<TreeSet<Score>> data = ((RNAStructScoreManager) scoremanager).getData();
- System.out.println("Length of RNAStructScoreManager is: " + structs.size());
-
// test to see if this data object contains base pair contacts
Score fscore = data.get(0).first();
this.bpScores = (fscore.getMethod().equals(
annotation.belowAlignment = false;
// annotation.showAllColLabels = true;
- annotation.validateRangeAndDisplay();
+ alignViewport.getAlignment().validateAnnotation(annotation);
+ af.setMenusForViewport();
ourAnnot.add(annotation);
}
String typename = "";
String datatype = score.getMethod();
+
+ // Look up java switch syntax and use one here
if (datatype.equals(AlifoldResult.mfeStructure.toString())) {
description = MessageFormat.format("Minimum Free Energy Structure. Energy: {0} = {1} + {2}",
}
private char isSS (char chr) {
- String regex = "\\(|\\)|\\{|\\}|\\[|\\]";
+ String regex = "\\(|\\)|\\{|\\}|\\[|\\]";
char ss = (Pattern.matches(regex, Character.toString(chr))) ? 'S': ' ';
return ss;
}