public static void removeAcidicOxygen ( IAminoAcid acid ) throws CDKException { if ( acid . getCTerminus ( ) == null ) throw new CDKException ( "Cannot remove oxygen: C-terminus is not defined!" ) ; java . util . List < IBond > bonds = acid . getConnectedBondsList ( acid . getCTerminus ( ) ) ; // ok, look for the oxygen which is singly bonded for ( IBond bond : bonds ) { if ( bond . getOrder ( ) == Order . SINGLE ) { for ( int j = 0 ; j < bond . getAtomCount ( ) ; j ++ ) { if ( bond . getAtom ( j ) . getSymbol ( ) . equals ( "O" ) ) { // yes, we found a singly bonded oxygen! acid . removeAtom ( bond . getAtom ( j ) ) ; } } } } }
Removes the singly bonded oxygen from the acid group of the AminoAcid .