// $Id: mmdb_tables.cpp $ // ================================================================= // // CCP4 Coordinate Library: support of coordinate-related // functionality in protein crystallography applications. // // Copyright (C) Eugene Krissinel 2000-2013. // // This library is free software: you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License version 3, modified in accordance with the provisions // of the license to address the requirements of UK law. // // You should have received a copy of the modified GNU Lesser // General Public License along with this library. If not, copies // may be downloaded from http://www.ccp4.ac.uk/ccp4license.php // // 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. // // ================================================================= // // 24.07.15 <-- Date of Last Modification. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ----------------------------------------------------------------- // // **** Module : MMDB_Tables // ~~~~~~~~~ // **** Project : MacroMolecular Data Base (MMDB) // ~~~~~~~~~ // // **** Namespace : mmdb:: // // **** Functions : // ~~~~~~~~~~~ // // **** Constants : AName ( array of 2-character atom names ) // ~~~~~~~~~~~ HAName ( array of 2=character heteroatom names ) // RName ( 3-characters amino acid names ) // RName1 ( 1-characters amino acid names ) // // // (C) E. Krissinel 2000-2015 // // ================================================================= // #include #include "mmdb_tables.h" #include "mmdb_defs.h" namespace mmdb { // =============================================================== cpstr const ElementName[nElementNames] = { " H", "HE", "LI", "BE", " B", " C", " N", " O", " F", "NE", "NA", "MG", "AL", "SI", " P", " S", "CL", "AR", " K", "CA", "SC", "TI", " V", "CR", "MN", "FE", "CO", "NI", "CU", "ZN", "GA", "GE", "AS", "SE", "BR", "KR", "RB", "SR", " Y", "ZR", "NB", "MO", "TC", "RU", "RH", "PD", "AG", "CD", "IN", "SN", "SB", "TE", " I", "XE", "CS", "BA", "LA", "CE", "PR", "ND", "PM", "SM", "EU", "GD", "TB", "DY", "HO", "ER", "TM", "YB", "LU", "HF", "TA", " W", "RE", "OS", "IR", "PT", "AU", "HG", "TL", "PB", "BI", "PO", "AT", "RN", "FR", "RA", "AC", "TH", "PA", " U", "NP", "PU", "AM", "CM", "BK", "CF", "ES", "FM", "MD", "NO", "LR", "RF", "DB", "SG", "BH", "HS", "MT", "UN", "UU", "UB", "UQ", "UH", "UO", " D", "AN" }; realtype const MolecWeight[nElementNames] = { 1.0079, 4.0026, 6.9410, 9.0122, 10.811, 12.011, 14.007, 15.999, 18.998, 20.180, 22.990, 24.305, 26.982, 28.086, 30.974, 32.066, 35.453, 39.948, 39.098, 40.078, 44.956, 47.867, 50.942, 51.996, 54.938, 55.845, 58.993, 58.693, 63.546, 65.390, 69.723, 72.610, 74.922, 78.960, 79.904, 83.800, 85.468, 87.620, 88.906, 91.224, 92.906, 95.940, 97.907, 101.07, 102.91, 106.42, 107.87, 112.41, 114.82, 118.71, 121.76, 127.60, 126.90, 131.29, 132.91, 137.33, 138.91, 140.12, 140.91, 144.24, 144.91, 150.36, 151.96, 157.25, 158.93, 162.50, 164.93, 167.26, 168.93, 173.04, 174.97, 178.49, 180.95, 183.84, 186.21, 190.23, 192.22, 195.08, 196.97, 200.59, 204.38, 207.20, 208.98, 208.98, 209.99, 222.02, 232.02, 226.03, 227.03, 232.04, 231.04, 238.03, 237.05, 244.06, 243.06, 247.07, 247.07, 251.08, 252.08, 257.10, 258.10, 259.10, 262.11, 263.11, 262.11, 266.12, 264.12, 269.13, 268.14, 272.15, 272.15, 277.00, 289.00, 289.00, 293.00, 2.0200, 3.0300 }; realtype const CovalentRadius[nElementNames] = { 0.32, 0.93, 1.23, 0.90, 0.82, 0.77, 0.75, 0.73, 0.72, 0.71, 1.54, 1.36, 1.18, 1.11, 1.06, 1.02, 0.99, 0.98, 2.03, 1.91, 1.62, 1.45, 1.34, 1.18, 1.17, 1.17, 1.16, 1.15, 1.17, 1.25, 1.26, 1.22, 1.20, 1.16, 1.14, 1.12, 2.16, 1.91, 1.62, 1.45, 1.34, 1.30, 1.27, 1.25, 1.25, 1.28, 1.34, 1.48, 1.44, 1.41, 1.40, 1.36, 1.33, 1.31, 2.35, 1.98, 1.69, 1.44, 1.34, 1.30, 1.28, 1.26, 1.27, 1.30, 1.34, 1.49, 1.48, 1.47, 1.46, 1.46, 1.45, 1.43, 2.50, 2.40, 2.20, 1.65, 1.65, 1.64, 1.63, 1.62, 1.85, 1.61, 1.59, 1.59, 1.58, 1.57, 1.56, 1.74, 1.56, 1.65, 1.65, 1.42, 1.65, 1.65, 1.65, 1.65, 1.65, 1.65, 1.65, 1.65, 1.65, 1.65, 1.65, 0.32, 0.10, /**/ 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.32, 0.32 }; realtype const VdWaalsRadius[nElementNames] = { 1.20, 1.40, 1.82, 1.78, 1.74, 1.70, 1.55, 1.52, 1.47, 1.54, // ^^^^ ^^^^ <- only a guess 2.27, 1.73, 1.80, 2.10, 1.80, 1.80, 1.75, 1.88, // ^^^^ 2.75, 2.65, // ^^^^ 2.55, 2.45, 2.35, 2.20, 1.73, 1.90, // ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ 1.75, 1.63, 1.40, 1.39, // ^^^^ 1.87, 1.86, 1.85, 1.90, 1.85, 2.02, // ^^^^ 2.75, 2.65, //^^^^ ^^^^ 2.55, 2.45, 2.35, 2.20, 2.05, 1.90, // ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ 1.75, 1.63, 1.72, 1.58, // ^^^^ 1.93, 2.17, 2.10, 2.06, 1.98, 2.16, // ^^^^ 2.75, 2.75, //^^^^ ^^^^ 2.75, 2.75, 2.75, 2.75, 2.75, 2.75, 2.75, // ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ 2.75, 2.75, 2.75, 2.75, 2.75, 2.65, 2.55, // ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ 2.45, 2.35, 2.25, 2.15, 2.05, 1.95, // ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ 1.85, 1.75, 1.66, 1.55, // ^^^^ 1.96, 2.02, 2.00, 2.00, 2.00, 2.00, // ^^^^ ^^^^ ^^^^ ^^^^ 2.75, 2.75, //^^^^ ^^^^ 2.50, 2.25, 1.95, 1.86, 1.80, 1.80, 1.80, // ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ 1.80, 1.80, 1.80, 1.80, 1.80, 1.80, 1.80, // ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ 1.80, 1.80, 1.80, 1.80, 1.80, 1.80, // ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ 1.80, 1.80, 1.80, 1.80, // ^^^^ ^^^^ ^^^^ ^^^^ 1.80, 1.80, 1.80, // ^^^^ ^^^^ ^^^^ 1.30, 1.50 //^^^^ ^^^^ }; realtype const IonicRadius[nElementNames] = { 0.79, 0.49, 2.05, 1.40, 1.17, 0.91, 0.75, 0.65, 0.57, 0.51, 2.23, 1.72, 1.82, 1.46, 1.23, 1.09, 0.97, 0.88, 2.77, 2.23, 2.09, 2.00, 1.92, 1.85, 1.79, 1.72, 1.67, 1.62, 1.57, 1.53, 1.81, 1.52, 1.33, 1.22, 1.12, 1.03, 2.98, 2.45, 2.27, 2.16, 2.09, 2.01, 1.95, 1.89, 1.83, 1.79, 1.75, 1.71, 2.00, 1.72, 1.53, 1.42, 1.32, 1.24, 3.34, 2.78, 2.74, 2.16, 2.09, 2.02, 1.97, 1.92, 1.87, 1.83, 1.79, 1.76, 2.08, 1.81, 1.63, 1.53, 1.43, 1.34, 3.50, 3.00, 3.20, 2.70, 2.67, 2.64, 2.62, 2.59, 2.56, 2.54, 2.51, 2.49, 2.47, 2.45, 2.42, 2.40, 2.25, 3.16, 3.14, 3.11, 3.08, 3.05, 3.02, 2.99, 2.97, 2.95, 2.92, 2.90, 2.87, 2.85 }; cpstr const ElementMetal[nElementMetals] = { "LI", "BE", "NA", "MG", "AL", " K", "CA", "SC", "TI", " V", "MN", "FE", "CO", "NI", "CU", "ZN", "GA", "RB", "SR", " Y", "ZR", "NB", "MO", "TC", "RU", "RH", "PD", "AG", "CD", "IN", "SN", "SB", "CS", "BA", "LA", "CE", "PR", "ND", "PM", "SM", "EU", "GD", "TB", "DY", "HO", "ER", "TM", "YB", "LU", "HF", "TA", " W", "RE", "OS", "IR", "PT", "AU", "HG", "TL", "PB", "BI", "PO", "FR", "RA", "AC", "TH", "PA", " U", "NP", "PU", "AM", "CM", "BK", "CF", "ES", "FM", "MD", "NO", "LR", "RF", "DB", "SG", "BH", "HS", "MT", "UN", "UU", "UB", "UQ", "UH", "UO" }; cpstr const HydAtomName[nHydAtomNames] = { "0H", "1H", "2H", "3H", "4H", "5H", "6H", "7H", "8H", "9H", "HH", "*H", "'H", """H" }; bool isMetal ( cpstr element ) { char name[3]; bool isThere; int i; if (!element[1]) { name[0] = ' '; name[1] = element[0]; } else strncpy ( name,element,2 ); name[2] = char(0); isThere = false; for (i=0;(i=nElementNames) return ELEMENT_UNKNOWN; return type+1; // so that hydrogen is 1 } realtype getMolecWeight ( cpstr element ) { int type=0; char El[3]; if ((!element[1]) || (element[1]==' ')) { El[0] = ' '; El[1] = element[0]; } else { El[0] = element[0]; El[1] = element[1]; } El[2] = char(0); UpperCase ( El ); while (type=nElementNames) return 1.0; return MolecWeight[type]; } realtype getCovalentRadius ( cpstr element ) { int type=0; char El[3]; if ((!element[1]) || (element[1]==' ')) { El[0] = ' '; El[1] = element[0]; } else { El[0] = element[0]; El[1] = element[1]; } El[2] = char(0); UpperCase ( El ); while (type=nElementNames) return 2.2*CovalentRadius[0]; return CovalentRadius[type]; } realtype getVdWaalsRadius ( cpstr element ) { int type=0; char El[3]; if ((!element[1]) || (element[1]==' ')) { El[0] = ' '; El[1] = element[0]; } else { El[0] = element[0]; El[1] = element[1]; } El[2] = char(0); UpperCase ( El ); while (type=nElementNames) return 1.8; return VdWaalsRadius[type]; } cpstr const ResidueName[nResNames] = { "ALA", "ARG", "ASN", "ASP", "CYS", "CYH", "GLN", "GLU", "GLY", "HIS", "ILE", "LEU", "LYS", "MET", "PHE", "PRO", "SER", "THR", "TRP", "TYR", "VAL", "HEM", "WAT", "SUL", "END", "DUM" }; int getResidueNo ( cpstr resName ) { int i,m; m = -1; for (i=0;(i