idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
28,100 | private static List < IAtomContainer > getMaximum ( ArrayList < IAtomContainer > graphList , boolean shouldMatchBonds ) throws CDKException { List < IAtomContainer > reducedGraphList = ( List < IAtomContainer > ) graphList . clone ( ) ; for ( int i = 0 ; i < graphList . size ( ) ; i ++ ) { IAtomContainer graphI = graphList . get ( i ) ; for ( int j = i + 1 ; j < graphList . size ( ) ; j ++ ) { IAtomContainer graphJ = graphList . get ( j ) ; if ( isSubgraph ( graphJ , graphI , shouldMatchBonds ) ) { reducedGraphList . remove ( graphI ) ; } else if ( isSubgraph ( graphI , graphJ , shouldMatchBonds ) ) { reducedGraphList . remove ( graphJ ) ; } } } return reducedGraphList ; } | Removes all redundant solution . |
28,101 | private static void arcConstructor ( CDKRGraph graph , IAtomContainer ac1 , IAtomContainer ac2 ) throws CDKException { for ( int i = 0 ; i < graph . getGraph ( ) . size ( ) ; i ++ ) { CDKRNode rNodeX = graph . getGraph ( ) . get ( i ) ; rNodeX . getForbidden ( ) . set ( i ) ; } IBond bondA1 ; IBond bondA2 ; IBond bondB1 ; IBond bondB2 ; graph . setFirstGraphSize ( ac1 . getBondCount ( ) ) ; graph . setSecondGraphSize ( ac2 . getBondCount ( ) ) ; for ( int i = 0 ; i < graph . getGraph ( ) . size ( ) ; i ++ ) { CDKRNode rNodeX = graph . getGraph ( ) . get ( i ) ; for ( int j = i + 1 ; j < graph . getGraph ( ) . size ( ) ; j ++ ) { CDKRNode rNodeY = graph . getGraph ( ) . get ( j ) ; bondA1 = ac1 . getBond ( graph . getGraph ( ) . get ( i ) . getRMap ( ) . getId1 ( ) ) ; bondA2 = ac2 . getBond ( graph . getGraph ( ) . get ( i ) . getRMap ( ) . getId2 ( ) ) ; bondB1 = ac1 . getBond ( graph . getGraph ( ) . get ( j ) . getRMap ( ) . getId1 ( ) ) ; bondB2 = ac2 . getBond ( graph . getGraph ( ) . get ( j ) . getRMap ( ) . getId2 ( ) ) ; if ( bondA2 instanceof IQueryBond ) { if ( bondA1 . equals ( bondB1 ) || bondA2 . equals ( bondB2 ) || ! queryAdjacencyAndOrder ( bondA1 , bondB1 , bondA2 , bondB2 ) ) { rNodeX . getForbidden ( ) . set ( j ) ; rNodeY . getForbidden ( ) . set ( i ) ; } else if ( hasCommonAtom ( bondA1 , bondB1 ) ) { rNodeX . getExtension ( ) . set ( j ) ; rNodeY . getExtension ( ) . set ( i ) ; } } else { if ( bondA1 . equals ( bondB1 ) || bondA2 . equals ( bondB2 ) || ( ! getCommonSymbol ( bondA1 , bondB1 ) . equals ( getCommonSymbol ( bondA2 , bondB2 ) ) ) ) { rNodeX . getForbidden ( ) . set ( j ) ; rNodeY . getForbidden ( ) . set ( i ) ; } else if ( hasCommonAtom ( bondA1 , bondB1 ) ) { rNodeX . getExtension ( ) . set ( j ) ; rNodeY . getExtension ( ) . set ( i ) ; } } } } } | Build edges of the RGraphs This method create the edge of the CDKRGraph and calculates the incompatibility and neighbourhood relationships between CDKRGraph nodes . |
28,102 | private static boolean hasCommonAtom ( IBond bondA , IBond bondB ) { return bondA . contains ( bondB . getBegin ( ) ) || bondA . contains ( bondB . getEnd ( ) ) ; } | Determines if two bonds have at least one atom in common . |
28,103 | private static String getCommonSymbol ( IBond bondA , IBond bondB ) { String symbol = "" ; if ( bondA . contains ( bondB . getBegin ( ) ) ) { symbol = bondB . getBegin ( ) . getSymbol ( ) ; } else if ( bondA . contains ( bondB . getEnd ( ) ) ) { symbol = bondB . getEnd ( ) . getSymbol ( ) ; } return symbol ; } | Determines if 2 bondA1 have 1 atom in common and returns the common symbol |
28,104 | private static boolean queryAdjacency ( IBond bondA1 , IBond bondB1 , IBond bondA2 , IBond bondB2 ) { IAtom atom1 = null ; IAtom atom2 = null ; if ( bondA1 . contains ( bondB1 . getBegin ( ) ) ) { atom1 = bondB1 . getBegin ( ) ; } else if ( bondA1 . contains ( bondB1 . getEnd ( ) ) ) { atom1 = bondB1 . getEnd ( ) ; } if ( bondA2 . contains ( bondB2 . getBegin ( ) ) ) { atom2 = bondB2 . getBegin ( ) ; } else if ( bondA2 . contains ( bondB2 . getEnd ( ) ) ) { atom2 = bondB2 . getEnd ( ) ; } if ( atom1 != null && atom2 != null ) { return ( ( IQueryAtom ) atom2 ) . matches ( atom1 ) ; } else { return atom1 == null && atom2 == null ; } } | Determines if 2 bondA1 have 1 atom in common if second is atom query AtomContainer |
28,105 | public HashGeneratorMaker encode ( AtomEncoder encoder ) { if ( encoder == null ) throw new NullPointerException ( "no encoder provided" ) ; customEncoders . add ( encoder ) ; return this ; } | Add a custom encoder to the hash generator which will be built . Although not enforced the encoder should be stateless and should not modify any passed inputs . |
28,106 | private StereoEncoderFactory makeStereoEncoderFactory ( ) { if ( stereoEncoders . isEmpty ( ) ) { return StereoEncoderFactory . EMPTY ; } else if ( stereoEncoders . size ( ) == 1 ) { return stereoEncoders . get ( 0 ) ; } else { StereoEncoderFactory factory = new ConjugatedEncoderFactory ( stereoEncoders . get ( 0 ) , stereoEncoders . get ( 1 ) ) ; for ( int i = 2 ; i < stereoEncoders . size ( ) ; i ++ ) { factory = new ConjugatedEncoderFactory ( factory , stereoEncoders . get ( i ) ) ; } return factory ; } } | Combines the separate stereo encoder factories into a single factory . |
28,107 | private double getWidthForMappingLine ( RendererModel model ) { double scale = model . getParameter ( Scale . class ) . getValue ( ) ; return mappingLineWidth . getValue ( ) / scale ; } | Determine the width of an atom atom mapping returning the width defined in the model . Note that this will be scaled to the space of the model . |
28,108 | public void mul ( Complex c ) { double newreal = real * c . real - imag * c . imag ; double newimag = real * c . imag + imag * c . real ; real = newreal ; imag = newimag ; } | Multiply this value with a complex value |
28,109 | public void div ( Complex c ) { double modulus = c . real * c . real + c . imag * c . imag ; double newreal = imag * c . imag + real * c . real ; double newimag = imag * c . real - real * c . imag ; real = newreal / modulus ; imag = newimag / modulus ; } | Div this value by a complex value |
28,110 | public void setParameters ( Object [ ] params ) throws CDKException { if ( params . length != 2 ) throw new CDKException ( "RDBERule expects two parameters" ) ; if ( ! ( params [ 0 ] instanceof Double ) ) throw new CDKException ( "The 1 parameter must be of type Double" ) ; if ( ! ( params [ 1 ] instanceof Double ) ) throw new CDKException ( "The 2 parameter must be of type Double" ) ; min = ( Double ) params [ 0 ] ; max = ( Double ) params [ 1 ] ; } | Sets the parameters attribute of the RDBE object . |
28,111 | public Object [ ] getParameters ( ) { Object [ ] params = new Object [ 2 ] ; params [ 0 ] = min ; params [ 1 ] = max ; return params ; } | Gets the parameters attribute of the RDBRule object . |
28,112 | public double validate ( IMolecularFormula formula ) throws CDKException { logger . info ( "Start validation of " , formula ) ; List < Double > RDBEList = getRDBEValue ( formula ) ; for ( Iterator < Double > it = RDBEList . iterator ( ) ; it . hasNext ( ) ; ) { double RDBE = it . next ( ) ; if ( min <= RDBE && RDBE <= 30 ) if ( validate ( formula , RDBE ) ) return 1.0 ; } return 0.0 ; } | Validate the RDBRule of this IMolecularFormula . |
28,113 | private void createTable ( ) { if ( oxidationStateTable == null ) { oxidationStateTable = new HashMap < String , int [ ] > ( ) ; oxidationStateTable . put ( "H" , new int [ ] { 1 } ) ; oxidationStateTable . put ( "B" , new int [ ] { 3 } ) ; oxidationStateTable . put ( "C" , new int [ ] { 4 } ) ; oxidationStateTable . put ( "N" , new int [ ] { 3 } ) ; oxidationStateTable . put ( "O" , new int [ ] { 2 } ) ; oxidationStateTable . put ( "F" , new int [ ] { 1 } ) ; oxidationStateTable . put ( "Na" , new int [ ] { 1 } ) ; oxidationStateTable . put ( "Mg" , new int [ ] { 2 } ) ; oxidationStateTable . put ( "Al" , new int [ ] { 3 } ) ; oxidationStateTable . put ( "Si" , new int [ ] { 4 } ) ; oxidationStateTable . put ( "P" , new int [ ] { 3 , 5 } ) ; oxidationStateTable . put ( "S" , new int [ ] { 2 , 4 , 6 } ) ; oxidationStateTable . put ( "Cl" , new int [ ] { 1 } ) ; oxidationStateTable . put ( "I" , new int [ ] { 1 } ) ; } } | Create the table with the common oxidation states |
28,114 | protected static List < IAtomContainer > splitMolecule ( IAtomContainer atomContainer , IBond bond ) { List < IAtomContainer > ret = new ArrayList < IAtomContainer > ( ) ; for ( IAtom atom : bond . atoms ( ) ) { IAtom excludedAtom ; if ( atom . equals ( bond . getBegin ( ) ) ) excludedAtom = bond . getEnd ( ) ; else excludedAtom = bond . getBegin ( ) ; List < IBond > part = new ArrayList < IBond > ( ) ; part . add ( bond ) ; part = traverse ( atomContainer , atom , part ) ; IAtomContainer partContainer ; partContainer = makeAtomContainer ( atom , part , excludedAtom ) ; if ( partContainer . getAtomCount ( ) > 2 && partContainer . getAtomCount ( ) != atomContainer . getAtomCount ( ) ) ret . add ( partContainer ) ; part . remove ( 0 ) ; partContainer = makeAtomContainer ( atom , part , excludedAtom ) ; if ( partContainer . getAtomCount ( ) > 2 && partContainer . getAtomCount ( ) != atomContainer . getAtomCount ( ) ) ret . add ( partContainer ) ; } return ret ; } | Non destructively split a molecule into two parts at the specified bond . |
28,115 | protected static IAtomContainer makeAtomContainer ( IAtom atom , List < IBond > parts , IAtom excludedAtom ) { IAtomContainer partContainer = atom . getBuilder ( ) . newInstance ( IAtomContainer . class ) ; partContainer . addAtom ( atom ) ; for ( IBond aBond : parts ) { for ( IAtom bondedAtom : aBond . atoms ( ) ) { if ( ! bondedAtom . equals ( excludedAtom ) && ! partContainer . contains ( bondedAtom ) ) partContainer . addAtom ( bondedAtom ) ; } if ( ! aBond . contains ( excludedAtom ) ) partContainer . addBond ( aBond ) ; } return partContainer ; } | splitting bond itself |
28,116 | public DescriptorValue calculate ( IAtom atom , IAtomContainer container ) { IAtomContainer clone ; IAtom localAtom ; try { clone = ( IAtomContainer ) container . clone ( ) ; localAtom = clone . getAtom ( container . indexOf ( atom ) ) ; AtomContainerManipulator . percieveAtomTypesAndConfigureAtoms ( clone ) ; } catch ( CDKException e ) { return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new DoubleResult ( Double . NaN ) , NAMES , e ) ; } catch ( CloneNotSupportedException e ) { return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new DoubleResult ( Double . NaN ) , NAMES , e ) ; } double result = stabil . calculatePositive ( clone , localAtom ) ; return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new DoubleResult ( result ) , NAMES ) ; } | The method calculates the stabilization of charge of a given atom It is needed to call the addExplicitHydrogensToSatisfyValency method from the class tools . HydrogenAdder . |
28,117 | public void setParameters ( Object [ ] params ) throws CDKException { if ( params . length > 1 ) { throw new CDKException ( "DistanceToAtomDescriptor only expects two parameters" ) ; } if ( ! ( params [ 0 ] instanceof Integer ) ) { throw new CDKException ( "The parameter must be of type Integer" ) ; } focusPosition = ( Integer ) params [ 0 ] ; } | Sets the parameters attribute of the DistanceToAtomDescriptor object |
28,118 | public DescriptorValue calculate ( IAtom atom , IAtomContainer container ) { double distanceToAtom ; IAtom focus = container . getAtom ( focusPosition ) ; if ( atom . getPoint3d ( ) == null || focus . getPoint3d ( ) == null ) { return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new DoubleResult ( Double . NaN ) , getDescriptorNames ( ) , new CDKException ( "Target or focus atom must have 3D coordinates." ) ) ; } distanceToAtom = calculateDistanceBetweenTwoAtoms ( atom , focus ) ; return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new DoubleResult ( distanceToAtom ) , getDescriptorNames ( ) ) ; } | This method calculate the 3D distance between two atoms . |
28,119 | public static boolean isLowerOrder ( IBond . Order first , IBond . Order second ) { if ( first == null || second == null || first == IBond . Order . UNSET || second == IBond . Order . UNSET ) return false ; return first . compareTo ( second ) < 0 ; } | Returns true if the first bond has a lower bond order than the second bond . It returns false if the bond order is equal and if the order of the first bond is larger than that of the second . Also returns false if either bond order is unset . |
28,120 | public static IBond . Order increaseBondOrder ( IBond . Order oldOrder ) { switch ( oldOrder ) { case SINGLE : return Order . DOUBLE ; case DOUBLE : return Order . TRIPLE ; case TRIPLE : return Order . QUADRUPLE ; case QUADRUPLE : return Order . QUINTUPLE ; case QUINTUPLE : return Order . SEXTUPLE ; default : return oldOrder ; } } | Returns the IBond . Order one higher . Does not increase the bond order beyond the QUADRUPLE bond order . |
28,121 | public static IBond . Order createBondOrder ( double bondOrder ) { for ( IBond . Order order : IBond . Order . values ( ) ) { if ( order . numeric ( ) . doubleValue ( ) == bondOrder ) return order ; } return null ; } | Convenience method to convert a double into an IBond . Order . Returns NULL if the bond order is not 1 . 0 2 . 0 3 . 0 and 4 . 0 . |
28,122 | public static IBond . Order getMaximumBondOrder ( Iterator < IBond > bonds ) { IBond . Order maxOrder = IBond . Order . SINGLE ; while ( bonds . hasNext ( ) ) { IBond bond = bonds . next ( ) ; if ( isHigherOrder ( bond . getOrder ( ) , maxOrder ) ) maxOrder = bond . getOrder ( ) ; } return maxOrder ; } | Returns the maximum bond order for a List of bonds given an iterator to the list . |
28,123 | public static IBond . Order getMaximumBondOrder ( IBond firstBond , IBond secondBond ) { if ( firstBond == null || secondBond == null ) throw new IllegalArgumentException ( "null instance of IBond provided" ) ; return getMaximumBondOrder ( firstBond . getOrder ( ) , secondBond . getOrder ( ) ) ; } | Returns the maximum bond order for the two bonds . |
28,124 | public static IBond . Order getMaximumBondOrder ( IBond . Order firstOrder , IBond . Order secondOrder ) { if ( firstOrder == Order . UNSET ) { if ( secondOrder == Order . UNSET ) throw new IllegalArgumentException ( "Both bond orders are unset" ) ; return secondOrder ; } if ( secondOrder == Order . UNSET ) { if ( firstOrder == Order . UNSET ) throw new IllegalArgumentException ( "Both bond orders are unset" ) ; return firstOrder ; } if ( isHigherOrder ( firstOrder , secondOrder ) ) return firstOrder ; else return secondOrder ; } | Returns the maximum bond order for the two bond orders . |
28,125 | public static IBond . Order getMinimumBondOrder ( Iterator < IBond > bonds ) { IBond . Order minOrder = IBond . Order . SEXTUPLE ; while ( bonds . hasNext ( ) ) { IBond bond = bonds . next ( ) ; if ( isLowerOrder ( bond . getOrder ( ) , minOrder ) ) minOrder = bond . getOrder ( ) ; } return minOrder ; } | Returns the minimum bond order for a List of bonds given an iterator to the list . |
28,126 | private void split ( Map < Invariant , SortedSet < Integer > > invariants , Partition partition ) { int nonEmptyInvariants = invariants . keySet ( ) . size ( ) ; if ( nonEmptyInvariants > 1 ) { List < Invariant > invariantKeys = new ArrayList < Invariant > ( invariants . keySet ( ) ) ; partition . removeCell ( currentBlockIndex ) ; int k = currentBlockIndex ; if ( splitOrder == SplitOrder . REVERSE ) { Collections . sort ( invariantKeys ) ; } else { Collections . sort ( invariantKeys , Collections . reverseOrder ( ) ) ; } for ( Invariant h : invariantKeys ) { SortedSet < Integer > setH = invariants . get ( h ) ; partition . insertCell ( k , setH ) ; blocksToRefine . add ( setH ) ; k ++ ; } currentBlockIndex += nonEmptyInvariants - 1 ; } } | Split the current block using the invariants calculated in getInvariants . |
28,127 | public void setParameters ( Object [ ] params ) throws CDKException { if ( params . length > 3 ) throw new CDKException ( "PartialPiChargeDescriptor only expects three parameter" ) ; if ( ! ( params [ 0 ] instanceof Integer ) ) throw new CDKException ( "The parameter must be of type Integer" ) ; maxIterations = ( Integer ) params [ 0 ] ; if ( params . length > 1 && params [ 1 ] != null ) { if ( ! ( params [ 1 ] instanceof Boolean ) ) throw new CDKException ( "The parameter must be of type Boolean" ) ; lpeChecker = ( Boolean ) params [ 1 ] ; } if ( params . length > 2 && params [ 2 ] != null ) { if ( ! ( params [ 2 ] instanceof Integer ) ) throw new CDKException ( "The parameter must be of type Integer" ) ; maxResonStruc = ( Integer ) params [ 2 ] ; } } | Sets the parameters attribute of the PiElectronegativityDescriptor object |
28,128 | public Object [ ] getParameters ( ) { Object [ ] params = new Object [ 3 ] ; params [ 0 ] = maxIterations ; params [ 1 ] = lpeChecker ; params [ 2 ] = maxResonStruc ; return params ; } | Gets the parameters attribute of the PiElectronegativityDescriptor object |
28,129 | public DescriptorValue calculate ( IAtom atom , IAtomContainer atomContainer ) { IAtomContainer clone ; IAtom localAtom ; try { clone = ( IAtomContainer ) atomContainer . clone ( ) ; AtomContainerManipulator . percieveAtomTypesAndConfigureAtoms ( clone ) ; if ( lpeChecker ) { LonePairElectronChecker lpcheck = new LonePairElectronChecker ( ) ; lpcheck . saturate ( atomContainer ) ; } localAtom = clone . getAtom ( atomContainer . indexOf ( atom ) ) ; } catch ( CloneNotSupportedException e ) { return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new DoubleResult ( Double . NaN ) , NAMES , null ) ; } catch ( CDKException e ) { return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new DoubleResult ( Double . NaN ) , NAMES , null ) ; } if ( maxIterations != - 1 && maxIterations != 0 ) electronegativity . setMaxIterations ( maxIterations ) ; if ( maxResonStruc != - 1 && maxResonStruc != 0 ) electronegativity . setMaxResonStruc ( maxResonStruc ) ; double result = electronegativity . calculatePiElectronegativity ( clone , localAtom ) ; return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new DoubleResult ( result ) , NAMES ) ; } | The method calculates the pi electronegativity of a given atom It is needed to call the addExplicitHydrogensToSatisfyValency method from the class tools . HydrogenAdder . |
28,130 | public String [ ] getParameterNames ( ) { String [ ] params = new String [ 3 ] ; params [ 0 ] = "maxIterations" ; params [ 1 ] = "lpeChecker" ; params [ 2 ] = "maxResonStruc" ; return params ; } | Gets the parameterNames attribute of the SigmaElectronegativityDescriptor object |
28,131 | public Object getParameterType ( String name ) { if ( "maxIterations" . equals ( name ) ) return Integer . MAX_VALUE ; if ( "lpeChecker" . equals ( name ) ) return Boolean . TRUE ; if ( "maxResonStruc" . equals ( name ) ) return Integer . MAX_VALUE ; return null ; } | Gets the parameterType attribute of the SigmaElectronegativityDescriptor object |
28,132 | public IVector getVectorFromRow ( int index ) { IVector result = new IVector ( columns ) ; for ( int i = 0 ; i < columns ; i ++ ) { result . realvector [ i ] = realmatrix [ index ] [ i ] ; result . imagvector [ i ] = imagmatrix [ index ] [ i ] ; } return result ; } | Creates a vector with the content of a row from this matrix |
28,133 | public IVector getVectorFromColumn ( int index ) { IVector result = new IVector ( rows ) ; for ( int i = 0 ; i < rows ; i ++ ) { result . realvector [ i ] = realmatrix [ i ] [ index ] ; result . imagvector [ i ] = imagmatrix [ i ] [ index ] ; } return result ; } | Creates a vector with the content of a column from this matrix |
28,134 | public IVector getVectorFromDiagonal ( ) { int size = Math . min ( rows , columns ) ; IVector result = new IVector ( size ) ; for ( int i = 0 ; i < rows ; i ++ ) { result . realvector [ i ] = realmatrix [ i ] [ i ] ; result . imagvector [ i ] = imagmatrix [ i ] [ i ] ; } return result ; } | Creates a vector with the content of the diagonal elements from this matrix |
28,135 | public IMatrix add ( IMatrix b ) { IMatrix result = new IMatrix ( rows , columns ) ; add ( b , result ) ; return result ; } | Addition from two matrices |
28,136 | public Complex contraction ( ) { int i , j ; Complex result = new Complex ( 0d , 0d ) ; for ( i = 0 ; i < rows ; i ++ ) for ( j = 0 ; j < columns ; j ++ ) { result . real += realmatrix [ i ] [ j ] ; result . imag += imagmatrix [ i ] [ j ] ; } return result ; } | Calculates the contraction from a matrix |
28,137 | public void reshape ( int newrows , int newcolumns ) { if ( ( ( newrows == rows ) && ( newcolumns == columns ) ) || ( newrows <= 0 ) || ( newcolumns <= 0 ) ) return ; double [ ] [ ] newrealmatrix = new double [ newrows ] [ newcolumns ] ; double [ ] [ ] newimagmatrix = new double [ newrows ] [ newcolumns ] ; int minrows = Math . min ( rows , newrows ) ; int mincolumns = Math . min ( columns , newcolumns ) ; int i , j ; for ( i = 0 ; i < minrows ; i ++ ) for ( j = 0 ; j < mincolumns ; j ++ ) { newrealmatrix [ i ] [ j ] = realmatrix [ i ] [ j ] ; newimagmatrix [ i ] [ j ] = imagmatrix [ i ] [ j ] ; } for ( i = minrows ; i < newrows ; i ++ ) for ( j = 0 ; j < mincolumns ; j ++ ) { newrealmatrix [ i ] [ j ] = 0d ; newimagmatrix [ i ] [ j ] = 0d ; } for ( i = 0 ; i < minrows ; i ++ ) for ( j = mincolumns ; j < newcolumns ; j ++ ) { newrealmatrix [ i ] [ j ] = 0d ; newimagmatrix [ i ] [ j ] = 0d ; } for ( i = minrows ; i < newrows ; i ++ ) for ( j = mincolumns ; j < newcolumns ; j ++ ) { newrealmatrix [ i ] [ j ] = 0d ; newimagmatrix [ i ] [ j ] = 0d ; } realmatrix = newrealmatrix ; imagmatrix = newimagmatrix ; rows = newrows ; columns = newcolumns ; } | Resize the matrix |
28,138 | static void updateAromaticTypesInSixMemberRing ( int [ ] cycle , String [ ] symbs ) { for ( final int v : cycle ) { if ( NCN_PLUS . equals ( symbs [ v ] ) || "N+=C" . equals ( symbs [ v ] ) || "N=+C" . equals ( symbs [ v ] ) ) symbs [ v ] = "NPD+" ; else if ( "N2OX" . equals ( symbs [ v ] ) ) symbs [ v ] = "NPOX" ; else if ( "N=C" . equals ( symbs [ v ] ) || "N=N" . equals ( symbs [ v ] ) ) symbs [ v ] = "NPYD" ; else if ( symbs [ v ] . startsWith ( "C" ) ) symbs [ v ] = "CB" ; } } | Update aromatic atom types in a six member ring . The aromatic types here are hard coded from the MMFFAROM . PAR file . |
28,139 | static int indexOfHetro ( int [ ] cycle , int [ ] contribution ) { int index = - 1 ; for ( int i = 0 ; i < cycle . length - 1 ; i ++ ) { if ( contribution [ cycle [ i ] ] == 2 ) index = index == - 1 ? i : - 2 ; } return index ; } | Find the index of a hetroatom in a cycle . A hetroatom in MMFF is the unique atom that contributes a pi - lone - pair to the aromatic system . |
28,140 | @ SuppressWarnings ( "PMD.CyclomaticComplexity" ) static int contribution ( int elem , int x , int v ) { switch ( elem ) { case 6 : if ( x == 3 && v == 4 ) return 1 ; break ; case 7 : if ( x == 2 && v == 3 ) return 1 ; if ( x == 3 && v == 4 ) return 1 ; if ( x == 3 && v == 3 ) return 2 ; if ( x == 2 && v == 2 ) return 2 ; break ; case 8 : case 16 : if ( x == 2 && v == 2 ) return 2 ; break ; } return - 1 ; } | Electron contribution of an element with the specified connectivity and valence . |
28,141 | private static void setupContributionAndDoubleBonds ( IAtomContainer molecule , EdgeToBondMap bonds , int [ ] [ ] graph , int [ ] contribution , int [ ] dbs ) { for ( int v = 0 ; v < graph . length ; v ++ ) { int hyd = molecule . getAtom ( v ) . getImplicitHydrogenCount ( ) ; int val = hyd ; int con = hyd + graph [ v ] . length ; for ( int w : graph [ v ] ) { IBond bond = bonds . get ( v , w ) ; val += bond . getOrder ( ) . numeric ( ) ; if ( bond . getOrder ( ) == IBond . Order . DOUBLE ) { dbs [ v ] = dbs [ v ] == - 1 ? w : - 2 ; } } contribution [ v ] = contribution ( molecule . getAtom ( v ) . getAtomicNumber ( ) , con , val ) ; } } | Internal - sets up the contribution and dbs vectors . These define how many pi electrons an atom can contribute and provide a lookup of the double bonded neighbour . |
28,142 | public void endElement ( CMLStack xpath , String uri , String name , String raw ) { if ( name . equals ( "molecule" ) ) { if ( currentChargeGroup != null ) { if ( currentMolecule instanceof MDMolecule ) { ( ( MDMolecule ) currentMolecule ) . addChargeGroup ( currentChargeGroup ) ; } else { logger . error ( "Need to store a charge group, but the current molecule is not a MDMolecule!" ) ; } currentChargeGroup = null ; } else if ( currentResidue != null ) { if ( currentMolecule instanceof MDMolecule ) { ( ( MDMolecule ) currentMolecule ) . addResidue ( currentResidue ) ; } else { logger . error ( "Need to store a residue group, but the current molecule is not a MDMolecule!" ) ; } currentResidue = null ; } else { super . endElement ( xpath , uri , name , raw ) ; } } else if ( "atomArray" . equals ( name ) ) { if ( xpath . length ( ) == 2 && xpath . endsWith ( "molecule" , "atomArray" ) ) { storeAtomData ( ) ; newAtomData ( ) ; } else if ( xpath . length ( ) > 2 && xpath . endsWith ( "cml" , "molecule" , "atomArray" ) ) { storeAtomData ( ) ; newAtomData ( ) ; } } else if ( "bondArray" . equals ( name ) ) { if ( xpath . length ( ) == 2 && xpath . endsWith ( "molecule" , "bondArray" ) ) { storeBondData ( ) ; newBondData ( ) ; } else if ( xpath . length ( ) > 2 && xpath . endsWith ( "cml" , "molecule" , "bondArray" ) ) { storeBondData ( ) ; newBondData ( ) ; } } else if ( "scalar" . equals ( name ) ) { if ( "md:resNumber" . equals ( DICTREF ) ) { int myInt = Integer . parseInt ( currentChars ) ; currentResidue . setNumber ( myInt ) ; } else if ( "md:cgNumber" . equals ( DICTREF ) ) { int myInt = Integer . parseInt ( currentChars ) ; currentChargeGroup . setNumber ( myInt ) ; } } else { super . endElement ( xpath , uri , name , raw ) ; } } | Finish up parsing of elements in mdmolecule . |
28,143 | private void setActiveCenters ( IAtomContainer reactant ) throws CDKException { Iterator < IBond > bonds = reactant . bonds ( ) . iterator ( ) ; while ( bonds . hasNext ( ) ) { IBond bondi = bonds . next ( ) ; IAtom atom1 = bondi . getBegin ( ) ; IAtom atom2 = bondi . getEnd ( ) ; if ( bondi . getOrder ( ) == IBond . Order . SINGLE && ( atom1 . getFormalCharge ( ) == CDKConstants . UNSET ? 0 : atom1 . getFormalCharge ( ) ) == 0 && ( atom2 . getFormalCharge ( ) == CDKConstants . UNSET ? 0 : atom2 . getFormalCharge ( ) ) == 0 && reactant . getConnectedSingleElectronsCount ( atom1 ) == 0 && reactant . getConnectedSingleElectronsCount ( atom2 ) == 0 ) { bondi . setFlag ( CDKConstants . REACTIVE_CENTER , true ) ; atom1 . setFlag ( CDKConstants . REACTIVE_CENTER , true ) ; atom2 . setFlag ( CDKConstants . REACTIVE_CENTER , true ) ; } } } | Set the active center for this molecule . The active center will be single bonds . As default is only those atoms without charge and between a sigma bond . |
28,144 | public IAtomContainer assignMMFF94PartialCharges ( IAtomContainer ac ) throws CDKException { if ( ! mmff . assignAtomTypes ( ac ) ) throw new CDKException ( "Molecule had an atom of unknown MMFF type" ) ; mmff . partialCharges ( ac ) ; mmff . clearProps ( ac ) ; for ( IAtom atom : ac . atoms ( ) ) atom . setProperty ( MMFF_94_CHARGE , atom . getCharge ( ) ) ; return ac ; } | Main method which assigns MMFF94 partial charges |
28,145 | private void breadthFirstSearch ( IAtomContainer container , List < IAtom > sphere , List < IAtom > path ) throws CDKException { IAtom nextAtom ; List < IAtom > newSphere = new ArrayList < IAtom > ( ) ; for ( IAtom atom : sphere ) { List bonds = container . getConnectedBondsList ( atom ) ; for ( Object bond : bonds ) { nextAtom = ( ( IBond ) bond ) . getOther ( atom ) ; if ( ( container . getMaximumBondOrder ( nextAtom ) != IBond . Order . SINGLE || Math . abs ( nextAtom . getFormalCharge ( ) ) >= 1 || nextAtom . getFlag ( CDKConstants . ISAROMATIC ) || nextAtom . getSymbol ( ) . equals ( "N" ) || nextAtom . getSymbol ( ) . equals ( "O" ) ) & ! nextAtom . getFlag ( CDKConstants . VISITED ) ) { path . add ( nextAtom ) ; nextAtom . setFlag ( CDKConstants . VISITED , true ) ; if ( container . getConnectedBondsCount ( nextAtom ) > 1 ) { newSphere . add ( nextAtom ) ; } } else { nextAtom . setFlag ( CDKConstants . VISITED , true ) ; } } } if ( newSphere . size ( ) > 0 ) { breadthFirstSearch ( container , newSphere , path ) ; } } | Performs a breadthFirstSearch in an AtomContainer starting with a particular sphere which usually consists of one start atom and searches for a pi system . |
28,146 | private static IChemObjectBuilder findBuilder ( ) { if ( BUILDER != null ) return BUILDER ; for ( String name : new String [ ] { "org.openscience.cdk.silent.SilentChemObjectBuilder" , "org.openscience.cdk.DefaultChemObjectBuilder" } ) { try { Class < ? > cls = Class . forName ( name ) ; Method method = cls . getMethod ( "getInstance" ) ; return BUILDER = ( IChemObjectBuilder ) method . invoke ( cls ) ; } catch ( Exception ex ) { } } return null ; } | with the query |
28,147 | private int prepare ( IAtom atom , IBond prev ) { int count = 0 ; amap [ atom . getIndex ( ) ] = 1 ; for ( IBond bond : atom . bonds ( ) ) { if ( bond == prev ) continue ; IAtom nbr = bond . getOther ( atom ) ; if ( amap [ nbr . getIndex ( ) ] == 0 ) { qbonds [ numBonds ++ ] = ( IQueryBond ) bond ; count += prepare ( nbr , bond ) + 1 ; } else if ( nbr . getIndex ( ) < atom . getIndex ( ) ) { ++ count ; qbonds [ numBonds ++ ] = ( IQueryBond ) bond ; } } return count ; } | prepare the query the required stack size is returned |
28,148 | void setMol ( IAtomContainer mol ) { this . mol = mol ; Arrays . fill ( amap , - 1 ) ; numMapped = 0 ; this . avisit = new boolean [ mol . getAtomCount ( ) ] ; sptr = 0 ; store ( 0 , null ) ; } | Set the molecule to be matched . |
28,149 | private boolean feasible ( int bidx , IQueryAtom qatom , IAtom atom ) { int aidx = atom . getIndex ( ) ; if ( avisit [ aidx ] || ! qatom . matches ( atom ) ) return false ; ++ numMapped ; amap [ qatom . getIndex ( ) ] = aidx ; avisit [ aidx ] = true ; store ( bidx , qatom ) ; return true ; } | Determine if a atom from the molecule is unvisited and if it is matched by the query atom . If the match is feasible the provided query bond index stored on the stack . |
28,150 | private boolean feasible ( IQueryBond qbond , IBond bond ) { if ( bond == null || ! qbond . matches ( bond ) ) return false ; store ( currBondIdx ( ) + 1 , null ) ; return true ; } | Determine if a bond from the molecule exists and if it is matched by the query bond . If the match is feasible the current query bond index is increment and stored on the stack . |
28,151 | boolean matchNext ( ) { if ( numAtoms == 0 ) return false ; if ( sptr > 1 ) backtrack ( ) ; main : while ( sptr != 0 ) { final int bidx = currBondIdx ( ) ; if ( bidx == numBonds ) { if ( numMapped == numAtoms ) return true ; for ( IAtom qatom : query . atoms ( ) ) { if ( amap [ qatom . getIndex ( ) ] == UNMAPPED ) { Iterator < IAtom > iter = atoms ( ) ; while ( iter . hasNext ( ) ) { IAtom atom = iter . next ( ) ; if ( feasible ( bidx , ( IQueryAtom ) qatom , atom ) ) continue main ; } break ; } } backtrack ( ) ; continue ; } IQueryBond qbond = qbonds [ bidx ] ; IQueryAtom qbeg = ( IQueryAtom ) qbond . getBegin ( ) ; IQueryAtom qend = ( IQueryAtom ) qbond . getEnd ( ) ; int begIdx = amap [ qbeg . getIndex ( ) ] ; int endIdx = amap [ qend . getIndex ( ) ] ; if ( begIdx != UNMAPPED && endIdx != UNMAPPED ) { IBond bond = mol . getAtom ( begIdx ) . getBond ( mol . getAtom ( endIdx ) ) ; if ( feasible ( qbond , bond ) ) continue ; } else if ( begIdx != UNMAPPED ) { IAtom beg = mol . getAtom ( begIdx ) ; Iterator < IBond > biter = bonds ( beg ) ; while ( biter . hasNext ( ) ) { IBond bond = biter . next ( ) ; IAtom end = bond . getOther ( beg ) ; if ( qbond . matches ( bond ) && feasible ( bidx + 1 , qend , end ) ) continue main ; } } else if ( endIdx != UNMAPPED ) { IAtom end = mol . getAtom ( endIdx ) ; Iterator < IBond > biter = bonds ( end ) ; while ( biter . hasNext ( ) ) { IBond bond = biter . next ( ) ; IAtom beg = bond . getOther ( end ) ; if ( qbond . matches ( bond ) && feasible ( bidx + 1 , qbeg , beg ) ) continue main ; } } else { Iterator < IAtom > aiter = atoms ( ) ; while ( aiter . hasNext ( ) ) { if ( feasible ( bidx , qbeg , aiter . next ( ) ) ) continue main ; } } backtrack ( ) ; } return false ; } | Primary match function if this function returns true the algorithm has found a match . Calling it again will backtrack and find the next match . |
28,152 | public void writeMolecule ( IAtomContainer mol ) throws IOException { String st = "" ; boolean writecharge = true ; try { String s1 = "" + mol . getAtomCount ( ) ; writer . write ( s1 , 0 , s1 . length ( ) ) ; writer . write ( '\n' ) ; String s2 = null ; if ( s2 != null ) { writer . write ( s2 , 0 , s2 . length ( ) ) ; } writer . write ( '\n' ) ; Iterator < IAtom > atoms = mol . atoms ( ) . iterator ( ) ; while ( atoms . hasNext ( ) ) { IAtom a = atoms . next ( ) ; st = a . getSymbol ( ) ; Point3d p3 = a . getPoint3d ( ) ; if ( p3 != null ) { st = st + "\t" + ( p3 . x < 0 ? "" : " " ) + fsb . format ( p3 . x ) + "\t" + ( p3 . y < 0 ? "" : " " ) + fsb . format ( p3 . y ) + "\t" + ( p3 . z < 0 ? "" : " " ) + fsb . format ( p3 . z ) ; } else { st = st + "\t " + fsb . format ( 0.0 ) + "\t " + fsb . format ( 0.0 ) + "\t " + fsb . format ( 0.0 ) ; } if ( writecharge ) { double ct = a . getCharge ( ) == CDKConstants . UNSET ? 0.0 : a . getCharge ( ) ; st = st + "\t" + ct ; } writer . write ( st , 0 , st . length ( ) ) ; writer . write ( '\n' ) ; } } catch ( IOException e ) { logger . error ( "Error while writing file: " , e . getMessage ( ) ) ; logger . debug ( e ) ; } } | writes a single frame in XYZ format to the Writer . |
28,153 | public void setAtoms ( IAtom [ ] atoms ) { this . atoms = atoms ; atomCount = atoms . length ; notifyChanged ( ) ; } | Sets the array of atoms making up this bond . |
28,154 | public boolean contains ( IAtom atom ) { if ( atoms == null ) return false ; for ( IAtom localAtom : atoms ) { if ( localAtom . equals ( atom ) ) return true ; } return false ; } | Returns true if the given atom participates in this bond . |
28,155 | public Point2d get2DCenter ( ) { double xOfCenter = 0 ; double yOfCenter = 0 ; for ( IAtom atom : atoms ) { xOfCenter += atom . getPoint2d ( ) . x ; yOfCenter += atom . getPoint2d ( ) . y ; } return new Point2d ( xOfCenter / ( ( double ) getAtomCount ( ) ) , yOfCenter / ( ( double ) getAtomCount ( ) ) ) ; } | Returns the geometric 2D center of the bond . |
28,156 | public Point3d get3DCenter ( ) { double xOfCenter = 0 ; double yOfCenter = 0 ; double zOfCenter = 0 ; for ( IAtom atom : atoms ) { xOfCenter += atom . getPoint3d ( ) . x ; yOfCenter += atom . getPoint3d ( ) . y ; zOfCenter += atom . getPoint3d ( ) . z ; } return new Point3d ( xOfCenter / getAtomCount ( ) , yOfCenter / getAtomCount ( ) , zOfCenter / getAtomCount ( ) ) ; } | Returns the geometric 3D center of the bond . |
28,157 | public boolean compare ( Object object ) { if ( object instanceof IBond ) { Bond bond = ( Bond ) object ; for ( IAtom atom : atoms ) { if ( ! bond . contains ( atom ) ) { return false ; } } return true ; } return false ; } | Compares a bond with this bond . |
28,158 | public boolean isConnectedTo ( IBond bond ) { for ( IAtom atom : atoms ) { if ( bond . contains ( atom ) ) return true ; } return false ; } | Checks whether a bond is connected to another one . This can only be true if the bonds have an Atom in common . |
28,159 | public Object [ ] getParameters ( ) { Object [ ] params = new Object [ 2 ] ; params [ 0 ] = checkAromaticity ; params [ 1 ] = salicylFlag ; return params ; } | Gets the parameters attribute of the XLogPDescriptor object . |
28,160 | private int [ ] [ ] initializeHydrogenPairCheck ( int [ ] [ ] pairCheck ) { for ( int i = 0 ; i < pairCheck . length ; i ++ ) { for ( int j = 0 ; j < pairCheck [ 0 ] . length ; j ++ ) { pairCheck [ i ] [ j ] = 0 ; } } return pairCheck ; } | Method initialise the HydrogenpairCheck with a value |
28,161 | private boolean checkRingLink ( IRingSet ringSet , IAtomContainer ac , IAtom atom ) { List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; if ( ringSet . contains ( atom ) ) { return true ; } for ( IAtom neighbour : neighbours ) { if ( ringSet . contains ( neighbour ) ) { return true ; } } return false ; } | Check if atom or neighbour atom is part of a ring |
28,162 | private int getHydrogenCount ( IAtomContainer ac , IAtom atom ) { List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; int hcounter = 0 ; for ( IAtom neighbour : neighbours ) { if ( neighbour . getSymbol ( ) . equals ( "H" ) ) { hcounter += 1 ; } } return hcounter ; } | Gets the hydrogenCount attribute of the XLogPDescriptor object . |
28,163 | private int getHalogenCount ( IAtomContainer ac , IAtom atom ) { List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; int acounter = 0 ; for ( IAtom neighbour : neighbours ) { if ( neighbour . getSymbol ( ) . equals ( "F" ) || neighbour . getSymbol ( ) . equals ( "I" ) || neighbour . getSymbol ( ) . equals ( "Cl" ) || neighbour . getSymbol ( ) . equals ( "Br" ) ) { acounter += 1 ; } } return acounter ; } | Gets the HalogenCount attribute of the XLogPDescriptor object . |
28,164 | private int getAtomTypeXCount ( IAtomContainer ac , IAtom atom ) { List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; int nocounter = 0 ; IBond bond ; for ( IAtom neighbour : neighbours ) { if ( ( neighbour . getSymbol ( ) . equals ( "N" ) || neighbour . getSymbol ( ) . equals ( "O" ) ) && ! ( Boolean ) neighbour . getProperty ( "IS_IN_AROMATIC_RING" ) ) { bond = ac . getBond ( neighbour , atom ) ; if ( bond . getOrder ( ) != IBond . Order . DOUBLE ) { nocounter += 1 ; } } } return nocounter ; } | Gets the atomType X Count attribute of the XLogPDescriptor object . |
28,165 | private int getAromaticCarbonsCount ( IAtomContainer ac , IAtom atom ) { List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; int carocounter = 0 ; for ( IAtom neighbour : neighbours ) { if ( neighbour . getSymbol ( ) . equals ( "C" ) && neighbour . getFlag ( CDKConstants . ISAROMATIC ) ) { carocounter += 1 ; } } return carocounter ; } | Gets the aromaticCarbonsCount attribute of the XLogPDescriptor object . |
28,166 | private int getCarbonsCount ( IAtomContainer ac , IAtom atom ) { List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; int ccounter = 0 ; for ( IAtom neighbour : neighbours ) { if ( neighbour . getSymbol ( ) . equals ( "C" ) ) { if ( ! neighbour . getFlag ( CDKConstants . ISAROMATIC ) ) { ccounter += 1 ; } } } return ccounter ; } | Gets the carbonsCount attribute of the XLogPDescriptor object . |
28,167 | private int getOxygenCount ( IAtomContainer ac , IAtom atom ) { List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; int ocounter = 0 ; for ( IAtom neighbour : neighbours ) { if ( neighbour . getSymbol ( ) . equals ( "O" ) ) { if ( ! neighbour . getFlag ( CDKConstants . ISAROMATIC ) ) { ocounter += 1 ; } } } return ocounter ; } | Gets the oxygenCount attribute of the XLogPDescriptor object . |
28,168 | private int getDoubleBondedCarbonsCount ( IAtomContainer ac , IAtom atom ) { List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; IBond bond ; int cdbcounter = 0 ; for ( IAtom neighbour : neighbours ) { if ( neighbour . getSymbol ( ) . equals ( "C" ) ) { bond = ac . getBond ( neighbour , atom ) ; if ( bond . getOrder ( ) == IBond . Order . DOUBLE ) { cdbcounter += 1 ; } } } return cdbcounter ; } | Gets the doubleBondedCarbonsCount attribute of the XLogPDescriptor object . |
28,169 | private int getDoubleBondedOxygenCount ( IAtomContainer ac , IAtom atom ) { List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; IBond bond ; int odbcounter = 0 ; boolean chargeFlag = false ; if ( atom . getFormalCharge ( ) >= 1 ) { chargeFlag = true ; } for ( IAtom neighbour : neighbours ) { if ( neighbour . getSymbol ( ) . equals ( "O" ) ) { bond = ac . getBond ( neighbour , atom ) ; if ( chargeFlag && neighbour . getFormalCharge ( ) == - 1 && bond . getOrder ( ) == IBond . Order . SINGLE ) { odbcounter += 1 ; } if ( ! neighbour . getFlag ( CDKConstants . ISAROMATIC ) ) { if ( bond . getOrder ( ) == IBond . Order . DOUBLE ) { odbcounter += 1 ; } } } } return odbcounter ; } | Gets the doubleBondedOxygenCount attribute of the XLogPDescriptor object . |
28,170 | private int getDoubleBondedSulfurCount ( IAtomContainer ac , IAtom atom ) { List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; IBond bond ; int sdbcounter = 0 ; for ( IAtom neighbour : neighbours ) { if ( neighbour . getSymbol ( ) . equals ( "S" ) ) { if ( atom . getFormalCharge ( ) == 1 && neighbour . getFormalCharge ( ) == - 1 ) { sdbcounter += 1 ; } bond = ac . getBond ( neighbour , atom ) ; if ( ! neighbour . getFlag ( CDKConstants . ISAROMATIC ) ) { if ( bond . getOrder ( ) == IBond . Order . DOUBLE ) { sdbcounter += 1 ; } } } } return sdbcounter ; } | Gets the doubleBondedSulfurCount attribute of the XLogPDescriptor object . |
28,171 | private int getDoubleBondedNitrogenCount ( IAtomContainer ac , IAtom atom ) { List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; IBond bond ; int ndbcounter = 0 ; for ( IAtom neighbour : neighbours ) { if ( neighbour . getSymbol ( ) . equals ( "N" ) ) { bond = ac . getBond ( neighbour , atom ) ; if ( ! neighbour . getFlag ( CDKConstants . ISAROMATIC ) ) { if ( bond . getOrder ( ) == IBond . Order . DOUBLE ) { ndbcounter += 1 ; } } } } return ndbcounter ; } | Gets the doubleBondedNitrogenCount attribute of the XLogPDescriptor object . |
28,172 | private int getAromaticNitrogensCount ( IAtomContainer ac , IAtom atom ) { List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; int narocounter = 0 ; for ( IAtom neighbour : neighbours ) { if ( neighbour . getSymbol ( ) . equals ( "N" ) && ( Boolean ) neighbour . getProperty ( "IS_IN_AROMATIC_RING" ) ) { narocounter += 1 ; } } return narocounter ; } | Gets the aromaticNitrogensCount attribute of the XLogPDescriptor object . |
28,173 | private int getPiSystemsCount ( IAtomContainer ac , IAtom atom ) { List neighbours = ac . getConnectedAtomsList ( atom ) ; int picounter = 0 ; List bonds = null ; for ( int i = 0 ; i < neighbours . size ( ) ; i ++ ) { IAtom neighbour = ( IAtom ) neighbours . get ( i ) ; bonds = ac . getConnectedBondsList ( neighbour ) ; for ( int j = 0 ; j < bonds . size ( ) ; j ++ ) { IBond bond = ( IBond ) bonds . get ( j ) ; if ( bond . getOrder ( ) != IBond . Order . SINGLE && ! bond . getOther ( neighbour ) . equals ( atom ) && ! neighbour . getSymbol ( ) . equals ( "P" ) && ! neighbour . getSymbol ( ) . equals ( "S" ) ) { picounter += 1 ; } } } return picounter ; } | Gets the piSystemsCount attribute of the XLogPDescriptor object . |
28,174 | private boolean getPresenceOfHydroxy ( IAtomContainer ac , IAtom atom ) { IAtom neighbour0 = ( IAtom ) ac . getConnectedAtomsList ( atom ) . get ( 0 ) ; List first = null ; if ( neighbour0 . getSymbol ( ) . equals ( "C" ) ) { first = ac . getConnectedAtomsList ( neighbour0 ) ; for ( int i = 0 ; i < first . size ( ) ; i ++ ) { IAtom conAtom = ( IAtom ) first . get ( i ) ; if ( conAtom . getSymbol ( ) . equals ( "O" ) ) { if ( ac . getBond ( neighbour0 , conAtom ) . getOrder ( ) == IBond . Order . SINGLE ) { if ( ac . getConnectedBondsCount ( conAtom ) > 1 && getHydrogenCount ( ac , conAtom ) == 0 ) { return false ; } else { return true ; } } } } } return false ; } | Gets the presenceOf Hydroxy group attribute of the XLogPDescriptor object . |
28,175 | private boolean getPresenceOfNitro ( IAtomContainer ac , IAtom atom ) { List neighbours = ac . getConnectedAtomsList ( atom ) ; List second = null ; IBond bond = null ; for ( int i = 0 ; i < neighbours . size ( ) ; i ++ ) { IAtom neighbour = ( IAtom ) neighbours . get ( i ) ; if ( neighbour . getSymbol ( ) . equals ( "N" ) ) { second = ac . getConnectedAtomsList ( neighbour ) ; for ( int b = 0 ; b < second . size ( ) ; b ++ ) { IAtom conAtom = ( IAtom ) second . get ( b ) ; if ( conAtom . getSymbol ( ) . equals ( "O" ) ) { bond = ac . getBond ( neighbour , conAtom ) ; if ( bond . getOrder ( ) == IBond . Order . DOUBLE ) { return true ; } } } } } return false ; } | Gets the presenceOfN = O attribute of the XLogPDescriptor object . |
28,176 | private boolean getIfCarbonIsHydrophobic ( IAtomContainer ac , IAtom atom ) { List first = ac . getConnectedAtomsList ( atom ) ; List second = null ; List third = null ; if ( first . size ( ) > 0 ) { for ( int i = 0 ; i < first . size ( ) ; i ++ ) { IAtom firstAtom = ( IAtom ) first . get ( i ) ; if ( firstAtom . getSymbol ( ) . equals ( "C" ) || firstAtom . getSymbol ( ) . equals ( "H" ) ) { } else { return false ; } second = ac . getConnectedAtomsList ( firstAtom ) ; if ( second . size ( ) > 0 ) { for ( int b = 0 ; b < second . size ( ) ; b ++ ) { IAtom secondAtom = ( IAtom ) second . get ( b ) ; if ( secondAtom . getSymbol ( ) . equals ( "C" ) || secondAtom . getSymbol ( ) . equals ( "H" ) ) { } else { return false ; } third = ac . getConnectedAtomsList ( secondAtom ) ; if ( third . size ( ) > 0 ) { for ( int c = 0 ; c < third . size ( ) ; c ++ ) { IAtom thirdAtom = ( IAtom ) third . get ( c ) ; if ( thirdAtom . getSymbol ( ) . equals ( "C" ) || thirdAtom . getSymbol ( ) . equals ( "H" ) ) { } else { return false ; } } } else { return false ; } } } else { return false ; } } } else { return false ; } return true ; } | Gets the ifCarbonIsHydrophobic attribute of the XLogPDescriptor object . C must be sp2 or sp3 and for all distances C - 1 - 2 - 3 only C atoms are permitted |
28,177 | public void setParameters ( Object [ ] params ) throws CDKException { if ( params . length > 2 ) throw new CDKException ( "MMElementRule only expects maximal two parameters" ) ; if ( params [ 0 ] != null ) { if ( ! ( params [ 0 ] instanceof Database ) ) throw new CDKException ( "The parameter must be of type Database enum" ) ; databaseUsed = ( Database ) params [ 0 ] ; } if ( params . length > 1 && params [ 1 ] != null ) { if ( ! ( params [ 1 ] instanceof RangeMass ) ) throw new CDKException ( "The parameter must be of type RangeMass enum" ) ; rangeMassUsed = ( RangeMass ) params [ 1 ] ; } if ( ( databaseUsed == Database . DNP ) && ( rangeMassUsed == RangeMass . Minus500 ) ) this . hashMap = getDNP_500 ( ) ; else if ( ( databaseUsed == Database . DNP ) && ( rangeMassUsed == RangeMass . Minus1000 ) ) this . hashMap = getDNP_1000 ( ) ; else if ( ( databaseUsed == Database . DNP ) && ( rangeMassUsed == RangeMass . Minus2000 ) ) this . hashMap = getDNP_2000 ( ) ; else if ( ( databaseUsed == Database . DNP ) && ( rangeMassUsed == RangeMass . Minus3000 ) ) this . hashMap = getDNP_3000 ( ) ; else if ( ( databaseUsed == Database . WILEY ) && ( rangeMassUsed == RangeMass . Minus500 ) ) this . hashMap = getWisley_500 ( ) ; else if ( ( databaseUsed == Database . WILEY ) && ( rangeMassUsed == RangeMass . Minus1000 ) ) this . hashMap = getWisley_1000 ( ) ; else if ( ( databaseUsed == Database . WILEY ) && ( rangeMassUsed == RangeMass . Minus2000 ) ) this . hashMap = getWisley_2000 ( ) ; } | Sets the parameters attribute of the MMElementRule object . |
28,178 | public Object [ ] getParameters ( ) { Object [ ] params = new Object [ 2 ] ; params [ 0 ] = databaseUsed ; params [ 1 ] = rangeMassUsed ; return params ; } | Gets the parameters attribute of the MMElementRule object . |
28,179 | private HashMap < String , Integer > getDNP_500 ( ) { HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ; map . put ( "C" , 29 ) ; map . put ( "H" , 72 ) ; map . put ( "N" , 10 ) ; map . put ( "O" , 18 ) ; map . put ( "P" , 4 ) ; map . put ( "S" , 7 ) ; map . put ( "F" , 15 ) ; map . put ( "Cl" , 8 ) ; map . put ( "Br" , 5 ) ; return map ; } | Get the map linking the symbol of the element and number maximum of occurrence . For the analysis with the DNP database and mass lower than 500 Da . |
28,180 | private HashMap < String , Integer > getDNP_1000 ( ) { HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ; map . put ( "C" , 66 ) ; map . put ( "H" , 126 ) ; map . put ( "N" , 25 ) ; map . put ( "O" , 27 ) ; map . put ( "P" , 6 ) ; map . put ( "S" , 8 ) ; map . put ( "F" , 16 ) ; map . put ( "Cl" , 11 ) ; map . put ( "Br" , 8 ) ; return map ; } | Get the map linking the symbol of the element and number maximum of occurrence . For the analysis with the DNP database and mass lower than 1000 Da . |
28,181 | private HashMap < String , Integer > getDNP_2000 ( ) { HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ; map . put ( "C" , 115 ) ; map . put ( "H" , 236 ) ; map . put ( "N" , 32 ) ; map . put ( "O" , 63 ) ; map . put ( "P" , 6 ) ; map . put ( "S" , 8 ) ; map . put ( "F" , 16 ) ; map . put ( "Cl" , 11 ) ; map . put ( "Br" , 8 ) ; return map ; } | Get the map linking the symbol of the element and number maximum of occurrence . For the analysis with the DNP database and mass lower than 2000 Da . |
28,182 | private HashMap < String , Integer > getDNP_3000 ( ) { HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ; map . put ( "C" , 162 ) ; map . put ( "H" , 208 ) ; map . put ( "N" , 48 ) ; map . put ( "O" , 78 ) ; map . put ( "P" , 6 ) ; map . put ( "S" , 9 ) ; map . put ( "F" , 16 ) ; map . put ( "Cl" , 11 ) ; map . put ( "Br" , 8 ) ; return map ; } | Get the map linking the symbol of the element and number maximum of occurrence . For the analysis with the DNP database and mass lower than 3000 Da . |
28,183 | private HashMap < String , Integer > getWisley_500 ( ) { HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ; map . put ( "C" , 39 ) ; map . put ( "H" , 72 ) ; map . put ( "N" , 20 ) ; map . put ( "O" , 20 ) ; map . put ( "P" , 9 ) ; map . put ( "S" , 10 ) ; map . put ( "F" , 16 ) ; map . put ( "Cl" , 10 ) ; map . put ( "Br" , 4 ) ; map . put ( "Si" , 8 ) ; return map ; } | Get the map linking the symbol of the element and number maximum of occurrence . For the analysis with the Wisley database and mass lower than 500 Da . |
28,184 | private HashMap < String , Integer > getWisley_1000 ( ) { HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ; map . put ( "C" , 78 ) ; map . put ( "H" , 126 ) ; map . put ( "N" , 20 ) ; map . put ( "O" , 27 ) ; map . put ( "P" , 9 ) ; map . put ( "S" , 14 ) ; map . put ( "F" , 34 ) ; map . put ( "Cl" , 12 ) ; map . put ( "Br" , 8 ) ; map . put ( "Si" , 14 ) ; return map ; } | Get the map linking the symbol of the element and number maximum of occurrence . For the analysis with the Wisley database and mass lower than 1000 Da . |
28,185 | private HashMap < String , Integer > getWisley_2000 ( ) { HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ; map . put ( "C" , 156 ) ; map . put ( "H" , 180 ) ; map . put ( "N" , 20 ) ; map . put ( "O" , 40 ) ; map . put ( "P" , 9 ) ; map . put ( "S" , 14 ) ; map . put ( "F" , 48 ) ; map . put ( "Cl" , 12 ) ; map . put ( "Br" , 10 ) ; map . put ( "Si" , 15 ) ; return map ; } | Get the map linking the symbol of the element and number maximum of occurrence . For the analysis with the Wisley database and mass lower than 2000 Da . |
28,186 | public void setMonoIsotope ( IsotopeContainer isoContainer ) { if ( ! isotopeCList . contains ( isoContainer ) ) isotopeCList . add ( isoContainer ) ; monoIsotopePosition = isotopeCList . indexOf ( isoContainer ) ; } | Set the mono isotope object . Adds the isoContainer to the isotope pattern if it is not already added . |
28,187 | public int compare ( IAtomContainer a , IAtomContainer b ) { Point2d p1 = center ( a ) ; Point2d p2 = center ( b ) ; if ( p1 . x > p2 . x ) return + 1 ; if ( p1 . x < p2 . x ) return - 1 ; if ( p1 . y > p2 . y ) return + 1 ; if ( p1 . y < p2 . y ) return - 1 ; return 0 ; } | Compare two AtomContainers based on their 2D position . |
28,188 | public void placeRing ( IRing ring , Point2d ringCenter , double bondLength , Map < Integer , Double > startAngles ) { double radius = this . getNativeRingRadius ( ring , bondLength ) ; double addAngle = 2 * Math . PI / ring . getRingSize ( ) ; IAtom startAtom = ring . getAtom ( 0 ) ; Point2d p = new Point2d ( ringCenter . x + radius , ringCenter . y ) ; startAtom . setPoint2d ( p ) ; double startAngle = Math . PI * 0.5 ; int ringSize = ring . getRingSize ( ) ; if ( startAngles . get ( ringSize ) != null ) startAngle = startAngles . get ( ringSize ) ; List < IBond > bonds = ring . getConnectedBondsList ( startAtom ) ; Vector < IAtom > atomsToDraw = new Vector < IAtom > ( ) ; IAtom currentAtom = startAtom ; IBond currentBond = ( IBond ) bonds . get ( 0 ) ; for ( int i = 0 ; i < ring . getBondCount ( ) ; i ++ ) { currentBond = ring . getNextBond ( currentBond , currentAtom ) ; currentAtom = currentBond . getOther ( currentAtom ) ; atomsToDraw . addElement ( currentAtom ) ; } atomPlacer . populatePolygonCorners ( atomsToDraw , ringCenter , startAngle , addAngle , radius ) ; } | Place ring with user provided angles . |
28,189 | public IAtomContainer placeRingSubstituents ( IRingSet rs , double bondLength ) { logger . debug ( "RingPlacer.placeRingSubstituents() start" ) ; IRing ring = null ; IAtom atom = null ; IRingSet rings = null ; IAtomContainer unplacedPartners = rs . getBuilder ( ) . newInstance ( IAtomContainer . class ) ; IAtomContainer sharedAtoms = rs . getBuilder ( ) . newInstance ( IAtomContainer . class ) ; IAtomContainer primaryAtoms = rs . getBuilder ( ) . newInstance ( IAtomContainer . class ) ; IAtomContainer treatedAtoms = rs . getBuilder ( ) . newInstance ( IAtomContainer . class ) ; Point2d centerOfRingGravity = null ; for ( int j = 0 ; j < rs . getAtomContainerCount ( ) ; j ++ ) { ring = ( IRing ) rs . getAtomContainer ( j ) ; for ( int k = 0 ; k < ring . getAtomCount ( ) ; k ++ ) { unplacedPartners . removeAllElements ( ) ; sharedAtoms . removeAllElements ( ) ; primaryAtoms . removeAllElements ( ) ; atom = ring . getAtom ( k ) ; rings = rs . getRings ( atom ) ; centerOfRingGravity = GeometryUtil . get2DCenter ( rings ) ; atomPlacer . partitionPartners ( atom , unplacedPartners , sharedAtoms ) ; atomPlacer . markNotPlaced ( unplacedPartners ) ; try { for ( int f = 0 ; f < unplacedPartners . getAtomCount ( ) ; f ++ ) { logger . debug ( "placeRingSubstituents->unplacedPartners: " + ( molecule . indexOf ( unplacedPartners . getAtom ( f ) ) + 1 ) ) ; } } catch ( Exception exc ) { } treatedAtoms . add ( unplacedPartners ) ; if ( unplacedPartners . getAtomCount ( ) > 0 ) { atomPlacer . distributePartners ( atom , sharedAtoms , centerOfRingGravity , unplacedPartners , bondLength ) ; } } } logger . debug ( "RingPlacer.placeRingSubstituents() end" ) ; return treatedAtoms ; } | Positions the aliphatic substituents of a ring system |
28,190 | public void placeSpiroRing ( IRing ring , IAtomContainer sharedAtoms , Point2d sharedAtomsCenter , Vector2d ringCenterVector , double bondLength ) { IAtom startAtom = sharedAtoms . getAtom ( 0 ) ; List < IBond > mBonds = molecule . getConnectedBondsList ( sharedAtoms . getAtom ( 0 ) ) ; final int degree = mBonds . size ( ) ; logger . debug ( "placeSpiroRing: D=" , degree ) ; if ( degree != 4 ) { int numPlaced = 0 ; for ( IBond bond : mBonds ) { IAtom nbr = bond . getOther ( sharedAtoms . getAtom ( 0 ) ) ; if ( ! nbr . getFlag ( CDKConstants . ISPLACED ) ) continue ; numPlaced ++ ; } if ( numPlaced == 2 ) { startAtom . getPoint2d ( ) . add ( ringCenterVector ) ; sharedAtomsCenter . add ( ringCenterVector ) ; } double theta = Math . PI - ( 2 * Math . PI / ( degree / 2 ) ) ; rotate ( ringCenterVector , theta ) ; } double radius = getNativeRingRadius ( ring , bondLength ) ; Point2d ringCenter = new Point2d ( sharedAtomsCenter ) ; if ( degree == 4 ) { ringCenterVector . normalize ( ) ; ringCenterVector . scale ( radius ) ; } else { ringCenterVector . normalize ( ) ; ringCenterVector . scale ( 2 * radius ) ; } ringCenter . add ( ringCenterVector ) ; double addAngle = 2 * Math . PI / ring . getRingSize ( ) ; IAtom currentAtom = startAtom ; double startAngle = GeometryUtil . getAngle ( startAtom . getPoint2d ( ) . x - ringCenter . x , startAtom . getPoint2d ( ) . y - ringCenter . y ) ; List rBonds = ring . getConnectedBondsList ( startAtom ) ; IBond currentBond = ( IBond ) rBonds . get ( 0 ) ; Vector atomsToDraw = new Vector ( ) ; for ( int i = 0 ; i < ring . getBondCount ( ) ; i ++ ) { currentBond = ring . getNextBond ( currentBond , currentAtom ) ; currentAtom = currentBond . getOther ( currentAtom ) ; if ( ! currentAtom . equals ( startAtom ) ) atomsToDraw . addElement ( currentAtom ) ; } logger . debug ( "currentAtom " + currentAtom ) ; logger . debug ( "startAtom " + startAtom ) ; atomPlacer . populatePolygonCorners ( atomsToDraw , ringCenter , startAngle , addAngle , radius ) ; } | Generated coordinates for a given ring which is connected to a spiro ring . The rings share exactly one atom . |
28,191 | boolean completePartiallyPlacedRing ( IRingSet rset , IRing ring , double bondLength ) { if ( ring . getFlag ( CDKConstants . ISPLACED ) ) return true ; IRing partiallyPlacedRing = molecule . getBuilder ( ) . newInstance ( IRing . class ) ; for ( IAtom atom : ring . atoms ( ) ) if ( atom . getPoint2d ( ) != null ) atom . setFlag ( CDKConstants . ISPLACED , true ) ; AtomPlacer . copyPlaced ( partiallyPlacedRing , ring ) ; if ( partiallyPlacedRing . getAtomCount ( ) > 1 && partiallyPlacedRing . getAtomCount ( ) < ring . getAtomCount ( ) ) { placeConnectedRings ( rset , partiallyPlacedRing , RingPlacer . FUSED , bondLength ) ; placeConnectedRings ( rset , partiallyPlacedRing , RingPlacer . BRIDGED , bondLength ) ; placeConnectedRings ( rset , partiallyPlacedRing , RingPlacer . SPIRO , bondLength ) ; ring . setFlag ( CDKConstants . ISPLACED , true ) ; return true ; } else { return false ; } } | Completes the layout of a partially laid out ring . |
28,192 | private static Point2d getMidPoint ( Tuple2d a , Tuple2d b ) { return new Point2d ( ( a . x + b . x ) / 2 , ( a . y + b . y ) / 2 ) ; } | Get the middle of two provide points . |
28,193 | private static Vector2d getPerpendicular ( Tuple2d a , Tuple2d b , Vector2d ref ) { final Vector2d pVec = new Vector2d ( - ( a . y - b . y ) , a . x - b . x ) ; if ( pVec . dot ( ref ) < 0 ) pVec . negate ( ) ; return pVec ; } | Gat a vector perpendicular to the line a - b that is pointing the same direction as ref . |
28,194 | public boolean allPlaced ( IRingSet rs ) { for ( int i = 0 ; i < rs . getAtomContainerCount ( ) ; i ++ ) { if ( ! ( ( IRing ) rs . getAtomContainer ( i ) ) . getFlag ( CDKConstants . ISPLACED ) ) { return false ; } } return true ; } | True if coordinates have been assigned to all atoms in all rings . |
28,195 | public void checkAndMarkPlaced ( IRingSet rs ) { IRing ring = null ; boolean allPlaced = true ; boolean ringsetPlaced = true ; for ( int i = 0 ; i < rs . getAtomContainerCount ( ) ; i ++ ) { ring = ( IRing ) rs . getAtomContainer ( i ) ; allPlaced = true ; for ( int j = 0 ; j < ring . getAtomCount ( ) ; j ++ ) { if ( ! ( ( IAtom ) ring . getAtom ( j ) ) . getFlag ( CDKConstants . ISPLACED ) ) { allPlaced = false ; ringsetPlaced = false ; break ; } } ring . setFlag ( CDKConstants . ISPLACED , allPlaced ) ; } rs . setFlag ( CDKConstants . ISPLACED , ringsetPlaced ) ; } | Walks throught the atoms of each ring in a ring set and marks a ring as PLACED if all of its atoms have been placed . |
28,196 | private IAtom [ ] getBridgeAtoms ( IAtomContainer sharedAtoms ) { IAtom [ ] bridgeAtoms = new IAtom [ 2 ] ; IAtom atom ; int counter = 0 ; for ( int f = 0 ; f < sharedAtoms . getAtomCount ( ) ; f ++ ) { atom = sharedAtoms . getAtom ( f ) ; if ( sharedAtoms . getConnectedAtomsList ( atom ) . size ( ) == 1 ) { bridgeAtoms [ counter ] = atom ; counter ++ ; } } return bridgeAtoms ; } | Returns the bridge atoms that is the outermost atoms in the chain of more than two atoms which are shared by two rings |
28,197 | public void partitionNonRingPartners ( IAtom atom , IRing ring , IAtomContainer ringAtoms , IAtomContainer nonRingAtoms ) { List atoms = molecule . getConnectedAtomsList ( atom ) ; for ( int i = 0 ; i < atoms . size ( ) ; i ++ ) { IAtom curAtom = ( IAtom ) atoms . get ( i ) ; if ( ! ring . contains ( curAtom ) ) { nonRingAtoms . addAtom ( curAtom ) ; } else { ringAtoms . addAtom ( curAtom ) ; } } } | Partition the bonding partners of a given atom into ring atoms and non - ring atoms |
28,198 | Vector2d getRingCenterOfFirstRing ( IRing ring , Vector2d bondVector , double bondLength ) { int size = ring . getAtomCount ( ) ; double radius = bondLength / ( 2 * Math . sin ( ( Math . PI ) / size ) ) ; double newRingPerpendicular = Math . sqrt ( Math . pow ( radius , 2 ) - Math . pow ( bondLength / 2 , 2 ) ) ; double rotangle = GeometryUtil . getAngle ( bondVector . x , bondVector . y ) ; rotangle += Math . PI / 2 ; return new Vector2d ( Math . cos ( rotangle ) * newRingPerpendicular , Math . sin ( rotangle ) * newRingPerpendicular ) ; } | Calculated the center for the first ring so that it can layed out . Only then all other rings can be assigned coordinates relative to it . |
28,199 | AtomSymbol generateSymbol ( IAtomContainer container , IAtom atom , HydrogenPosition position , RendererModel model ) { if ( atom instanceof IPseudoAtom ) { IPseudoAtom pAtom = ( IPseudoAtom ) atom ; if ( pAtom . getAttachPointNum ( ) <= 0 ) { if ( pAtom . getLabel ( ) . equals ( "*" ) ) { int mass = unboxSafely ( pAtom . getMassNumber ( ) , 0 ) ; int charge = unboxSafely ( pAtom . getFormalCharge ( ) , 0 ) ; int hcnt = unboxSafely ( pAtom . getImplicitHydrogenCount ( ) , 0 ) ; int nrad = container . getConnectedSingleElectronsCount ( atom ) ; if ( mass != 0 || charge != 0 || hcnt != 0 ) { return generatePeriodicSymbol ( 0 , hcnt , mass , charge , nrad , position ) ; } } return generatePseudoSymbol ( accessPseudoLabel ( pAtom , "?" ) , position ) ; } else return null ; } else { int number = unboxSafely ( atom . getAtomicNumber ( ) , Elements . ofString ( atom . getSymbol ( ) ) . number ( ) ) ; Integer mass = atom . getMassNumber ( ) ; if ( number != 0 && mass != null && model != null && model . get ( StandardGenerator . OmitMajorIsotopes . class ) && isMajorIsotope ( number , mass ) ) { mass = null ; } return generatePeriodicSymbol ( number , unboxSafely ( atom . getImplicitHydrogenCount ( ) , 0 ) , unboxSafely ( mass , - 1 ) , unboxSafely ( atom . getFormalCharge ( ) , 0 ) , container . getConnectedSingleElectronsCount ( atom ) , position ) ; } } | Generate the displayed atom symbol for an atom in given structure with the specified hydrogen position . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.