}
}
nameScanner.close();
- args.add(new Option(MessageManager.getString(HMMSearch.DATABASE_KEY),
+ args.add(new StringParameter(
+ MessageManager.getString(HMMSearch.DATABASE_KEY),
MessageManager.getString("label.database_for_hmmsearch"),
true, MessageManager.getString(HMMSearch.THIS_ALIGNMENT_KEY),
MessageManager.getString(HMMSearch.THIS_ALIGNMENT_KEY),
- databases, null));
+ databases));
}
args.add(new BooleanOption(
MessageManager.getString(HMMSearch.AUTO_ALIGN_SEQS_KEY),
protected void addChoiceOfHmm(List<ArgumentI> args)
{
List<SequenceI> hmms = viewport.getAlignment().getHmmSequences();
- if (!hmms.isEmpty())
+ if (hmms.size() > 1)
{
List<String> options = new ArrayList<>();
for (SequenceI hmmSeq : hmms)
options.add(hmmSeq.getName());
}
String defseq = options.get(0);
- Option option = new Option(MessageManager.getString("label.use_hmm"),
- "", true, defseq, defseq, options, null);
- args.add(option);
+ ArgumentI arg = new StringParameter(
+ MessageManager.getString("label.use_hmm"), null, true, defseq,
+ defseq, options);
+ args.add(arg);
}
}
/*
* choice of whether to compute HMM for alignment and/or group(s)
+ * - only if there are any groups
*/
- Collection<String> options = new ArrayList<>();
- options.add(MessageManager.getString("label.alignment"));
- options.add(MessageManager.getString("label.groups_and_alignment"));
- options.add(MessageManager.getString("label.groups"));
- options.add(MessageManager.getString("label.selected_group"));
- args.add(new Option(MessageManager.getString("label.hmmbuild_for"),
- MessageManager.getString("label.hmmbuild_for_desc"), true,
- MessageManager.getString("label.alignment"),
- MessageManager.getString("label.alignment"), options, null));
+ if (!viewport.getAlignment().getGroups().isEmpty())
+ {
+ Collection<String> options = new ArrayList<>();
+ options.add(MessageManager.getString("label.alignment"));
+ options.add(MessageManager.getString("label.groups_and_alignment"));
+ options.add(MessageManager.getString("label.groups"));
+ options.add(MessageManager.getString("label.selected_group"));
+ args.add(new Option(MessageManager.getString("label.hmmbuild_for"),
+ MessageManager.getString("label.hmmbuild_for_desc"), true,
+ MessageManager.getString("label.alignment"),
+ MessageManager.getString("label.alignment"), options, null));
+ }
}
@Override