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 = graph... | 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 bondB... | 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 ( ) ; } i... | 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 ) , s... | 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 ) ) t... | 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 <= ... | 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 . p... | 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 ex... | 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 ( ) ) { i... | 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 ... | 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 = (... | 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 ( ... | 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 ol... | 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 ( firs... | 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 ( currentB... | 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 = ( Integ... | 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 LoneP... | 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... | 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" ; els... | 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 ... | 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 ]... | 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 sto... | 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 . O... | 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 ( ... | 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 ) {... | 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 ... | 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 ( n... | 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 ) { It... | 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 ( ) ) ;... | 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 / ... | 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... | 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 ) ... | 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 += ... | 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 ; } ... | 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 ; } }... | 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... | 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 ( neighbou... | 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 . g... | 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 ( ! n... | 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" ) ) { n... | 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 ) ... | 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... | 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 ( "... | 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 . getSy... | 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 e... | 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" , ... | 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" ... | 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"... | 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"... | 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... | 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 ( "... | 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 ( ... | 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 ( ringCent... | 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 ) ; IAtomContaine... | 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... | 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... | 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 ( !... | 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 ) { bridgeAtom... | 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 ) ) { nonR... | 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 ) ) ; doubl... | 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 ( pAto... | 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.