{
private static final String ANNOTATION = "annotation";
+ private static final char UNDERSCORE = '_';
+
// private static final Regex OPEN_PAREN = new Regex("(<|\\[)", "(");
// private static final Regex CLOSE_PAREN = new Regex("(>|\\])", ")");
featureTypes.put("RF", "Reference Positions");
}
- AlignmentI al;
+ private AlignmentI al;
public StockholmFile()
{
}
/**
- * Creates a new StockholmFile object for output.
+ * Creates a new StockholmFile object for output
*/
public StockholmFile(AlignmentI al)
{
for (int i = 0; i < annots.length(); i++)
{
String pos = annots.substring(i, i + 1);
+ if (UNDERSCORE == pos.charAt(0))
+ {
+ pos = " ";
+ }
Annotation ann;
ann = new Annotation(pos, "", ' ', 0f); // 0f is 'valid' null - will not
// be written out
* @param ann
* @param sequenceI
*/
- private char getAnnotationCharacter(String key, int k, Annotation annot,
+ static char getAnnotationCharacter(String key, int k, Annotation annot,
SequenceI sequenceI)
{
char seq = ' ';
{
if (annot == null)
{
- // sensible gap character
- return ' ';
+ // Stockholm format requires underscore, not space
+ return UNDERSCORE;
}
else
{