import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AnnotatedCollectionI;
+import jalview.datamodel.Annotation;
import jalview.datamodel.HiddenMarkovModel;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
{
if (annot.label.contains("Reference") || "RF".equals(annot.label))
{
- newAl.addAnnotation(annot);
+ AlignmentAnnotation newRF;
+ if (annot.annotations.length > newAl.getWidth())
+ {
+ Annotation[] rfAnnots = new Annotation[newAl.getWidth()];
+ System.arraycopy(annot.annotations, 0, rfAnnots, 0,
+ rfAnnots.length);
+ newRF = new AlignmentAnnotation("RF", "Reference Positions",
+ rfAnnots);
+ }
+ else
+ {
+ newRF = new AlignmentAnnotation(annot);
+ }
+ newAl.addAnnotation(newRF);
}
}
}
+
StockholmFile file = new StockholmFile(newAl);
String output = file.print(seqs, false);
PrintWriter writer = new PrintWriter(stoLocation);
@Override
public void parse() throws IOException
{
- hmm = new HiddenMarkovModel();
- parseFileProperties(dataIn);
- parseModel(dataIn);
+ try
+ {
+ hmm = new HiddenMarkovModel();
+ parseFileProperties(dataIn);
+ parseModel(dataIn);
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ }
}
/**