void effectiveCharges ( IAtomContainer mol , int [ ] [ ] adjList ) { double [ ] tmp = new double [ mol . getAtomCount ( ) ] ; for ( int v = 0 ; v < tmp . length ; v ++ ) { IAtom atom = mol . getAtom ( v ) ; int intType = mmffParamSet . intType ( atom . getAtomTypeName ( ) ) ; // unknown if ( intType == 0 ) { continue ; } int crd = mmffParamSet . getCrd ( intType ) ; BigDecimal fcAdj = mmffParamSet . getFormalChargeAdjustment ( intType ) ; double adjust = fcAdj . doubleValue ( ) ; tmp [ v ] = atom . getCharge ( ) ; // sharing when no formal charge adjustment - needed to match // phosphate examples from paper V but documented? if ( adjust == 0 ) { for ( int w : adjList [ v ] ) { if ( mol . getAtom ( w ) . getCharge ( ) < 0 ) { tmp [ v ] += mol . getAtom ( w ) . getCharge ( ) / ( 2.0 * adjList [ w ] . length ) ; } } } // positive charge sharing - undocumented but inferred from validation suite if ( atom . getAtomTypeName ( ) . equals ( "NM" ) ) { for ( int w : adjList [ v ] ) { if ( mol . getAtom ( w ) . getCharge ( ) > 0 ) { tmp [ v ] -= mol . getAtom ( w ) . getCharge ( ) / 2 ; } } } // negative charge sharing if ( adjust != 0 ) { double q = 0 ; for ( int w : adjList [ v ] ) { q += mol . getAtom ( w ) . getCharge ( ) ; } tmp [ v ] = ( ( 1 - ( crd * adjust ) ) * tmp [ v ] ) + ( adjust * q ) ; } } for ( int v = 0 ; v < tmp . length ; v ++ ) { mol . getAtom ( v ) . setCharge ( tmp [ v ] ) ; } }
Internal effective charges method .