package jalview.hmmer;
import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
+import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.HiddenMarkovModel;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
* @throws IOException
*/
public void exportData(SequenceI[] seqs,
- File stoLocation, HiddenMarkovModel hmm, File hmmLocation)
+ File stoLocation, HiddenMarkovModel hmm, File hmmLocation,
+ AnnotatedCollectionI al)
throws IOException
{
if (seqs != null)
{
- StockholmFile file = new StockholmFile(new Alignment(seqs));
+ AlignmentI newAl = new Alignment(seqs);
+ if (stoLocation != null)
+ {
+ for (AlignmentAnnotation annot : al.getAlignmentAnnotation())
+ {
+ if (annot.label.contains("Reference") || "RF".equals(annot.label))
+ {
+ newAl.addAnnotation(annot);
+ }
+ }
+ }
+ StockholmFile file = new StockholmFile(newAl);
String output = file.print(seqs, false);
PrintWriter writer = new PrintWriter(stoLocation);
writer.println(output);