X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FJPredThread.java;h=b4833b1b973e874b24341a1baf363aaa64f97d70;hb=bbc14e2d648fe667157c327043d9bbb238faf65e;hp=6aebfdce9c850887c6703157f93d6479b9c7b5ee;hpb=a5481d6e853a962af603f4a21b171ba6fc9c200d;p=jalview.git diff --git a/src/jalview/ws/JPredThread.java b/src/jalview/ws/JPredThread.java index 6aebfdc..b4833b1 100644 --- a/src/jalview/ws/JPredThread.java +++ b/src/jalview/ws/JPredThread.java @@ -6,14 +6,12 @@ import javax.swing.*; import vamsas.objects.simple.JpredResult; -import ext.vamsas.*; import jalview.analysis.*; import jalview.bin.*; import jalview.datamodel.*; import jalview.gui.*; import jalview.io.*; import jalview.util.*; -import jalview.ws.WSThread.*; class JPredThread extends WSThread @@ -53,7 +51,7 @@ implements WSClientI return false; } /** - * + * * @return null or Object[] { annotated alignment for this prediction, ColumnSelection for this prediction} or null if no results available. * @throws Exception */ @@ -95,14 +93,14 @@ implements WSClientI al = new Alignment(sqs); alcsel=(ColumnSelection) alandcolsel[1]; } else { - al = new Alignment(new FormatAdapter().readFile(result.getAligfile(), - "Paste", format)); + al = new FormatAdapter().readFile(result.getAligfile(), + "Paste", format); sqs = new SequenceI[al.getHeight()]; for (int i = 0, j = al.getHeight(); i < j; i++) { sqs[i] = al.getSequenceAt(i); - } + } if (!jalview.analysis.SeqsetUtils.deuniquify( (Hashtable) SequenceInfo, sqs)) { @@ -133,9 +131,16 @@ implements WSClientI SequenceI[] sqs = (SequenceI[]) ((java.lang.Object[]) input.getAlignmentAndColumnSelection(gc))[0]; if (this.msaIndex>=sqs.length) throw new Error("Implementation Error! Invalid msaIndex for JPredJob on parent MSA input object!"); - sqs[msaIndex].removeGaps(); + + ///// + //Uses RemoveGapsCommand + ///// + new jalview.commands.RemoveGapsCommand("Remove Gaps", + new SequenceI[] {sqs[msaIndex]}, + alignFrame.getCurrentView().getAlignment()); + SequenceI profileseq=al.getSequenceAt(FirstSeq); - profileseq.setSequence(sqs[msaIndex].getSequence()); + profileseq.setSequence(sqs[msaIndex].getSequenceAsString()); } if (!jalview.analysis.SeqsetUtils.SeqCharacterUnhash( @@ -174,7 +179,7 @@ implements WSClientI sb.append(gc); } for (int s=1,ns=al.getHeight(); s0) { // pad gaps @@ -218,7 +223,7 @@ implements WSClientI for (int s=0,ns=al.getHeight(); s0) { sq=sq+((diff>=sb.length()) ? sb.toString() : sb.substring(0, diff)); - diff=origseq.getLength()-sq.length(); + diff=origseq.getLength()-sq.length(); } } } @@ -261,7 +266,8 @@ implements WSClientI { super(); this.predMap = delMap; - String sq = AlignSeq.extractGaps(Comparison.GapChars, seq.getSequence()); + String sq = AlignSeq.extractGaps(Comparison.GapChars, + seq.getSequenceAsString()); if (sq.length() >= 20) { this.SequenceInfo = SequenceInfo; @@ -508,14 +514,14 @@ implements WSClientI if (((SequenceI[])alandcolsel[0])[0].getLength()!=res.getWidth()) { if (msa) { throw new Error("Implementation Error! ColumnSelection from input alignment will not map to result alignment!"); - } + } } if (!msa) { // update hidden regions to account for loss of gaps in profile. - if any // gapMap returns insert list, interpreted as delete list by pruneDeletions //((ColumnSelection) alandcolsel[1]).pruneDeletions(ShiftList.parseMap(((SequenceI[]) alandcolsel[0])[0].gapMap())); }*/ - + af = new AlignFrame((Alignment) res[0], (ColumnSelection) res[1],AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); } Desktop.addInternalFrame(af, altitle,