private static String buildJmolSelection ( ResidueNumber [ ] residues ) { StringBuilder cmd = new StringBuilder ( "select " ) ; for ( ResidueNumber res : residues ) { if ( res != null ) { cmd . append ( String . format ( "%d^%s:%s.CA or " , res . getSeqNum ( ) , res . getInsCode ( ) == null ? " " : res . getInsCode ( ) , res . getChainName ( ) ) ) ; } } cmd . append ( "none;" ) ; //easier than removing the railing 'or' return cmd . toString ( ) ; }
Converts an array of ResidueNumbers into a jMol selection .