public static < S extends Sequence < C > , C extends Compound > String getGCGHeader ( List < S > sequences ) { StringBuilder header = new StringBuilder ( ) ; S s1 = sequences . get ( 0 ) ; header . append ( String . format ( "MSA from BioJava%n%n MSF: %d Type: %s Check: %d ..%n%n" , s1 . getLength ( ) , getGCGType ( s1 . getCompoundSet ( ) ) , getGCGChecksum ( sequences ) ) ) ; String format = " Name: " + getIDFormat ( sequences ) + " Len: " + s1 . getLength ( ) + " Check: %4d Weight: 1.0%n" ; for ( S as : sequences ) { header . append ( String . format ( format , as . getAccession ( ) , getGCGChecksum ( as ) ) ) ; // TODO show weights in MSF header } header . append ( String . format ( "%n//%n%n" ) ) ; // TODO? convert gap characters to '.' return header . toString ( ) ; }
Assembles a GCG file header