private String printPDBConnections ( ) { StringBuilder str = new StringBuilder ( ) ; for ( Chain c : structure . getChains ( ) ) { for ( Group g : c . getAtomGroups ( ) ) { for ( Atom a : g . getAtoms ( ) ) { if ( a . getBonds ( ) != null ) { for ( Bond b : a . getBonds ( ) ) { //7890123456789012345678901234567890123456789012345678901234567890 str . append ( String . format ( "CONECT%5d%5d " + newline , b . getAtomA ( ) . getPDBserial ( ) , b . getAtomB ( ) . getPDBserial ( ) ) ) ; } } } } } return str . toString ( ) ; }
Prints the connections in PDB style