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

📄 bremseronespherehosecodepredictor.java

📁 化学图形处理软件
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
/* $RCSfile$ * $Author: egonw $ * $Date: 2007-01-04 18:46:10 +0100 (Thu, 04 Jan 2007) $ * $Revision: 7636 $ * * Copyright (C) 1997-2007  The Chemistry Development Kit (CDK) project * * Contact: cdk-devel@lists.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. * All we ask is that proper credit is given for our work, which includes * - but is not limited to - adding the above copyright notice to the beginning * of your source code files, and to any copyright notice that you may distribute * with programs based on this work. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * */package org.openscience.cdk.tools;import java.util.Hashtable;import org.openscience.cdk.exception.CDKException;/** * @cdk.keyword HOSE code */public class BremserOneSphereHOSECodePredictor implements java.io.Serializable{    private static final long serialVersionUID = 4382025930031432321L;        Hashtable ht;		public BremserOneSphereHOSECodePredictor()	{		ht = new Hashtable(700);		prepareHashTable();	}		public double predict(String hoseCode) throws CDKException	{		if (!(hoseCode == null) && ht.containsKey(hoseCode))		{			return ((HOSECodeShiftRange)ht.get(hoseCode)).shift;		}		throw new CDKException("No prediction available for HOSE code " +  hoseCode);	}	public String predictFull(String hoseCode) throws CDKException	{		if (!(hoseCode == null) && ht.containsKey(hoseCode))		{			return ((HOSECodeShiftRange)ht.get(hoseCode)).toString();		}		throw new CDKException("No prediction available for HOSE code " +  hoseCode);	}	public double getConfidenceLimit(String hoseCode) throws CDKException	{		if (!(hoseCode == null) && ht.containsKey(hoseCode))		{			return ((HOSECodeShiftRange)ht.get(hoseCode)).confidenceLimit;		}		throw new CDKException("No confidence limit available for HOSE code " +  hoseCode);	}	class HOSECodeShiftRange implements java.io.Serializable	{        private static final long serialVersionUID = 1649047314594679297L;                String code;		double shift;		double confidenceLimit;		String multiplicity;		double maxShift;		double minShift;		int fourSphereCount;		int lineCount;				HOSECodeShiftRange(String c, double s, double conf, String m, double ma, double mi, int f, int l)		{			code = c;			shift = s;			confidenceLimit = conf;			multiplicity = m;			maxShift = ma;			minShift = mi;			fourSphereCount = f;			lineCount = l;		}				public String toString()		{			String s = "delta_C: " + shift + " for code " + code + " with confidence limit " + confidenceLimit;			s += " in shift range " + maxShift + "-" + minShift + ". ";			return s; 		}			}		public String getBibData()	{		String s = "The carbon NMR chemical shift prediction of this module \n";		s += "is based on the 651 1-sphere HOSE-Code table published by W. Bremser in:\n";		s += "W. Bremser, \"Expectation Ranges of 13C NMR Chemical Shifts\", \n";		s += "Mag. Res. Chem., Vol. 23, No. 4, 1985, 271-275.\n";		s += "It is important to understand, that these values are indeed not more than expectation ranges.\n";		return s;	}		private void prepareHashTable()	{		ht.put("%CC$(//)", new HOSECodeShiftRange("%CC$(//)", 79.3, 16.4, "S", 112.7, 54.4, 36, 54));		ht.put("%CC(//)", new HOSECodeShiftRange("%CC(//)", 81.8, 21.2, "S", 144.7, 32.9, 547, 1402));		ht.put("%CO(//)", new HOSECodeShiftRange("%CO(//)", 88.2, 5.0, "S", 88.2, 88.2, 1, 1));		ht.put("%CN(//)", new HOSECodeShiftRange("%CN(//)", 81.4, 5.0, "S", 83.6, 79.3, 2, 2));		ht.put("%CS(//)", new HOSECodeShiftRange("%CS(//)", 80.2, 28.0, "S", 99.8, 68.1, 6, 7));		ht.put("%CP$(//)", new HOSECodeShiftRange("%CP$(//)", 74.8, 5.0, "S", 77.9, 71.2, 8, 10));		ht.put("%CP(//)", new HOSECodeShiftRange("%CP(//)", 77.7, 21.3, "S", 106.9, 60.4, 15, 25));		ht.put("%CQ(//)", new HOSECodeShiftRange("%CQ(//)", 110.2, 30.4, "S", 132.3, 82.6, 15, 29));		ht.put("%CF(//)", new HOSECodeShiftRange("%CF(//)", 90.1, 5.0, "S", 90.1, 90.1, 1, 1));		ht.put("%CX(//)", new HOSECodeShiftRange("%CX(//)", 65.2, 35.3, "S", 79.8, 56.7, 3, 4));		ht.put("%CY(//)", new HOSECodeShiftRange("%CY(//)", 41.7, 13.8, "S", 50.1, 37.0, 6, 9));		ht.put("%CI(//)", new HOSECodeShiftRange("%CI(//)", 0.0, 17.6, "S", 9.0, -6.3, 3, 5));		ht.put("%C(//)", new HOSECodeShiftRange("%C(//)", 72.6, 13.3, "D", 96.3, 22.0, 103, 265));		ht.put("%NC$(//)", new HOSECodeShiftRange("%NC$(//)", 113.0, 5.0, "S", 113.1, 112.9, 2, 2));		ht.put("%NC(//)", new HOSECodeShiftRange("%NC(//)", 116.7, 8.4, "S", 133.2, 37.7, 806, 2046));		ht.put("%NO(//)", new HOSECodeShiftRange("%NO(//)", 109.1, 5.0, "S", 109.7, 108.5, 1, 7));		ht.put("%NN(//)", new HOSECodeShiftRange("%NN(//)", 116.8, 6.6, "S", 124.1, 105.7, 34, 57));		ht.put("%NS(//)", new HOSECodeShiftRange("%NS(//)", 116.9, 16.7, "S", 134.1, 107.0, 27, 73));		ht.put("%NP(//)", new HOSECodeShiftRange("%NP(//)", 119.1, 5.0, "S", 120.3, 118.0, 2, 2));		ht.put("%NB(//)", new HOSECodeShiftRange("%NB(//)", 165.4, 5.0, "S", 165.4, 165.4, 1, 1));		ht.put("%N(//)", new HOSECodeShiftRange("%N(//)", 112.7, 5.0, "D", 112.8, 112.6, 1, 2));		ht.put("%PC(//)", new HOSECodeShiftRange("%PC(//)", 164.9, 5.0, "S", 164.9, 164.9, 1, 1));		ht.put("=C=C(//)", new HOSECodeShiftRange("=C=C(//)", 189.9, 51.3, "S", 235.4, 97.4, 108, 156));		ht.put("=C=O(//)", new HOSECodeShiftRange("=C=O(//)", 172.0, 68.1, "S", 206.2, 18.5, 26, 37));		ht.put("=C=N(//)", new HOSECodeShiftRange("=C=N(//)", 197.4, 28.2, "S", 227.6, 186.7, 15, 15));		ht.put("=C=S(//)", new HOSECodeShiftRange("=C=S(//)", 269.1, 5.0, "S", 269.1, 269.1, 1, 1));		ht.put("=CC$C$(//)", new HOSECodeShiftRange("=CC$C$(//)", 111.1, 28.4, "S", 153.7, 80.5, 130, 289));		ht.put("=CC$C(//)", new HOSECodeShiftRange("=CC$C(//)", 126.9, 32.3, "S", 187.4, 63.1, 1243, 3017));		ht.put("=CC$O(//)", new HOSECodeShiftRange("=CC$O(//)", 148.5, 25.4, "S", 201.0, 118.0, 207, 409));		ht.put("=CC$N$$(//)", new HOSECodeShiftRange("=CC$N$$(//)", 130.5, 36.0, "S", 143.3, 120.9, 4, 4));

⌨️ 快捷键说明

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