private void placeLinearChains3D ( IAtomContainer molecule , IAtomContainer startAtoms , AtomPlacer3D ap3d , AtomTetrahedralLigandPlacer3D atlp3d , AtomPlacer atomPlacer ) throws CDKException { //logger.debug("****** PLACE LINEAR CHAINS ******"); IAtom dihPlacedAtom = null ; IAtom thirdPlacedAtom = null ; IAtomContainer longestUnplacedChain = molecule . getBuilder ( ) . newInstance ( IAtomContainer . class ) ; if ( startAtoms . getAtomCount ( ) == 0 ) { //no branch points ->linear chain //logger.debug("------ LINEAR CHAIN - FINISH ------"); } else { for ( int i = 0 ; i < startAtoms . getAtomCount ( ) ; i ++ ) { //logger.debug("FOUND BRANCHED ALKAN"); //logger.debug("Atom NOT NULL:" + molecule.indexOf(startAtoms.getAtomAt(i))); thirdPlacedAtom = ap3d . getPlacedHeavyAtom ( molecule , startAtoms . getAtom ( i ) ) ; dihPlacedAtom = ap3d . getPlacedHeavyAtom ( molecule , thirdPlacedAtom , startAtoms . getAtom ( i ) ) ; longestUnplacedChain . addAtom ( dihPlacedAtom ) ; longestUnplacedChain . addAtom ( thirdPlacedAtom ) ; longestUnplacedChain . addAtom ( startAtoms . getAtom ( i ) ) ; longestUnplacedChain . add ( atomPlacer . getLongestUnplacedChain ( molecule , startAtoms . getAtom ( i ) ) ) ; setAtomsToUnVisited ( molecule ) ; if ( longestUnplacedChain . getAtomCount ( ) < 4 ) { //di,third,sec //logger.debug("------ SINGLE BRANCH METHYLTYP ------"); //break; } else { //logger.debug("LongestUnchainLength:"+longestUnplacedChain.getAtomCount()); ap3d . placeAliphaticHeavyChain ( molecule , longestUnplacedChain ) ; ap3d . zmatrixChainToCartesian ( molecule , true ) ; searchAndPlaceBranches ( molecule , longestUnplacedChain , ap3d , atlp3d , atomPlacer ) ; } longestUnplacedChain . removeAllElements ( ) ; } //for } //logger.debug("****** HANDLE ALIPHATICS END ******"); }
Layout all aliphatic chains with ZMatrix .