⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ipatomicdescriptor.java

📁 化学图形处理软件
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
		          {
		            if (EE <= 3.795813) { result = 09.3; /* 2.0/1.0 */}
		            else if (EE > 3.795813) { result = 10.0; /* 5.0/3.0 */}
		          }
		        }
		      }
		      if (EE > 4.0805)
		      {
		        if (SCH <= -0.382949)
		        {
		          if (PE <= 3.172064)
		          {
		            if (EE <= 4.509125) { result = 09.8; /* 5.0/2.0 */}
		            else if (EE > 4.509125) { result = 09.7; /* 3.0 */}
		          }
		          if (PE > 3.172064)
		          {
		            if (SCH <= -0.388693)
		            {
		              if (SE <= 9.323245) { result = 09.6; /* 2.0 */}
		              else if (SE > 9.323245)
		              {
		                if (EE <= 4.509125) { result = 09.5; /* 2.0 */}
		                else if (EE > 4.509125) { result = 09.9; /* 4.0/2.0 */}
		              }
		            }
		            if (SCH > -0.388693) { result = 09.7; /* 2.0 */}
		          }
		        }
		        if (SCH > -0.382949)
		        {
		          if (SCH <= -0.371513) { result = 09.6; /* 4.0/2.0 */}
		          else if (SCH > -0.371513) { result = 09.4; /* 3.0/2.0 */}
		        }
		      }
		    }
		    if (EE > 4.862859)
		    {
		      if (SE <= 9.561631)
		      {
		        if (EE <= 6.120359)
		        {
		          if (SCH <= -0.389218)
		          {
		            if (EE <= 5.2105)
		            {
		              if (SE <= 9.325385) { result = 09.2; /* 2.0/1.0 */}
		              else if (SE > 9.325385) { result = 09.1; /* 5.0/3.0 */}
		            }
		            if (EE > 5.2105)
		            {
		              if (EE <= 5.422063) { result = 09.0; /* 2.0/1.0 */}
		              else if (EE > 5.422063)
		              {
		                if (EE <= 5.559375) { result = 09.6; /* 3.0/1.0 */}
		                else if (EE > 5.559375) { result = 09.0; /* 2.0/1.0 */}
		              }
		            }
		          }
		          if (SCH > -0.389218)
		          {
		            if (EE <= 5.64575)
		            {
		              if (EE <= 5.295125) { result = 09.4; /* 9.0/5.0 */}
		              else if (EE > 5.295125) { result = 09.2; /* 6.0/3.0 */}
		            }
		            if (EE > 5.64575)
		            {
		              if (EE <= 5.87375)
		              {
		                if (SCH <= -0.38064) { result = 09.3; /* 5.0/1.0 */}
		                else if (SCH > -0.38064) { result = 09.4; /* 4.0/2.0 */}
		              }
		              if (EE > 5.87375)
		              {
		                if (EE <= 6.050813) { result = 09.2; /* 2.0 */}
		                else if (EE > 6.050813) { result = 09.3; /* 3.0/1.0 */}
		              }
		            }
		          }
		        }
		        if (EE > 6.120359)
		        {
		          if (SCH <= -0.387072) { result = 09.4; /* 2.0 */}
		          else if (SCH > -0.387072)
		          {
		            if (SE <= 9.208068) { result = 09.3; /* 2.0/1.0 */}
		            else if (SE > 9.208068)
		            {
		              if (EE <= 8.617)
		              {
		                if (SCH <= -0.374181)
		                {
		                  if (EE <= 6.764188) { result = 09.2; /* 11.0/4.0 */}
		                  else if (EE > 6.764188) { result = 09.1; /* 7.0/2.0 */}
		                }
		                if (SCH > -0.374181) { result = 09.2; /* 4.0 */}
		              }
		              if (EE > 8.617) { result = 09.1; /* 5.0 */}
		            }
		          }
		        }
		      }
		      if (SE > 9.561631)
		      {
		        if (EE <= 7.141875)
		        {
		          if (SCH <= -0.143549)
		          {
		            if (EE <= 5.479375) { result = 09.8; /* 3.0/2.0 */}
		            else if (EE > 5.479375)
		            {
		              if (EE <= 5.709125) { result = 09.0; /* 2.0 */}
		              else if (EE > 5.709125) { result = 09.3; /* 2.0/1.0 */}
		            }
		          }
		          if (SCH > -0.143549)
		          {
		            if (SCH <= -0.139872)
		            {
		              if (EE <= 6.331813) { result = 10.1; /* 4.0/1.0 */}
		              else if (EE > 6.331813) { result = 10.0; /* 7.0/3.0 */}
		            }
		            if (SCH > -0.139872) { result = 09.9; /* 4.0/1.0 */}
		          }
		        }
		        if (EE > 7.141875)
		        {
		          if (SE <= 10.155788)
		          {
		            if (SE <= 10.12694) { result = 08.8; /* 2.0/1.0 */}
		            else if (SE > 10.12694) { result = 09.7; /* 3.0/1.0 */}
		          }
		          if (SE > 10.155788) { result = 09.2; /* 4.0/2.0 */}
		        }
		      }
		    }
		  }
		  if (PE > 4.260194)
		  {
		    if (EE <= 6.19275)
		    {
		      if (EE <= 5.2105)
		      {
		        if (SE <= 10.475336) { result = 10.8; /* 3.0/1.0 */}
		        else if (SE > 10.475336) { result = 10.2; /* 4.0/2.0 */}
		      }
		      if (EE > 5.2105)
		      {
		        if (EE <= 5.39475)
		        {
		          if (SE <= 10.47544) { result = 10.1; /* 2.0 */}
		          else if (SE > 10.47544) { result = 10.7; /* 2.0 */}
		        }
		        if (EE > 5.39475)
		        {
		          if (SE <= 10.510052) { result = 09.7; /* 2.0/1.0 */}
		          else if (SE > 10.510052) { result = 10.1; /* 2.0/1.0 */}
		        }
		      }
		    }
		    if (EE > 6.19275)
		    {
		      if (SCH <= -0.080603) { result = 09.0; /* 6.0/1.0 */}
		      else if (SCH > -0.080603)
		      {
		        if (SE <= 9.271976) { result = 08.9; /* 6.0/1.0 */}
		        else if (SE > 9.271976) { result = 08.7; /* 3.0 */}
		      }
		    }
		  }
		}
		return result;
	}
	/**
	 * Get the reactions obtained with ionization.
	 * The energy is set as property
	 * 
	 * @return The IReactionSet value
	 */
	public IReactionSet getReactionSet() throws CDKException{
		return reactionSet;
	}
	/**
	 * Calculate the necessary descriptors for Heteratom atoms
	 * @param atomContainer The IAtomContainer
	 * @return     Array with the values of the descriptors.
	 * @throws CDKException 
	 */
	private double[] calculateHeteroAtomConjugatedDescriptor(IAtom atom, IAtomContainer atomContainer, IAtomContainer conjugatedSys) throws CDKException {
		double[] results = new double[4];
		results[0] = -10.0;
		results[1] = 0.0;
		results[2] = 0.0;
		results[3] = 0.0;
		
		/*calculation of the atomic descriptors*/
		Iterator atomIt = conjugatedSys.atoms();
		while(atomIt.hasNext()){
			IAtom atomsss = (IAtom) atomIt.next();
			
			if(atomContainer.getConnectedLonePairsCount(atomsss) == 0){
				PartialPiChargeDescriptor descriptor1 = new PartialPiChargeDescriptor();
				double result1;
					result1 = ((DoubleResult)descriptor1.calculate(atomsss,atomContainer).getValue()).doubleValue();
				
				if(result1 != 0.0)
				if(result1 > results[0])
					results[0] = result1;
			}else{
				
				PartialPiChargeDescriptor descriptor1 = new PartialPiChargeDescriptor();
				double result1 = ((DoubleResult)descriptor1.calculate(atomsss,atomContainer).getValue()).doubleValue();
				results[1] = result1;
			}
			
			SigmaElectronegativityDescriptor descriptor2 = new SigmaElectronegativityDescriptor();
			double result2 = ((DoubleResult)descriptor2.calculate(atomsss,atomContainer).getValue()).doubleValue();
			results[3] += result2;
			
		}
		/*calculation of the bond descriptors*/
		Iterator bondIt = conjugatedSys.bonds();
		while(bondIt.hasNext()){
			IBond bondsss = (IBond) bondIt.next();
			
			ResonancePositiveChargeDescriptor descriptor5 = new ResonancePositiveChargeDescriptor();
			DoubleArrayResult dar;
			
			dar = ((DoubleArrayResult)descriptor5.calculate(bondsss,atomContainer).getValue());
			double result1 = dar.get(0);
			double resutt2 = dar.get(1);
			double result12 = (result1+resutt2);
			
			double resultT = 0;
			if(result12 != 0)
				resultT = result12/2;
			
			results[2] += resultT;
			
		}
		if(results[2] != 0)
			results[2] = results[1]/conjugatedSys.getAtomCount();
		
		if(results[3] != 0)
			results[3] = results[2]/conjugatedSys.getAtomCount();
		
		
		return results;
    	
	}
	/**
	 * Calculate the necessary descriptors for Heteratom atoms
	 * @param atomContainer The IAtomContainer
	 * @return     Array with the values of the descriptors.
	 * @throws CDKException 
	 */
	private double[] calculateHeteroAtomDescriptor(IAtom atom, IAtomContainer atomContainer) throws CDKException {
		double[] results = new double[4];
		SigmaElectronegativityDescriptor descriptor1 = new SigmaElectronegativityDescriptor();
		PartialSigmaChargeDescriptor descriptor2 = new PartialSigmaChargeDescriptor();
		EffectiveAtomPolarizabilityDescriptor descriptor3 = new EffectiveAtomPolarizabilityDescriptor();
		PiElectronegativityDescriptor descriptor4 = new PiElectronegativityDescriptor();

		results[0]= ((DoubleResult)descriptor1.calculate(atom,atomContainer).getValue()).doubleValue();
		results[1]= ((DoubleResult)descriptor2.calculate(atom,atomContainer).getValue()).doubleValue();
		results[2]= ((DoubleResult)descriptor3.calculate(atom,atomContainer).getValue()).doubleValue();
		results[3]= ((DoubleResult)descriptor4.calculate(atom,atomContainer).getValue()).doubleValue();
    	
		return results;
	}
	/**
	 * Calculate the necessary descriptors for Carbonyl group
	 * @param atomContainer The IAtomContainer
	 * @return     Array with the values of the descriptors.
	 */
	private double[] calculateCarbonylDescriptor(IAtom atom, IAtomContainer atomContainer) {
		
		double[] results = new double[6];
		IAtom positionX = atom;
		IAtom positionC = null; 
		List listAtoms = atomContainer.getConnectedAtomsList(atom);
		for(Iterator it = listAtoms.iterator(); it.hasNext();){
			IAtom atom2 = (IAtom)it.next();
			if(((IBond)atomContainer.getBond(atom, atom2)).getOrder() > 1)
				positionC = atom2;
		}

		IBond bond = atomContainer.getBond(positionX, positionC);
		try {
			AtomContainerSet conjugatedPi = ConjugatedPiSystemsDetector.detect(atomContainer);
			
			if(conjugatedPi.getAtomContainerCount() == 1){
				IAtomContainer conjugatedSy = conjugatedPi.getAtomContainer(0);
				Iterator atomIt = conjugatedSy.atoms();
				while(atomIt.hasNext()){
					IAtom atomsss = (IAtom) atomIt.next();
					if(atomsss.getSymbol().equals("C")){
						PartialPiChargeDescriptor descriptor1 = new PartialPiChargeDescriptor();
						double result1 = ((DoubleResult)descriptor1.calculate(atomsss,atomContainer).getValue()).doubleValue();

						if(result1 > results[1])
							results[1] = result1;
						
						SigmaElectronegativityDescriptor descriptor2 = new SigmaElectronegativityDescriptor();
						double result2 = ((DoubleResult)descriptor2.calculate(atomsss,atomContainer).getValue()).doubleValue();
						results[0] += result2;
					}
				}
				if(results[0] != 0)
					results[0] = results[0]/conjugatedSy.getAtomCount();
				
				if(results[1] != 0)
					results[1] = results[1]/conjugatedSy.getAtomCount();
			}else{
				/* 1 */
				try{
				SigmaElectronegativityDescriptor descriptor1 = new SigmaElectronegativityDescriptor();
				results[0] = ((DoubleResult)descriptor1.calculate(positionC,(IAtomContainer) atomContainer).getValue()).doubleValue();

				}catch(Exception e){
					results[0] = 0.0;
				}
//				System.out.println("symbolC: "+atomContainer.getAtom(positionC).getSymbol());
//				System.out.println("symbolX: "+atomContainer.getAtom(positionX).getSymbol());
				
				/* 2 */
				try{
				PartialPiChargeDescriptor descriptor2 = new PartialPiChargeDescriptor();
				results[1] = ((DoubleResult)descriptor2.calculate(positionC,(IAtomContainer) atomContainer).getValue()).doubleValue();
				}catch(Exception e){
					results[1] = 0.0;
				}
			}
			/* 3 */
			try{
			BondPartialSigmaChargeDescriptor descriptor3 = new BondPartialSigmaChargeDescriptor();
			results[2] = ((DoubleResult)descriptor3.calculate(bond,(IAtomContainer) atomContainer).getValue()).doubleValue();
			}catch(Exception e){
				results[2] = 0.0;
			}
			/* 4 */
			try{
			SigmaElectronegativityDescriptor descriptor4 = new SigmaElectronegativityDescriptor();
			results[3] = ((DoubleResult)descriptor4.calculate(positionX,(IAtomContainer) atomContainer).getValue()).doubleValue();
			}catch(Exception e){
				results[3] = 0.0;
			}
			/* 5 */
			try{
			PartialPiChargeDescriptor descriptor5 = new PartialPiChargeDescriptor();
			results[4] = ((DoubleResult)descriptor5.calculate(positionX,(IAtomContainer) atomContainer).getValue()).doubleValue();
			}catch(Exception e){
				results[4] = 0.0;
			}
			/* 6 */
			try{
			ResonancePositiveChargeDescriptor descriptor6 = new ResonancePositiveChargeDescriptor();
			DoubleArrayResult dar = ((DoubleArrayResult)descriptor6.calculate(bond,atomContainer).getValue());
			double datT =0.0;
			if((new Double(dar.get(0))).toString().equals("Infinity")||
					(new Double(dar.get(1))).toString().equals("Infinity")){}
			else if(dar.get(0) == 0 && dar.get(1) == 0){}
			else
				datT = (dar.get(0)+dar.get(1))/2;
			results[5] = datT;
			}catch(Exception e){
				results[5] = 0.0;
			}
 
		} catch (CDKException e) {
			e.printStackTrace();
		}
		return results;
	}
	 /**
     * Gets the parameterNames attribute of the IPAtomicDescriptor object.
     *
     * @return    The parameterNames value
     */
    public String[] getParameterNames() {
        return new String[0];
    }


    /**
     * Gets the parameterType attribute of the IPAtomicDescriptor object.
     *
     * @param  name  Description of the Parameter
     * @return       An Object of class equal to that of the parameter being requested
     */
    public Object getParameterType(String name) {
        return null;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -