warn.no_sequence_data = No sequence data found.
label.hmmer = HMMER
label.trim_termini = Trim Non-Matching Termini
+label.trim_termini_desc = If true, non-matching regions on either end of the resulting alignment are removed.
label.no_of_sequences = Sequences Returned
label.freq_alignment = Use Alignment Background Frequencies
label.freq_uniprot = Use Uniprot Background Frequencies
warn.align_failed = hmmalign was not found.
label.invalid_folder = Invalid Folder
label.folder_not_exists = HMMER binaries not found. \n Please enter the path to the HMMER binaries (if installed).
-label.hmmer_installed = HMMER installed
\ No newline at end of file
+label.hmmer_installed = HMMER installed
+label.hmmer_no_sequences_found = No sequences found.
+label.number_of_results = Number of Results to Return
+label.auto_align_seqs = Automatically Align Fetched Sequences
+label.use_accessions = Return Accessions
+label.seq_e_value = Sequence E-value Cutoff
+label.seq_score = Sequence Score Threshold
+label.dom_e_value = Domain E-value Cutoff
+label.dom_score = Domain Score Threshold
+label.number_of_results_desc = The maximum number of results that hmmsearch will return.
+label.auto_align_seqs_desc = If true, all fetched sequences will be aligned to the hidden Markov model with which the search was performed.
+label.use_accessions_desc = If true, the accession number of each sequence is returned, rather than that sequences name.
+label.seq_e_value_desc = The E-value cutoff for returned sequences.
+label.seq_score_desc = The score threshold for returned sequences.
+label.dom_e_value_desc = The E-value cutoff for returned domains.
+label.dom_score_desc = The score threshold for returned domains.
+label.not_enough_sequences = There are not enough sequences to run {0}
\ No newline at end of file
import jalview.gui.ViewSelectionMenu.ViewSetProvider;
import jalview.hmmer.HMMAlignThread;
import jalview.hmmer.HMMBuildThread;
+import jalview.hmmer.HMMERParamStore;
+import jalview.hmmer.HMMERPreset;
+import jalview.hmmer.HMMSearchThread;
import jalview.io.AlignmentProperties;
import jalview.io.AnnotationFile;
import jalview.io.BioJsHTMLOutput;
import jalview.ws.jws1.Discoverer;
import jalview.ws.jws2.Jws2Discoverer;
import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.ArgumentI;
+import jalview.ws.params.ParamDatastoreI;
+import jalview.ws.params.WsParamSetI;
import jalview.ws.seqfetcher.DbSourceProxy;
import java.awt.BorderLayout;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JEditorPane;
+import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLayeredPane;
import javax.swing.JMenu;
}
@Override
- public void hmmBuild_actionPerformed(ActionEvent e)
+ public void hmmBuildSettings_actionPerformed(ActionEvent e)
throws IOException, InterruptedException
{
- new Thread(new HMMBuildThread(this)).start();
+ if (!(alignmentIsSufficient(1)))
+ {
+ return;
+ }
+ WsParamSetI set = new HMMERPreset();
+ List<ArgumentI> args = new ArrayList<>();
+ ParamDatastoreI store = new HMMERParamStore("hmmalign");
+ WsJobParameters params = new WsJobParameters(new JFrame(), store, set,
+ args);
+ params.showRunDialog();
+ new Thread(new HMMBuildThread(this, params.getJobParams())).start();
alignPanel.repaint();
}
@Override
- public void hmmAlign_actionPerformed(ActionEvent e)
+ public void hmmAlignSettings_actionPerformed(ActionEvent e)
throws IOException, InterruptedException
{
- new Thread(new HMMAlignThread(this, true)).start();
+ if (!(checkForHMM() && alignmentIsSufficient(2)))
+ {
+ return;
+ }
+ WsParamSetI set = new HMMERPreset();
+ List<ArgumentI> args = new ArrayList<>();
+ ParamDatastoreI store = new HMMERParamStore("hmmalign");
+ WsJobParameters params = new WsJobParameters(new JFrame(), store, set,
+ args);
+ params.showRunDialog();
+ new Thread(new HMMAlignThread(this, true, params.getJobParams()))
+ .start();
alignPanel.repaint();
}
@Override
- public void changeHMMERLocation_actionPerformed(ActionEvent e)
+ public void hmmSearchSettings_actionPerformed(ActionEvent e)
{
- String location = JOptionPane.showInputDialog(
- MessageManager.getString("label.enter_location"));
- Cache.setProperty(Preferences.HMMER_PATH, location);
+ if (!checkForHMM())
+ {
+ return;
+ }
+ WsParamSetI set = new HMMERPreset();
+ List<ArgumentI> args = new ArrayList<>();
+ ParamDatastoreI store = new HMMERParamStore("hmmsearch");
+ WsJobParameters params = new WsJobParameters(new JFrame(), store, set,
+ args);
+ params.showRunDialog();
+ new Thread(new HMMSearchThread(this, true, params.getJobParams()))
+ .start();
+ alignPanel.repaint();
+ }
+
+ @Override
+ public void hmmBuildRun_actionPerformed(ActionEvent e)
+ throws IOException, InterruptedException
+ {
+ if (!alignmentIsSufficient(1))
+ {
+ return;
+ }
+ new Thread(new HMMBuildThread(this, null)).start();
+ alignPanel.repaint();
+
+ }
+
+ @Override
+ public void hmmAlignRun_actionPerformed(ActionEvent e)
+ throws IOException, InterruptedException
+ {
+ if (!(checkForHMM() && alignmentIsSufficient(2)))
+ {
+ return;
+ }
+ new Thread(new HMMAlignThread(this, true, null))
+ .start();
+ alignPanel.repaint();
}
@Override
- public void hmmSearch_actionPerformed(ActionEvent e)
+ public void hmmSearchRun_actionPerformed(ActionEvent e)
{
+ if (!checkForHMM())
+ {
+ return;
+ }
+ new Thread(new HMMSearchThread(this, true, null))
+ .start();
alignPanel.repaint();
}
+ /**
+ * Checks if the frame has a selected hidden Markov model
+ *
+ * @return
+ */
+ private boolean checkForHMM()
+ {
+ if (getSelectedHMM() == null)
+ {
+ JOptionPane.showMessageDialog(this,
+ MessageManager.getString("warn.no_selected_hmm"));
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Checks if the alignment contains the required number of sequences.
+ *
+ * @param required
+ * @return
+ */
+ public boolean alignmentIsSufficient(int required)
+ {
+ if (getViewport().getAlignment().getSequences().size() < required)
+ {
+ JOptionPane.showMessageDialog(this,
+ MessageManager.getString("warn.not_enough_sequences"));
+ return false;
+ }
+ return true;
+ }
+
@Override
public void reload_actionPerformed(ActionEvent e)
{
public String formatDouble(Double value)
{
String string = "";
- if (value < 0.0000001)
+ if (value < 0.0001)
{
string = String.format("%3.3e", value);
}
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
-import net.miginfocom.swing.MigLayout;
-
import compbio.metadata.Argument;
import compbio.metadata.Option;
import compbio.metadata.Parameter;
import compbio.metadata.Preset;
import compbio.metadata.PresetManager;
import compbio.metadata.RunnerConfig;
+import net.miginfocom.swing.MigLayout;
/**
* job parameter editing/browsing dialog box. User can browse existing settings
this(service, null);
}
+ public WsJobParameters(JFrame parent, ParamDatastoreI store,
+ WsParamSetI preset,
+ List<ArgumentI> args)
+ {
+ super();
+ jbInit();
+ this.paramStore = store;
+ this.service = null;
+ // argSetModified(false);
+ // populate parameter table
+ init(preset, args);
+ // display in new JFrame attached to parent.
+ validate();
+ }
+
public WsJobParameters(Jws2Instance service, WsParamSetI preset)
{
this(null, service, preset, null);
{
frame = new JDialog(Desktop.instance, true);
+ if (service != null)
+ {
+ frame.setTitle(MessageManager.formatMessage("label.edit_params_for",
+ new String[]
+ { service.getActionText() }));
+ }
- frame.setTitle(MessageManager.formatMessage("label.edit_params_for",
- new String[]
- { service.getActionText() }));
Rectangle deskr = Desktop.instance.getBounds();
Dimension pref = this.getPreferredSize();
frame.setBounds(
// null;
}
+ init(p, jobArgset);
+
+ }
+
+ void init(WsParamSetI p, List<ArgumentI> jobArgset)
+ {
Hashtable exnames = new Hashtable();
for (int i = 0, iSize = setName.getItemCount(); i < iSize; i++)
{
}
}
settingDialog = false;
-
}
@SuppressWarnings("unchecked")
int p = 0;
if (args.length > 0)
{
- Vector<String> services = new Vector<String>();
+ Vector<String> services = new Vector<>();
services.addElement(args[p++]);
Jws2Discoverer.getDiscoverer().setServiceUrls(services);
}
import jalview.io.StockholmFile;
import jalview.util.MessageManager;
import jalview.viewmodel.seqfeatures.FeatureRendererSettings;
+import jalview.ws.params.ArgumentI;
import java.io.File;
import java.io.IOException;
import java.util.Map;
import javax.swing.JInternalFrame;
-import javax.swing.JOptionPane;
public class HMMAlignThread implements Runnable
{
HiddenMarkovModel hmm;
+ List<ArgumentI> args;
+
boolean newFrame;
long barID;
* @param af
* @param createNewFrame
*/
- public HMMAlignThread(AlignFrame af, boolean createNewFrame)
+ public HMMAlignThread(AlignFrame af, boolean createNewFrame,
+ List<ArgumentI> args)
{
this.af = af;
alignment = af.getViewport().getAlignment();
}
newFrame = createNewFrame;
featureSettings = af.getFeatureRenderer().getSettings();
+ this.args = args;
}
/**
@Override
public void run()
{
- if (af.getSelectedHMM() == null)
- {
- JOptionPane.showMessageDialog(af,
- MessageManager.getString("warn.no_selected_hmm"));
- return;
- }
- else
- {
- hmm = af.getSelectedHMM();
- }
+
+ hmm = af.getSelectedHMM();
+
barID = System.currentTimeMillis();
af.setProgressBar(MessageManager.getString("status.running_hmmalign"),
barID);
cmds.HMMERFOLDER = Cache.getProperty(Preferences.HMMER_PATH);
-
- // if (!alignment.isAligned())
- // {
- // alignment.padGaps();
- // }
- prepareAlignment();
- SequenceI[][] subAlignments = msa.getVisibleContigs('-');
- allOrders = new ArrayList<>();
- allResults = new SequenceI[subAlignments.length][];
- int job = 0;
- for (SequenceI[] seqs : subAlignments)
- {
- cmds.uniquifySequences(seqs);
- try
- {
- createTemporaryFiles();
- } catch (IOException e2)
+ prepareAlignment();
+ SequenceI[][] subAlignments = msa.getVisibleContigs('-');
+ allOrders = new ArrayList<>();
+ allResults = new SequenceI[subAlignments.length][];
+ int job = 0;
+ for (SequenceI[] seqs : subAlignments)
{
- e2.printStackTrace();
- }
- try
- {
- cmds.exportData(seqs, outTemp.getAbsoluteFile(), hmm,
- hmmTemp.getAbsoluteFile());
- } catch (IOException e1)
- {
- e1.printStackTrace();
- }
- try
- {
- boolean ran = runCommand();
- if (!ran)
+ cmds.uniquifySequences(seqs);
+ try
+ {
+ createTemporaryFiles();
+ } catch (IOException e2)
{
- JvOptionPane.showInternalMessageDialog(af,
- MessageManager.getString("warn.hmmalign_failed"));
- return;
+ e2.printStackTrace();
}
- } catch (IOException | InterruptedException e)
- {
- e.printStackTrace();
- }
- try
- {
- importData(job);
- } catch (IOException | InterruptedException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ try
+ {
+ cmds.exportData(seqs, outTemp.getAbsoluteFile(), hmm,
+ hmmTemp.getAbsoluteFile());
+ } catch (IOException e1)
+ {
+ e1.printStackTrace();
+ }
+ try
+ {
+ boolean ran = runCommand();
+ if (!ran)
+ {
+ JvOptionPane.showInternalMessageDialog(af,
+ MessageManager.getString("warn.hmmalign_failed"));
+ return;
+ }
+ } catch (IOException | InterruptedException e)
+ {
+ e.printStackTrace();
+ }
+ try
+ {
+ importData(job);
+ } catch (IOException | InterruptedException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ job++;
}
- job++;
- }
+
displayResults(newFrame);
*/
private void createTemporaryFiles() throws IOException
{
- hmmTemp = File.createTempFile("hmm", ".hmm");
- hmmTemp.deleteOnExit();
- outTemp = File.createTempFile("output", ".sto");
- outTemp.deleteOnExit();
+ if (hmmTemp == null)
+ {
+ hmmTemp = File.createTempFile("hmm", ".hmm");
+ hmmTemp.deleteOnExit();
+ }
+ if (outTemp == null)
+ {
+ outTemp = File.createTempFile("output", ".sto");
+ outTemp.deleteOnExit();
+ }
inputTemp = File.createTempFile("input", ".sto");
inputTemp.deleteOnExit();
}
{
command += cmds.ALLCOL;
}
- boolean trim = true;
- String bool = Cache.getProperty("TRIM_TERMINI");
- if ("false".equals(bool))
+ if (args != null)
{
- trim = false;
- }
- if (trim)
- {
- command += cmds.TRIM;
+ for (ArgumentI arg : args)
+ {
+ String name = arg.getName();
+ switch (name)
+ {
+ case "Trim Non-Matching Termini":
+ command += "--trim";
+ }
+ }
}
command += " -o " + inputTemp.getAbsolutePath() + cmds.SPACE
+ hmmTemp.getAbsolutePath() + cmds.SPACE
/**
* Imports the data from the temporary file to which the output of hmmalign is
- * directed.
+ * directed. this is used for an internal job.
*
* @param index
* The index of the 'job' (or region of an alignment).
import jalview.io.FileParse;
import jalview.io.HMMFile;
import jalview.util.MessageManager;
+import jalview.ws.params.ArgumentI;
import java.io.File;
import java.io.FileNotFoundException;
AlignmentI alignment;
SequenceGroup group;
+ List<ArgumentI> params;
+
boolean forGroup = false;
forGroup = false;
}
- public HMMBuildThread(AlignFrame af)
+ public HMMBuildThread(AlignFrame af, List<ArgumentI> args)
{
this.af = af;
if (af.getViewport().getSelectionGroup() != null)
}
viewport = af.getViewport();
alignment = viewport.getAlignment();
+ params = args;
}
String name = null;
if (af != null)
{
- name = af.getTitle();
+ // name = af.getTitle();
+ name = "replace";
}
if (name == null || name == "" || name == " " || name == " ")
{
--- /dev/null
+package jalview.hmmer;
+
+
+import jalview.util.MessageManager;
+import jalview.ws.params.ArgumentI;
+import jalview.ws.params.ParamDatastoreI;
+import jalview.ws.params.WsParamSetI;
+import jalview.ws.params.simple.BooleanOption;
+import jalview.ws.params.simple.IntegerParameter;
+import jalview.ws.params.simple.LogarithmicParameter;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class HMMERParamStore implements ParamDatastoreI
+{
+
+ String name;
+
+ List<WsParamSetI> presets = new ArrayList<>();
+
+ public HMMERParamStore(String name)
+ {
+ this.name = name;
+ }
+
+ @Override
+ public List<WsParamSetI> getPresets()
+ {
+ // TODO Auto-generated method stub
+ return presets;
+ }
+
+ @Override
+ public WsParamSetI getPreset(String name)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public List<ArgumentI> getServiceParameters()
+ {
+ List<ArgumentI> args = new ArrayList<>();
+ if ("hmmsearch".equals(name))
+ {
+ args.add(new IntegerParameter(
+ MessageManager.getString("label.number_of_results"),
+ MessageManager
+ .getString("label.number_of_results_desc"),
+ true, 100, 0, 100000));
+ args.add(new BooleanOption(
+ MessageManager.getString("label.auto_align_seqs"),
+ MessageManager.getString("label.auto_align_seqs_desc"),
+ false, false, true, null));
+ args.add(new BooleanOption(
+ MessageManager.getString("label.use_accessions"),
+ MessageManager.getString("label.use_accessions_desc"),
+ false, false, true, null));
+ args.add(new BooleanOption(
+ MessageManager.getString("label.trim_termini"),
+ MessageManager.getString("label.trim_termini_desc"), false,
+ false, true, null));
+ args.add(new LogarithmicParameter(
+ MessageManager.getString("label.seq_e_value"),
+ MessageManager.getString("label.seq_e_value_desc"), false,
+ 0.001d, -63d, 9d, 4d));
+ /*
+ args.add(new DoubleParameter(
+ MessageManager.getString("label.seq_score"),
+ MessageManager.getString("label.seq_score_desc"), false,
+ 0d, 0d, 10000d));
+ */
+ args.add(new LogarithmicParameter(
+ MessageManager.getString("label.dom_e_value_desc"),
+ MessageManager.getString("label.dom_e_value_desc"), false,
+ 0.001d, -63d, 9d, 4d));
+ /*
+ args.add(new DoubleParameter(
+ MessageManager.getString("label.dom_score"),
+ MessageManager.getString("label.dom_score_desc"), false, 0d,
+ 0d,
+ 10000d));
+ */
+ }
+ if ("hmmalign".equals(name))
+ {
+ args.add(new BooleanOption(
+ MessageManager.getString("label.trim_termini"),
+ MessageManager.getString(
+ "label.trim_termini = Trim Non-Matching Termini_desc"),
+ false, false, true, null));
+
+ }
+ if ("hmmbuild".equals(name))
+ {
+ args.add(new BooleanOption(
+ MessageManager.getString("label.trim_termini"),
+ MessageManager.getString(
+ "label.trim_termini = Trim Non-Matching Termini_desc"),
+ false, false, true, null));
+
+ }
+ return args;
+ }
+
+ @Override
+ public boolean presetExists(String name)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void deletePreset(String name)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void storePreset(String presetName, String text,
+ List<ArgumentI> jobParams)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void updatePreset(String oldName, String presetName, String text,
+ List<ArgumentI> jobParams)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public WsParamSetI parseServiceParameterFile(String name,
+ String description, String[] serviceURL, String parameters)
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String generateServiceParameterFile(WsParamSetI pset)
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
--- /dev/null
+package jalview.hmmer;
+
+import jalview.ws.params.ArgumentI;
+import jalview.ws.params.WsParamSetI;
+
+import java.util.List;
+
+public class HMMERPreset implements WsParamSetI
+{
+
+ @Override
+ public String getName()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getDescription()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String[] getApplicableUrls()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getSourceFile()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setSourceFile(String newfile)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean isModifiable()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public List<ArgumentI> getArguments()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setArguments(List<ArgumentI> args)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
import jalview.util.MessageManager;
import jalview.viewmodel.seqfeatures.FeatureRendererSettings;
import jalview.ws.params.ArgumentI;
+import jalview.ws.params.simple.BooleanOption;
import java.io.File;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
HiddenMarkovModel hmm;
- boolean newFrame;
+ boolean newFrame, realign = false, trim = false;
+
+ Integer numberOfSequences = null;
long barID;
File databaseFile = null;
+
+
SequenceI[] seqs;
}
}
}
+
String command = cmds.HMMERFOLDER + "/hmmsearch -o "
+ inputTableTemp.getAbsolutePath() + " -A "
- + inputAlignmentTemp.getAbsolutePath() + cmds.SPACE
- + hmmTemp.getAbsolutePath() + cmds.SPACE
+ + inputAlignmentTemp.getAbsolutePath() + cmds.SPACE;
+ if (params != null)
+ {
+ for (ArgumentI arg : params)
+ {
+ String name = arg.getName();
+ switch (name)
+ {
+ case "Number of Results to Return":
+ numberOfSequences = Integer.parseInt(arg.getValue());
+ break;
+ case "Automatically Align Fetched Sequences":
+ if ("Automatically Align Fetched Sequences"
+ .equals(arg.getValue()))
+ {
+ realign = true;
+ }
+ break;
+ case "Return Accessions":
+ if ("Return Accessions".equals(arg.getValue()))
+ {
+ command += "--acc ";
+ }
+ break;
+ case "Sequence E-value Cutoff":
+ command += "--incE " + arg.getValue() + cmds.SPACE;
+ break;
+ case "Sequence Score Threshold":
+ command += "-incT " + arg.getValue() + cmds.SPACE;
+ break;
+ case "Domain E-value Threshold":
+ command += "--incdomE " + arg.getValue() + cmds.SPACE;
+ break;
+ case "Domain Score Threshold":
+ command += "--incdomT " + arg.getValue() + cmds.SPACE;
+ break;
+ case "Trim Non-Matching Termini":
+ trim = true;
+
+ }
+
+
+ }
+ }
+
+ command += hmmTemp.getAbsolutePath() + cmds.SPACE
+ databaseFile.getAbsolutePath();
return cmds.runCommand(command);
}
readTable();
- SequenceI[] hmmAndSeqs = new SequenceI[seqs.length + 1];
+ SequenceI[] hmmAndSeqs;
+ if (numberOfSequences != null && numberOfSequences < seqs.length)
+ {
+ hmmAndSeqs = new SequenceI[numberOfSequences + 1];
+ }
+ else
+ {
+ hmmAndSeqs = new SequenceI[seqs.length + 1];
+ }
+
AlignmentAnnotation[] list = hmmSeq.getAnnotation();
for (AlignmentAnnotation annot : list)
{
- if ("HMM annotation".equals(annot.getCalcId()))
+ if ("HMM".equals(annot.getCalcId()))
{
hmmSeq.removeAlignmentAnnotation(annot);
}
}
hmmSeq.setHasInfo(false);
hmmAndSeqs[0] = hmmSeq;
- System.arraycopy(seqs, 0, hmmAndSeqs, 1, seqs.length);
+
+ if (numberOfSequences != null && seqs.length > numberOfSequences)
+ {
+ System.arraycopy(seqs, 0, hmmAndSeqs, 1, numberOfSequences);
+ }
+ else
+ {
+ System.arraycopy(seqs, 0, hmmAndSeqs, 1, seqs.length);
+ }
+
AlignmentI alignment = new Alignment(hmmAndSeqs);
AlignFrame frame = new AlignFrame(alignment, 1, 1);
frame.setSelectedHMMSequence(hmmSeq);
frame.getViewport().initInformation();
- HMMAlignThread hmmalign = new HMMAlignThread(frame, true);
+ List<ArgumentI> alignArgs = new ArrayList<>();
+ if (trim)
+ {
+ alignArgs.add(new BooleanOption(
+ MessageManager.getString("label.trim_termini"),
+ MessageManager.getString("label.trim_termini_desc"), true,
+ true, true, null));
+ }
+ HMMAlignThread hmmalign = new HMMAlignThread(frame, true, alignArgs);
hmmalign.hmmalignWaitTillComplete();
frame = null;
hmmTemp.delete();
protected JMenu hmmerMenu = new JMenu();
- protected JMenuItem hmmAlign = new JMenuItem();
+ protected JMenu hmmAlign = new JMenu();
- protected JMenuItem hmmSearch = new JMenuItem();
+ protected JMenuItem hmmAlignRun = new JMenuItem();
- protected JMenuItem hmmBuild = new JCheckBoxMenuItem();
+ protected JMenuItem hmmAlignSettings = new JMenuItem();
+
+ protected JMenu hmmSearch = new JMenu();
+
+ protected JMenuItem hmmSearchRun = new JMenuItem();
+
+ protected JMenuItem hmmSearchSettings = new JMenuItem();
+
+ protected JMenu hmmBuild = new JMenu();
+
+ protected JMenuItem hmmBuildRun = new JMenuItem();
+
+ protected JMenuItem hmmBuildSettings = new JMenuItem();
protected JMenuItem webServiceNoServices;
selectHighlightedColumns_actionPerformed(actionEvent);
}
};
- hmmBuild.setText(MessageManager.getString("label.hmmbuild"));
- hmmBuild.addActionListener(new ActionListener()
+ hmmBuildRun.setText(MessageManager.formatMessage(
+ "label.action_with_default_settings", "hmmbuild"));
+ hmmBuildRun.addActionListener(new ActionListener()
{
-
+
@Override
public void actionPerformed(ActionEvent e)
{
try
{
- hmmBuild_actionPerformed(e);
- } catch (IOException e1)
+ hmmBuildRun_actionPerformed(e);
+ } catch (IOException | InterruptedException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
- } catch (InterruptedException e1)
+ }
+ }
+
+ });
+ hmmBuildSettings.setText(
+ MessageManager.getString("label.edit_settings_and_run"));
+ hmmBuildSettings.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ try
+ {
+ hmmBuildSettings_actionPerformed(e);
+ } catch (IOException | InterruptedException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
-
+
});
- hmmAlign.setText(MessageManager.getString("label.hmmalign"));
- hmmAlign.addActionListener(new ActionListener()
+ hmmAlignRun.setText(MessageManager.formatMessage(
+ "label.action_with_default_settings", "hmmalign"));
+ hmmAlignRun.addActionListener(new ActionListener()
{
-
+
@Override
public void actionPerformed(ActionEvent e)
{
try
{
- hmmAlign_actionPerformed(e);
- } catch (IOException e1)
+ hmmAlignRun_actionPerformed(e);
+ } catch (IOException | InterruptedException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
- } catch (InterruptedException e1)
+ }
+ }
+
+ });
+ hmmAlignSettings.setText(
+ MessageManager.getString("label.edit_settings_and_run"));
+ hmmAlignSettings.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ try
+ {
+ hmmAlignSettings_actionPerformed(e);
+ } catch (IOException | InterruptedException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
-
+
+ });
+ hmmSearchRun.setText(MessageManager.formatMessage(
+ "label.action_with_default_settings", "hmmsearch"));
+ hmmSearchRun.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hmmSearchRun_actionPerformed(e);
+ }
+
+ });
+ hmmSearchSettings.setText(
+ MessageManager.getString("label.edit_settings_and_run"));
+ hmmSearchSettings.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hmmSearchSettings_actionPerformed(e);
+ }
+
});
selectHighlighted.addActionListener(al);
JMenu tooltipSettingsMenu = new JMenu(
*/
protected void initHMMERMenu()
{
- hmmAlign = new JMenuItem(MessageManager.getString("label.hmmalign"));
- hmmBuild = new JMenuItem(MessageManager.getString("label.hmmbuild"));
- hmmSearch = new JMenuItem(MessageManager.getString("label.hmmsearch"));
+ hmmAlign = new JMenu(MessageManager.getString("label.hmmalign"));
+ hmmAlignSettings = new JMenuItem(
+ MessageManager.getString("label.edit_settings_and_run"));
+ hmmAlignRun = new JMenuItem(MessageManager.formatMessage(
+ "label.action_with_default_settings", "hmmalign"));
+ hmmAlign.add(hmmAlignSettings);
+ hmmAlign.add(hmmAlignRun);
+ hmmBuild = new JMenu(MessageManager.getString("label.hmmbuild"));
+ hmmBuildSettings = new JMenuItem(
+ MessageManager.getString("label.edit_settings_and_run"));
+ hmmBuildRun = new JMenuItem(MessageManager.formatMessage(
+ "label.action_with_default_settings", "hmmbuild"));
+ hmmBuild.add(hmmBuildSettings);
+ hmmBuild.add(hmmBuildRun);
+ hmmSearch = new JMenu(MessageManager.getString("label.hmmsearch"));
+ hmmSearchSettings = new JMenuItem(
+ MessageManager.getString("label.edit_settings_and_run"));
+ hmmSearchRun = new JMenuItem(MessageManager.formatMessage(
+ "label.action_with_default_settings", "hmmsearch"));
+ hmmSearch.add(hmmSearchSettings);
+ hmmSearch.add(hmmSearchRun);
}
/**
{
}
- protected void autoAlignSeqs_actionPerformed(boolean selected)
+ protected void hmmBuildRun_actionPerformed(ActionEvent e)
+ throws IOException, InterruptedException
{
}
- protected void hmmAlign_actionPerformed(ActionEvent e)
- throws IOException, InterruptedException
+ protected void hmmSearchRun_actionPerformed(ActionEvent e)
{
}
- protected void changeHMMERLocation_actionPerformed(ActionEvent e)
+ protected void hmmAlignRun_actionPerformed(ActionEvent e)
+ throws IOException, InterruptedException
{
}
- protected void hmmBuild_actionPerformed(ActionEvent e)
+ protected void hmmBuildSettings_actionPerformed(ActionEvent e)
throws IOException, InterruptedException
{
}
- protected void hmmSearch_actionPerformed(ActionEvent e)
+ protected void hmmSearchSettings_actionPerformed(ActionEvent e)
+ {
+ }
+
+ protected void hmmAlignSettings_actionPerformed(ActionEvent e)
+ throws IOException, InterruptedException
{
}
information.hasText = true;
information.autoCalculated = false;
information.sequenceRef = seq;
- information.setCalcId("HMM annotation");
+ information.setCalcId("HMM");
this.information.add(information);
hinformation.add(new Profiles(new ProfileI[1]));
alignment.addAnnotation(information);
--- /dev/null
+package jalview.ws.params.simple;
+
+import jalview.ws.params.ParameterI;
+import jalview.ws.params.ValueConstrainI;
+
+/**
+ *
+ * @author TZVanaalten
+ *
+ */
+public class DoubleParameter extends Option implements ParameterI
+{
+ Double defval;
+
+ Double min, max;
+
+ @Override
+ public ValueConstrainI getValidValue()
+ {
+ return new ValueConstrainI()
+ {
+
+ @Override
+ public ValueType getType()
+ {
+ return ValueType.Double;
+ }
+
+ @Override
+ public Number getMin()
+ {
+ if (min < max)
+ {
+ return min;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ @Override
+ public Number getMax()
+ {
+ if (min < max)
+ {
+ return max;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ };
+ }
+
+ public DoubleParameter(DoubleParameter parm)
+ {
+ super(parm);
+ max = parm.max;
+ min = parm.min;
+ }
+
+ public DoubleParameter(String name, String description, boolean required,
+ Double defValue, Double min, Double max)
+ {
+ super(name, description, required, String.valueOf(defValue), null, null,
+ null);
+ defval = defValue;
+ this.min = min;
+ this.max = max;
+ }
+
+ public DoubleParameter(String name, String description, boolean required,
+ Double defValue, Double value, Double min, Double max)
+ {
+ super(name, description, required, String.valueOf(defValue),
+ String.valueOf(value), null, null);
+ defval = defValue;
+ this.min = min;
+ this.max = max;
+ }
+
+ @Override
+ public DoubleParameter copy()
+ {
+ return new DoubleParameter(this);
+ }
+}
import jalview.io.DataSourceType;
import jalview.io.FastaFile;
import jalview.io.FileParse;
+import jalview.ws.params.ArgumentI;
import java.io.IOException;
import java.net.MalformedURLException;
+import java.util.ArrayList;
import java.util.List;
import org.testng.annotations.AfterClass;
AlignmentI al = new Alignment(seqs);
frame = new AlignFrame(al, 150, 20);
- HMMBuildThread thread = new HMMBuildThread(frame);
+ HMMBuildThread thread = new HMMBuildThread(frame,
+ new ArrayList<ArgumentI>());
thread.hmmbuildWaitTillComplete();
SequenceI seq = frame.getViewport().getAlignment().getSequenceAt(0);
@Test(priority = 1)
public void testHMMAlign() throws MalformedURLException, IOException
{
- HMMAlignThread thread = new HMMAlignThread(frame, true);
+ HMMAlignThread thread = new HMMAlignThread(frame, true,
+ new ArrayList<ArgumentI>());
try
{
thread.hmmalignWaitTillComplete();