📄 xlogpdescriptor.java
字号:
//AtomContainer aminoacid = sp.parseSmiles("NCC(=O)O"); if (UniversalIsomorphismTester.isSubgraph((org.openscience.cdk.AtomContainer)ac, aminoAcid)) { List list = UniversalIsomorphismTester.getSubgraphAtomsMap((org.openscience.cdk.AtomContainer)ac, aminoAcid); RMap map = null; IAtom atom1=null; for (int j = 0; j < list.size(); j++){ map = (RMap) list.get(j); atom1 = ac.getAtom(map.getId1()); if (atom1.getSymbol().equals("O")&& ac.getMaximumBondOrder(atom1)==1){ if (ac.getConnectedBondsCount(atom1)==2 && getHydrogenCount(ac, atom1)==0){ }else{ xlogP -= 2.166; //logger.debug("XLOGP: alpha amino acid -2.166"); break; } } } } } IAtomContainer paba = createPaba(ac.getBuilder()); // p-amino sulphonic acid if (UniversalIsomorphismTester.isSubgraph((org.openscience.cdk.AtomContainer)ac, paba)) { xlogP -= 0.501; //logger.debug("XLOGP: p-amino sulphonic acid -0.501"); } // salicylic acid if (salicylFlag){ IAtomContainer salicilic = createSalicylicAcid(ac.getBuilder()); if (UniversalIsomorphismTester.isSubgraph((org.openscience.cdk.AtomContainer)ac, salicilic)) { xlogP += 0.554; //logger.debug("XLOGP: salicylic acid 0.554"); } }// ortho oxygen pair //AtomContainer orthopair = sp.parseSmiles("OCCO"); QueryAtomContainer orthopair=new QueryAtomContainer(); AromaticAtom atom1=new AromaticAtom(); atom1.setSymbol("C"); AromaticAtom atom2=new AromaticAtom(); atom2.setSymbol("C"); SymbolQueryAtom atom3=new SymbolQueryAtom(); atom3.setSymbol("O"); SymbolQueryAtom atom4=new SymbolQueryAtom(); atom4.setSymbol("O"); orthopair.addBond(new AromaticQueryBond(atom1,atom2,1.5)); orthopair.addBond(new OrderQueryBond(atom1,atom3,1)); orthopair.addBond(new OrderQueryBond(atom2,atom4,1)); if (UniversalIsomorphismTester.isSubgraph((org.openscience.cdk.AtomContainer)ac, orthopair)) { xlogP -= 0.268; //logger.debug("XLOGP: Ortho oxygen pair -0.268"); } return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(xlogP), new String[] {"XLogP"}); } /** * Returns the specific type of the DescriptorResult object. * <p/> * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ public IDescriptorResult getDescriptorResultType() { return new DoubleResult(0.0); } /** * Method initialise the HydrogenpairCheck with a value * * @param pairCheck value * @return void */ public 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; } /** * Check if atom or neighbour atom is part of a ring * *@param ac Description of the Parameter *@param atom Description of the Parameter *@return The hydrogenCount value */ private boolean checkRingLink(IRingSet ringSet, org.openscience.cdk.interfaces.IAtomContainer ac, org.openscience.cdk.interfaces.IAtom atom) { java.util.List neighbours = ac.getConnectedAtomsList(atom); if (ringSet.contains(atom)){ return true; } for (int i = 0; i < neighbours.size(); i++) { IAtom neighbour = (IAtom)neighbours.get(i); if (ringSet.contains(neighbour)) { return true; } } return false; } /** * Gets the hydrogenCount attribute of the XLogPDescriptor object. * *@param ac Description of the Parameter *@param atom Description of the Parameter *@return The hydrogenCount value */ private int getHydrogenCount(IAtomContainer ac, org.openscience.cdk.interfaces.IAtom atom) { java.util.List neighbours = ac.getConnectedAtomsList(atom); int hcounter = 0; for (int i = 0; i < neighbours.size(); i++) { IAtom neighbour = (IAtom)neighbours.get(i); if (neighbour.getSymbol().equals("H")) { hcounter += 1; } } return hcounter; } /** * Gets the HalogenCount attribute of the XLogPDescriptor object. * *@param ac Description of the Parameter *@param atom Description of the Parameter *@return The alogenCount value */ private int getHalogenCount(IAtomContainer ac, org.openscience.cdk.interfaces.IAtom atom) { java.util.List neighbours = ac.getConnectedAtomsList(atom); int acounter = 0; for (int i = 0; i < neighbours.size(); i++) { IAtom neighbour = (IAtom)neighbours.get(i); if (neighbour.getSymbol().equals("F") || neighbour.getSymbol().equals("I") || neighbour.getSymbol().equals("Cl") || neighbour.getSymbol().equals("Br")) { acounter += 1; } } return acounter; } /** * Gets the atomType X Count attribute of the XLogPDescriptor object. * *@param ac Description of the Parameter *@param atom Description of the Parameter *@return The nitrogenOrOxygenCount value */ private int getAtomTypeXCount(IAtomContainer ac, org.openscience.cdk.interfaces.IAtom atom) { java.util.List neighbours = ac.getConnectedAtomsList(atom); int nocounter = 0; IBond bond=null; for (int i = 0; i < neighbours.size(); i++) { IAtom neighbour = (IAtom)neighbours.get(i); if ((neighbour.getSymbol().equals("N") || neighbour.getSymbol().equals("O")) && !((Boolean)neighbour.getProperty("IS_IN_AROMATIC_RING")).booleanValue()) { //if (ac.getMaximumBondOrder(neighbours[i]) == 1.0) { bond = ac.getBond(neighbour, atom); if (bond.getOrder() != 2.0) { nocounter += 1; } } } return nocounter; } /** * Gets the aromaticCarbonsCount attribute of the XLogPDescriptor object. * *@param ac Description of the Parameter *@param atom Description of the Parameter *@return The aromaticCarbonsCount value */ private int getAromaticCarbonsCount(IAtomContainer ac, org.openscience.cdk.interfaces.IAtom atom) { java.util.List neighbours = ac.getConnectedAtomsList(atom); int carocounter = 0; for (int i = 0; i < neighbours.size(); i++) { IAtom neighbour = (IAtom)neighbours.get(i); if (neighbour.getSymbol().equals("C") && neighbour.getFlag(CDKConstants.ISAROMATIC)) { carocounter += 1; } } return carocounter; } /** * Gets the carbonsCount attribute of the XLogPDescriptor object. * *@param ac Description of the Parameter *@param atom Description of the Parameter *@return The carbonsCount value */ private int getCarbonsCount(IAtomContainer ac, org.openscience.cdk.interfaces.IAtom atom) { java.util.List neighbours = ac.getConnectedAtomsList(atom); int ccounter = 0; for (int i = 0; i < neighbours.size(); i++) { IAtom neighbour = (IAtom)neighbours.get(i); if (neighbour.getSymbol().equals("C")) { if (!neighbour.getFlag(CDKConstants.ISAROMATIC)) { ccounter += 1; } } } return ccounter; } /** * Gets the oxygenCount attribute of the XLogPDescriptor object. * *@param ac Description of the Parameter *@param atom Description of the Parameter *@return The carbonsCount value */ private int getOxygenCount(IAtomContainer ac, org.openscience.cdk.interfaces.IAtom atom) { java.util.List neighbours = ac.getConnectedAtomsList(atom); int ocounter = 0; for (int i = 0; i < neighbours.size(); i++) { IAtom neighbour = (IAtom)neighbours.get(i); if (neighbour.getSymbol().equals("O")) { if (!neighbour.getFlag(CDKConstants.ISAROMATIC)) { ocounter += 1; } } } return ocounter; } /** * Gets the doubleBondedCarbonsCount attribute of the XLogPDescriptor object. * *@param ac Description of the Parameter *@param atom Description of the Parameter *@return The doubleBondedCarbonsCount value */ private int getDoubleBondedCarbonsCount(IAtomContainer ac, org.openscience.cdk.interfaces.IAtom atom) { java.util.List neighbours = ac.getConnectedAtomsList(atom); IBond bond = null; int cdbcounter = 0; for (int i = 0; i < neighbours.size(); i++) { IAtom neighbour = (IAtom)neighbours.get(i); if (neighbour.getSymbol().equals("C")) { bond = ac.getBond(neighbour, atom); if (bond.getOrder() == 2.0) { cdbcounter += 1; } } } return cdbcounter; } /** * Gets the doubleBondedOxygenCount attribute of the XLogPDescriptor object. * *@param ac Description of the Parameter *@param atom Description of the Parameter *@return The doubleBondedOxygenCount value */ private int getDoubleBondedOxygenCount(IAtomContainer ac, org.openscience.cdk.interfaces.IAtom atom) { java.util.List neighbours = ac.getConnectedAtomsList(atom); IBond bond = null; int odbcounter = 0; boolean chargeFlag=false; if (atom.getFormalCharge()>=1){ chargeFlag=true; } for (int i = 0; i < neighbours.size(); i++) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -