import jalview.io.DataSourceType;
import jalview.io.FileParse;
import jalview.io.HMMFile;
+import jalview.util.FileUtils;
import jalview.util.MessageManager;
import jalview.ws.params.ArgumentI;
File alignmentFile = null;
try
{
- hmmFile = createTempFile("hmm", ".hmm");
- alignmentFile = createTempFile("output", ".sto");
+ hmmFile = FileUtils.createTempFile("hmm", ".hmm");
+ alignmentFile = FileUtils.createTempFile("output", ".sto");
if (ac instanceof Alignment)
{
private void importData(File hmmFile, AnnotatedCollectionI ac)
throws IOException
{
+ if (hmmFile.length() == 0L)
+ {
+ Cache.log.error("Error: hmmbuild produced empty hmm file");
+ return;
+ }
+
HMMFile file = new HMMFile(
new FileParse(hmmFile.getAbsolutePath(), DataSourceType.FILE));
SequenceI hmmSeq = file.getHMM().getConsensusSequence();
+ if (hmmSeq == null)
+ {
+ // hmmbuild failure not detected earlier
+ return;
+ }
+
if (ac instanceof SequenceGroup)
{
SequenceGroup grp = (SequenceGroup) ac;