/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
import jalview.gui.AlignFrame;
import jalview.util.MessageManager;
import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.ArgumentI;
import jalview.ws.params.WsParamSetI;
import jalview.ws.uimodel.AlignAnalysisUIText;
import compbio.data.sequence.RNAStructScoreManager;
import compbio.data.sequence.Range;
import compbio.data.sequence.Score;
-import compbio.metadata.Argument;
/**
* Client for the JABA RNA Alifold Service
boolean bpScores;
public RNAalifoldClient(Jws2Instance sh, AlignFrame alignFrame,
- WsParamSetI preset, List<Argument> paramset)
+ WsParamSetI preset, List<ArgumentI> paramset)
{
super(sh, alignFrame, preset, paramset);
af = alignFrame;
- methodName = sh.serviceType;
+ methodName = sh.getName();
alignedSeqs = true;
submitGaps = true;
nucleotidesAllowed = true;
if (immediate || !calcMan.isWorking(this) && scoremanager != null)
{
- List<AlignmentAnnotation> ourAnnot = new ArrayList<AlignmentAnnotation>();
+ List<AlignmentAnnotation> ourAnnot = new ArrayList<>();
// Unpack the ScoreManager
List<String> structs = ((RNAStructScoreManager) scoremanager)
descriptionData = data;
}
- String[] typenameAndDescription = constructTypenameAndDescription(descriptionData
- .first());
+ String[] typenameAndDescription = constructTypenameAndDescription(
+ descriptionData.first());
String typename = typenameAndDescription[0];
String description = typenameAndDescription[1];
}
private AlignmentAnnotation constructAnnotationFromScoreHolder(
- AlignmentAnnotation annotation, String struct, TreeSet<Score> data)
+ AlignmentAnnotation annotation, String struct,
+ TreeSet<Score> data)
{
Annotation[] anns = new Annotation[gapMap != null ? gapMap.length + 1
: struct.length()];
- if (data != null
- && data.size() > 1
- && data.first().getMethod()
- .equals(AlifoldResult.contactProbabilities.toString()))
+ 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>();
+ LinkedHashMap<Range, Float> basePairs = new LinkedHashMap<>();
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)));
+ basePairs.put(score.getRanges().first(),
+ Float.valueOf(score.getScores().get(0)));
}
for (int i = 0, ri = 0, iEnd = struct.length(); i < iEnd; i++, ri++)
description = MessageFormat.format(
"Minimum Free Energy Structure. Energy: {0} = {1} + {2}",
- score.getScores().get(0), score.getScores().get(1), score
- .getScores().get(2));
+ score.getScores().get(0), score.getScores().get(1),
+ score.getScores().get(2));
typename = "MFE Structure";
}
- else if (datatype.equals(AlifoldResult.contactProbabilityStructure
- .toString()))
+ else if (datatype
+ .equals(AlifoldResult.contactProbabilityStructure.toString()))
{
- description = MessageFormat
- .format("Base Pair Contact Probabilities. "
- + "Energy of Ensemble: {0} Frequency of Ensemble: {1}",
- score.getScores().get(0), score.getScores().get(1));
+ description = MessageFormat.format("Base Pair Contact Probabilities. "
+ + "Energy of Ensemble: {0} Frequency of Ensemble: {1}",
+ score.getScores().get(0), score.getScores().get(1));
typename = "Contact Probabilities";
}
else if (datatype.equals(AlifoldResult.centroidStructure.toString()))
{
description = MessageFormat.format(
- "Centroid Structure. Energy: {0} = {1} + {2}", score
- .getScores().get(0), score.getScores().get(1), score
- .getScores().get(2));
+ "Centroid Structure. Energy: {0} = {1} + {2}",
+ score.getScores().get(0), score.getScores().get(1),
+ score.getScores().get(2));
typename = "Centroid Structure";
}
else if (datatype.equals(AlifoldResult.stochBTStructure.toString()))
else if (datatype.equals(AlifoldResult.MEAStucture.toString()))
{
description = MessageFormat.format(
- "Maximum Expected Accuracy Values: '{' {0} MEA={1} '}", score
- .getScores().get(0), score.getScores().get(1));
+ "Maximum Expected Accuracy Values: '{' {0} MEA={1} '}",
+ score.getScores().get(0), score.getScores().get(1));
typename = "MEA Structure";
}
else if (datatype.equals(AlifoldResult.consensusAlignment.toString()))
private LinkedHashMap<Range, Float> isContact(
LinkedHashMap<Range, Float> basePairs, int i)
{
- LinkedHashMap<Range, Float> contacts = new LinkedHashMap<Range, Float>();
+ LinkedHashMap<Range, Float> contacts = new LinkedHashMap<>();
for (Range contact : basePairs.keySet())
{