public static String getJmolString ( MultipleAlignment multAln , List < Atom [ ] > transformedAtoms , ColorBrewer colorPalette , boolean colorByBlocks ) { // Color by blocks if specified if ( colorByBlocks ) return getMultiBlockJmolString ( multAln , transformedAtoms , colorPalette , colorByBlocks ) ; Color [ ] colors = colorPalette . getColorPalette ( multAln . size ( ) ) ; StringBuffer j = new StringBuffer ( ) ; j . append ( DEFAULT_SCRIPT ) ; // Color the equivalent residues of every structure StringBuffer sel = new StringBuffer ( ) ; sel . append ( "select *; color lightgrey; backbone 0.1; " ) ; List < List < String > > allPDB = new ArrayList < List < String > > ( ) ; // Get the aligned residues of every structure for ( int i = 0 ; i < multAln . size ( ) ; i ++ ) { List < String > pdb = MultipleAlignmentJmolDisplay . getPDBresnum ( i , multAln , transformedAtoms . get ( i ) ) ; allPDB . add ( pdb ) ; sel . append ( "select " ) ; int pos = 0 ; for ( String res : pdb ) { if ( pos > 0 ) sel . append ( "," ) ; pos ++ ; sel . append ( res ) ; sel . append ( "/" + ( i + 1 ) ) ; } if ( pos == 0 ) sel . append ( "none" ) ; sel . append ( "; backbone 0.3 ; color [" + colors [ i ] . getRed ( ) + "," + colors [ i ] . getGreen ( ) + "," + colors [ i ] . getBlue ( ) + "]; " ) ; } j . append ( sel ) ; j . append ( "model 0; " ) ; j . append ( LIGAND_DISPLAY_SCRIPT ) ; return j . toString ( ) ; }
Generate a Jmol command String that colors the aligned residues of every structure .