X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fjws2%2FRNAalifoldClient.java;h=126266bafdcbebdd7bc9b97fbca6e129f72130a6;hb=47168f025aefdaa044802bd5f8f510ffe43a4808;hp=d86f15a9209afaefa55a99c3793aba0df42458ce;hpb=e8e3d7d2501b65ddf4d9ca94c16a20fed1b66256;p=jalview.git diff --git a/src/jalview/ws/jws2/RNAalifoldClient.java b/src/jalview/ws/jws2/RNAalifoldClient.java index d86f15a..126266b 100644 --- a/src/jalview/ws/jws2/RNAalifoldClient.java +++ b/src/jalview/ws/jws2/RNAalifoldClient.java @@ -1,3 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) + * Copyright (C) 2014 The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.ws.jws2; import jalview.api.AlignCalcWorkerI; @@ -7,6 +27,7 @@ import jalview.gui.AlignFrame; import jalview.ws.jws2.dm.AAConSettings; import jalview.ws.jws2.jabaws2.Jws2Instance; import jalview.ws.params.WsParamSetI; +import jalview.ws.uimodel.AlignAnalysisUIText; import java.text.MessageFormat; import java.util.ArrayList; @@ -21,6 +42,12 @@ import compbio.data.sequence.Range; import compbio.data.sequence.Score; import compbio.metadata.Argument; +/** + * Client for the JABA RNA Alifold Service + * @author daluke - Daniel Barton + * + */ + public class RNAalifoldClient extends JabawsAlignCalcWorker implements AlignCalcWorkerI { @@ -38,24 +65,38 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements { super(sh, alignFrame, preset, paramset); - if (arguments == null) - arguments = new ArrayList(); + //if (arguments == null) + // arguments = new ArrayList(); af = alignFrame; methodName = sh.serviceType; - + alignedSeqs=true; + submitGaps=true; nucleotidesAllowed = true; proteinAllowed = false; initViewportParams(); } + + public String getCalcId() + { + return CALC_ID; + } + private static String CALC_ID="jalview.ws.jws2.RNAalifoldClient"; - protected void initViewportParams() + public static AlignAnalysisUIText getAlignAnalysisUITest() { - ((jalview.gui.AlignViewport) alignViewport).setCalcIdSettingsFor( - getCalcId(), - new AAConSettings(true, service, this.preset, - (arguments != null) ? JabaParamStore - .getJwsArgsfromJaba(arguments) : null), true); + 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"); + } @Override @@ -177,7 +218,7 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements private AlignmentAnnotation constructAnnotationFromScoreHolder( AlignmentAnnotation annotation, String struct, TreeSet data) { - Annotation[] anns = new Annotation[struct.length()]; + Annotation[] anns = new Annotation[gapMap!= null ? gapMap.length+1 : struct.length()]; if (data != null && data.size() > 1 @@ -195,9 +236,17 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements basePairs.put(score.getRanges().first(), new Float(score .getScores().get(0))); } - for (int i = 0; i < struct.length(); i++) + + for (int i = 0,ri=0,iEnd=struct.length();i contacts = isContact(basePairs, i + 1); @@ -221,16 +270,27 @@ public class RNAalifoldClient extends JabawsAlignCalcWorker implements } } - anns[i] = new Annotation(struct.substring(i, i + 1), description, + anns[ri] = 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++) + for (int i = 0,ri=0,iEnd=struct.length();i