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.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}
label.add_database = Add Database
label.this_alignment = This alignment
warn.file_not_exists = File does not exist
warn.invalid_format = This is not a valid database file format. The current supported formats are Fasta, Stockholm and Pfam.
-label.database_for_hmmsearch = The database hmmsearch will search through.
\ No newline at end of file
+label.database_for_hmmsearch = The database hmmsearch will search through
+label.use_reference = Use Reference Annotation
+label.use_reference_desc = If true, hmmbuild will keep all columns defined as a reference position by the reference annotation
+label.hmm_name = HMM Name
+label.hmm_name_desc = The name given to the HMM.
+warn.no_reference_annotation = No reference annotation found
\ No newline at end of file
}
- Sequence seq = new Sequence(getName() + "_HMM", sequence, start,
+ Sequence seq = new Sequence(getName(), sequence, start,
end);
return seq;
}
information.hasText = true;
information.autoCalculated = false;
information.groupRef = this;
- information.label = getName() + "_HMM";
+ information.label = getName();
information.description = "Information content, measured in bits";
information.calcId = "HMM";
}
}
WsParamSetI set = new HMMERPreset();
List<ArgumentI> args = new ArrayList<>();
- ParamDatastoreI store = new HMMERParamStore("hmmalign");
+ ParamDatastoreI store = new HMMERParamStore("hmmbuild");
WsJobParameters params = new WsJobParameters(new JFrame(), store, set,
args);
if (params.showRunDialog())
{
this.selectedHMMSequence = selectedHMM;
hmmAlign.setText(MessageManager.getString("label.hmmalign") + " to "
- + selectedHMM.getHMM().getName() + "_HMM");
+ + selectedHMM.getHMM().getName());
hmmSearch.setText(MessageManager.getString("label.hmmsearch") + " with "
- + selectedHMM.getHMM().getName() + "_HMM");
+ + selectedHMM.getHMM().getName());
}
@Override
{
final String label = aa[selectedRow].label;
if (!(aa[selectedRow].autoCalculated)
- && !(label.indexOf("_HMM") > -1))
+ && !("HMM".equals(aa[selectedRow].getCalcId())))
{
if (aa[selectedRow].graph == AlignmentAnnotation.NO_GRAPH)
{
consclipbrd.addActionListener(this);
pop.add(consclipbrd);
}
- else if (label.indexOf("_HMM") > -1) // TODO create labels
+ else if ("HMM".equals(aa[selectedRow].getCalcId())) // TODO create labels
// in message resource
// for these
{
boolean ran = runCommand();
if (!ran)
{
- if (af != null)
- {
- JvOptionPane.showInternalMessageDialog(af,
- MessageManager.getString("warn.hmmbuild_failed"));
- }
return;
}
} catch (IOException | InterruptedException e)
{
if (!file.canExecute())
{
+ if (af != null)
+ {
+ JvOptionPane.showInternalMessageDialog(af,
+ MessageManager.getString("warn.hmmbuild_failed"));
+ }
return false;
}
}
}
- String command = cmds.HMMERFOLDER + cmds.HMMBUILD + cmds.NAME;
- if (forGroup)
+ String command = cmds.HMMERFOLDER + cmds.HMMBUILD + cmds.SPACE;
+ String name = null;
+
+ if (params != null)
{
- command += group.getName();
+ for (ArgumentI arg : params)
+ {
+ String argName = arg.getName();
+ switch (argName)
+ {
+ case "HMM Name":
+ name = arg.getValue();
+ break;
+ case "Use Reference Annotation":
+ command += "--hand ";
+ if (!af.getViewport().hasReferenceAnnotation())
+ {
+ JvOptionPane.showInternalMessageDialog(af, MessageManager
+ .getString("warn.no_reference_annotation"));
+ return false;
+ }
+ break;
+
+ }
+
+ }
}
- else
+
+ if (name == null || name == "" || name == " ")
{
- String name = null;
- if (af != null)
+ if (forGroup)
{
- // name = af.getTitle();
- name = "replace";
+ name = group.getName();
}
- if (name == null || name == "" || name == " " || name == " ")
+ else
{
- name = "Alignment";
+ if (af != null)
+ {
+ name = af.getTitle();
+ }
+ if (name == null || name == "" || name == " " || name == " ")
+ {
+ name = "Alignment";
+ }
}
- command += name;
}
- command += cmds.SPACE;
+
+ command += "-n " + name + cmds.SPACE;
if (!alignment.isNucleotide())
{
command += cmds.FORCEAMINO; // TODO check for rna
public String OUTPUTALIGNMENT;
- public final String NAME = "-n ";
-
public final String SPACE = " ";
public final String ALLCOL = "--allcol ";
import jalview.util.MessageManager;
import jalview.ws.params.ArgumentI;
import jalview.ws.params.ParamDatastoreI;
+import jalview.ws.params.ValueConstrainI;
import jalview.ws.params.WsParamSetI;
import jalview.ws.params.simple.BooleanOption;
import jalview.ws.params.simple.IntegerParameter;
import jalview.ws.params.simple.LogarithmicParameter;
import jalview.ws.params.simple.Option;
+import jalview.ws.params.simple.StringParameter;
import java.io.IOException;
import java.util.ArrayList;
}
if ("hmmbuild".equals(name))
{
-
+ getHMMBuildParams(args);
}
return args;
*/
}
+
private void getHMMAlignParams(List<ArgumentI> args)
{
args.add(new BooleanOption(
false, false, true, null));
}
+ private void getHMMBuildParams(List<ArgumentI> args)
+ {
+ args.add(new StringParameter(MessageManager.getString("label.hmm_name"),
+ MessageManager.getString("label.hmm_name_desc"), true, ""));
+ args.add(new BooleanOption(
+ MessageManager.getString("label.use_reference"),
+ MessageManager.getString("label.use_reference_desc"), true,
+ true, true, null));
+ }
+
+ private class StringValueConstrain implements ValueConstrainI
+ {
+
+ @Override
+ public ValueType getType()
+ {
+ return ValueType.String;
+ }
+
+ @Override
+ public Number getMax()
+ {
+ return null;
+ }
+
+ @Override
+ public Number getMin()
+ {
+ return null;
+ }
+
+ }
+
@Override
public boolean presetExists(String name)
{
// properties/rendering attributes as a global 'alignment group' which holds
// all vis settings for the alignment as a whole rather than a subset
//
- if (aa.label.contains("_HMM"))
+ if ("HMM".equals(aa.getCalcId()))
{
HiddenMarkovModel hmm = aa.sequenceRef.getHMM();
return AAFrequency.extractHMMProfile(hmm, column,
renderProfile = av_renderProfile;
normaliseProfile = av_normaliseProfile;
}
- else if (row.label.contains("_HMM"))
+ else if ("HMM".equals(row.getCalcId()))
{
renderHistogram = av_renderInformationHistogram;
renderProfile = av_renderHMMProfile;
+ ((ignoreGapsInConsensusCalculation) ? " without gaps" : ""));
return sq;
}
+
+ public boolean hasReferenceAnnotation()
+ {
+ AlignmentAnnotation[] annots = this.alignment.getAlignmentAnnotation();
+ for (AlignmentAnnotation annot : annots)
+ {
+ if ("RF".equals(annot.getCalcId()))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
}