From 966e2e639242c252f4ed9e5f0e3e91b0389bd2de Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 7 Dec 2005 16:37:26 +0000 Subject: [PATCH] Submissions for secondary structure prediction are now filtered to remove empty sequences and user is informed if no non-empty sequences exist. --- src/jalview/gui/AlignFrame.java | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 8c31ed0..81e5564 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -2208,7 +2208,16 @@ public class AlignFrame { SequenceI seq = null; SequenceI[] msa = null; +/* + if (predictindex==-1) { + JOptionPane.showInternalMessageDialog(Desktop.desktop, + "The alignment contains no columns or residues usable for prediction!", + "Invalid Alignment Selection", JOptionPane.WARNING_MESSAGE); + this. + return; + } +*/ if ( (viewport.getSelectionGroup() != null) && (viewport.getSelectionGroup().getSize() > 0)) { @@ -2439,7 +2448,18 @@ public class AlignFrame { public void actionPerformed(ActionEvent e) { - SequenceI[] msa = gatherSeqOrMsaForSecStrPrediction(); + SequenceI[] msa = SeqsetUtils.getNonEmptySequenceSet(gatherSeqOrMsaForSecStrPrediction()); + if (msa==null) { + JOptionPane.showInternalMessageDialog(Desktop.desktop, + "There are no columns or residues usable for prediction!\n" + +"There must be valid residues in at least one\n" + +"of the sequences in the alignment,\n" + +"or in the currently selected region.", + "Invalid Input for Secondary Structure Prediction", + JOptionPane.WARNING_MESSAGE); + return; + } + if (msa.length == 1) { // Single Sequence prediction @@ -2449,7 +2469,7 @@ public class AlignFrame { if (msa.length > 1) { - // Single Sequence prediction + // Aligned Sequences prediction jalview.ws.JPredClient ct = new jalview.ws.JPredClient(sh, title, msa); } -- 1.7.10.2