private String parseAlignedSequence(String aLine){
  String[] tokens=aLine.split("\\s+");
switch (tokens.length) {
case 3:
{
      final StringBuilder buf=new StringBuilder();
      int gaps=Integer.parseInt(tokens[0]);
      while (--gaps >= 0)       buf.append("-");
      buf.append(tokens[1]);
      gaps=Integer.parseInt(tokens[2]);
      while (--gaps >= 0)       buf.append("-");
      return buf.toString();
    }
case 2:
{
    final StringBuilder buf=new StringBuilder();
    int gaps=Integer.parseInt(tokens[0]);
    while (--gaps >= 0)     buf.append("-");
    buf.append(tokens[1]);
    return buf.toString();
  }
case 1:
return tokens[0];
default :
return aLine.replaceAll("\\s+","");
}
}

private String parseAlignedSequence ( String aLine ) { String [ ] tokens = aLine . split ( "\\s+" ) ; switch ( tokens . length ) { case 3 : { final StringBuilder buf = new StringBuilder ( ) ; int gaps = Integer . parseInt ( tokens [ 0 ] ) ; while ( -- gaps >= 0 ) buf . append ( "-" ) ; buf . append ( tokens [ 1 ] ) ; gaps = Integer . parseInt ( tokens [ 2 ] ) ; while ( -- gaps >= 0 ) buf . append ( "-" ) ; return buf . toString ( ) ; } case 2 : { final StringBuilder buf = new StringBuilder ( ) ; int gaps = Integer . parseInt ( tokens [ 0 ] ) ; while ( -- gaps >= 0 ) buf . append ( "-" ) ; buf . append ( tokens [ 1 ] ) ; return buf . toString ( ) ; } case 1 : return tokens [ 0 ] ; default : return aLine . replaceAll ( "\\s+" , "" ) ; } }
get the algined sequence in the line possible formats : xxxxx 5 xxxx ( 5 leading gaps ) 5 xxxx 3 ( 3 trailing gaps )
