import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
-import jalview.datamodel.AlignmentView;
import jalview.datamodel.AnnotatedCollectionI;
+import jalview.datamodel.ResidueCount;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
else if (MessageManager.getString("label.groups_and_alignment")
.equals(value))
{
- AlignmentView av = viewport.getAlignmentView(true);
- runBuildFor.add(av.getVisibleAlignment('-'));
- runBuildFor.addAll(av.getVisibleGroups('-'));
+ runBuildFor.add(viewport.getAlignmentView(false)
+ .getVisibleAlignment('-'));
+ runBuildFor.addAll(viewport.getAlignment().getGroups());
}
else if (MessageManager.getString("label.groups").equals(value))
{
- AlignmentView av = viewport.getAlignmentView(false);
- runBuildFor.addAll(av.getVisibleGroups('-'));
+ runBuildFor.addAll(viewport.getAlignment().getGroups());
}
else if (MessageManager.getString("label.selected_group")
.equals(value))
{
- AlignmentView av = viewport.getAlignmentView(true);
- runBuildFor.add(av.getVisibleAlignment('-'));
+ runBuildFor.add(viewport.getSelectionGroup());
}
}
else if (MessageManager.getString("label.use_reference")
else
{
SequenceI[] sel = ((SequenceGroup) ac)
- .getSelectionAsNewSequences((AlignmentI) ac.getContext(),
- false);
+ .getSelectionAsNewSequences((AlignmentI) ac.getContext());
for (SequenceI seq : sel)
{
- copy.add(seq);
+ if (seq != null)
+ {
+ copy.add(seq);
+ }
}
}
+ // TODO rather than copy alignment data we should anonymize in situ -
+ // export/File import could use anonymization hash to reinstate references
+ // at import level ?
SequenceI[] copyArray = copy.toArray(new SequenceI[copy.size()]);
Hashtable sequencesHash = stashSequences(copyArray);
}
/**
- * A helper method that deletes any HMM consensus sequence from the given
- * collection, and from the parent alignment if <code>ac</code> is a subgroup
- *
- * @param ac
- */
- void deleteHmmSequences(AnnotatedCollectionI ac)
- {
- List<SequenceI> hmmSeqs = ac.getHmmSequences();
- for (SequenceI hmmSeq : hmmSeqs)
- {
- if (ac instanceof SequenceGroup)
- {
- ((SequenceGroup) ac).deleteSequence(hmmSeq, false);
- AnnotatedCollectionI context = ac.getContext();
- if (context != null && context instanceof AlignmentI)
- {
- ((AlignmentI) context).deleteSequence(hmmSeq);
- }
- }
- else
- {
- ((AlignmentI) ac).deleteSequence(hmmSeq);
- }
- }
- }
-
- /**
* Constructs and executes the hmmbuild command as a separate process
*
* @param sequencesFile
args.add(ARG_DNA);
}
- args.add(getFilePath(hmmFile));
- args.add(getFilePath(sequencesFile));
+ args.add(getFilePath(hmmFile, true));
+ args.add(getFilePath(sequencesFile, true));
return runCommand(args);
}
new FileParse(hmmFile.getAbsolutePath(), DataSourceType.FILE));
SequenceI hmmSeq = file.getHMM().getConsensusSequence();
+
+
+ ResidueCount counts = new ResidueCount(alignment.getSequences());
+ hmmSeq.getHMM().setBackgroundFrequencies(counts);
+
if (hmmSeq == null)
{
// hmmbuild failure not detected earlier