X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fjws2%2FRNAalifoldClient.java;h=9ca6d2efcda7a900e502b6bfe6c159d89d56327d;hb=37de9310bec3501cbc6381e0c3dcb282fcaad812;hp=5d0df8a86875f9b271cbb9789d9ed4f09787b16b;hpb=7ab5d6b0ba5fec1ea4a4239e79c476d841622485;p=jalview.git diff --git a/src/jalview/ws/jws2/RNAalifoldClient.java b/src/jalview/ws/jws2/RNAalifoldClient.java index 5d0df8a..9ca6d2e 100644 --- a/src/jalview/ws/jws2/RNAalifoldClient.java +++ b/src/jalview/ws/jws2/RNAalifoldClient.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 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. * @@ -20,11 +20,10 @@ */ package jalview.ws.jws2; -import jalview.api.AlignCalcWorkerI; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Annotation; import jalview.gui.AlignFrame; -import jalview.ws.jws2.dm.AAConSettings; +import jalview.util.MessageManager; import jalview.ws.jws2.jabaws2.Jws2Instance; import jalview.ws.params.WsParamSetI; import jalview.ws.uimodel.AlignAnalysisUIText; @@ -36,6 +35,7 @@ import java.util.List; import java.util.TreeSet; import java.util.regex.Pattern; +import compbio.data.sequence.FastaSequence; import compbio.data.sequence.RNAStructReader.AlifoldResult; import compbio.data.sequence.RNAStructScoreManager; import compbio.data.sequence.Range; @@ -49,8 +49,7 @@ import compbio.metadata.Argument; * */ -public class RNAalifoldClient extends JabawsAlignCalcWorker implements - AlignCalcWorkerI +public class RNAalifoldClient extends JabawsCalcWorker { String methodName; @@ -65,10 +64,6 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements WsParamSetI preset, List paramset) { super(sh, alignFrame, preset, paramset); - - // if (arguments == null) - // arguments = new ArrayList(); - af = alignFrame; methodName = sh.serviceType; alignedSeqs = true; @@ -78,6 +73,7 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements initViewportParams(); } + @Override public String getCalcId() { return CALC_ID; @@ -89,16 +85,11 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements { return new AlignAnalysisUIText( compbio.ws.client.Services.RNAalifoldWS.toString(), - jalview.ws.jws2.RNAalifoldClient.class, - CALC_ID, - true, - false, - true, - "RNAAliFold Prediction", - "When checked, RNA secondary structure predictions will be calculated for the alignment, and updated when edits are made.", - "Change RNAAliFold settings...", - "Modify settings for the RNAAliFold prediction. Use this to hide or show different results of the RNA calculation, and change RNA folding parameters"); - + jalview.ws.jws2.RNAalifoldClient.class, CALC_ID, true, false, + true, MessageManager.getString("label.rnalifold_calculations"), + MessageManager.getString("tooltip.rnalifold_calculations"), + MessageManager.getString("label.rnalifold_settings"), + MessageManager.getString("tooltip.rnalifold_settings")); } @Override @@ -109,6 +100,12 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements } @Override + boolean checkValidInputSeqs(boolean dynamic, List seqs) + { + return (seqs.size() > 1); + } + + @Override public void updateResultAnnotation(boolean immediate) { @@ -182,11 +179,15 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements * same data object as was overwritten with the contact probabilites data. */ if (data == null) + { data = compbio.data.sequence.RNAStructReader .newEmptyScore(AlifoldResult.consensusAlignment); + } if (descriptionData == null) + { descriptionData = data; + } String[] typenameAndDescription = constructTypenameAndDescription(descriptionData .first()); @@ -266,7 +267,9 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements { float t = contacts.get(contact); if (t > prob) + { prob = t; + } description += Integer.toString(contact.from) + "->" + Integer.toString(contact.to) + ": " + Float.toString(t) + "% | "; @@ -346,7 +349,9 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements score.getScores().get(0), score.getScores().get(1)); } else + { description = "Stochastic Backtrack Structure"; + } } else if (datatype.equals(AlifoldResult.MEAStucture.toString())) { @@ -366,8 +371,7 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements description = typename; } - return new String[] - { typename, description }; + return new String[] { typename, description }; } // Check whether, at position i there is a base contact and return all the @@ -383,7 +387,9 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements // ordering of the Scores TreeSet in ScoreManager which is, descending // probability if (contact.from == i || contact.to == i) + { contacts.put(contact, basePairs.get(contact)); + } } return contacts;