5.24. MDAnalysis topology tables

The module contains static lookup tables for atom typing etc. The tables are dictionaries that are indexed by the element.

MDAnalysis.topology.tables.atomelements = {'AC': 'C', 'BC': 'C', 'BR': 'BR', 'C0': 'CA', 'CA2+': 'CA', 'CAL': 'CA', 'CES': 'CS', 'CL': 'CL', 'CL-': 'CL', 'CLA': 'CL', 'CLAL': 'CL', 'CS': 'CS', 'CS+': 'CS', 'CU': 'CU', 'FE': 'FE', 'FE2': 'FE', 'IOD': 'I', 'K': 'K', 'K+': 'K', 'LI': 'LI', 'LI+': 'LI', 'LIT': 'LI', 'MG': 'MG', 'MG2+': 'MG', 'MW': 'DUMMY', 'NA': 'NA', 'NA+': 'NA', 'POT': 'K', 'QC': 'CE', 'QK': 'K', 'QL': 'LI', 'QN': 'NA', 'QR': 'RB', 'RB': 'RB', 'SOD': 'NA', 'ZN': 'ZN'}

Dictionary with hard-coded special atom names, used for guessing atom types with MDAnalysis.topology.core.guess_atom_type().

MDAnalysis.topology.tables.masses = {'Ac': 227.028, 'Ag': 107.8682, 'Al': 26.981539, 'Am': 243.0, 'Ar': 39.948, 'As': 74.92159, 'At': 210.0, 'Au': 196.96654, 'B': 10.811, 'BR': 79.904, 'Ba': 137.327, 'Be': 9.012182, 'Bh': 262.0, 'Bi': 208.98037, 'Bk': 247.0, 'C': 12.011, 'CA': 40.08, 'CL': 35.45, 'CS': 132.9, 'CU': 63.546, 'Cd': 112.411, 'Ce': 140.116, 'Cf': 251.0, 'Cm': 247.0, 'Co': 58.9332, 'Cr': 51.9961, 'DUMMY': 0.0, 'Db': 262.0, 'Dy': 162.5, 'Er': 167.26, 'Es': 252.0, 'Eu': 151.965, 'F': 18.998, 'FE': 55.847, 'Fm': 257.0, 'Fr': 223.0, 'Ga': 69.723, 'Gd': 157.25, 'Ge': 72.61, 'H': 1.008, 'HE': 4.0026, 'Hf': 178.49, 'Hg': 200.59, 'Ho': 164.93032, 'Hs': 265.0, 'I': 126.9045, 'In': 114.82, 'Ir': 192.22, 'K': 39.102, 'Kr': 83.8, 'La': 138.9055, 'Li': 6.941, 'Lr': 262.0, 'Lu': 174.967, 'MG': 24.305, 'Md': 258.0, 'Mn': 54.93805, 'Mo': 95.94, 'Mt': 266.0, 'N': 14.007, 'NA': 22.98977, 'NE': 20.1797, 'Na': 22.989768, 'Nb': 92.90638, 'Nd': 144.24, 'Ni': 58.6934, 'No': 259.0, 'Np': 237.048, 'O': 15.999, 'Os': 190.2, 'P': 30.974, 'Pa': 231.0359, 'Pb': 207.2, 'Pd': 106.42, 'Pm': 145.0, 'Po': 209.0, 'Pr': 140.90765, 'Pt': 195.08, 'Pu': 244.0, 'RB': 85.4678, 'Ra': 226.025, 'Re': 186.207, 'Rf': 261.0, 'Rh': 102.9055, 'Rn': 222.0, 'Ru': 101.07, 'S': 32.06, 'Sb': 121.757, 'Sc': 44.95591, 'Se': 78.96, 'Sg': 263.0, 'Si': 28.0855, 'Sm': 150.36, 'Sn': 118.71, 'Sr': 87.62, 'Ta': 180.9479, 'Tb': 158.92534, 'Tc': 98.0, 'Te': 127.6, 'Th': 232.0381, 'Ti': 47.88, 'Tl': 204.3833, 'Tm': 168.93421, 'U': 238.0289, 'V': 50.9415, 'W': 183.85, 'Xe': 131.29, 'Y': 88.90585, 'Yb': 173.04, 'ZN': 65.37, 'Zr': 91.224}

Dictionary table with atomic masses in u, indexed by the element from atomelements.

The original raw data are stored as multi-line strings that are translated into dictionaries with kv2dict(). In the future, these tables might be moved into external data files; see kv2dict() for explanation of the file format.

MDAnalysis.topology.tables.kv2dict(s, convertor=<class 'str'>)[source]

Primitive ad-hoc parser of a key-value record list.

  • The string s should contain each key-value pair on a separate line (separated by newline). The first white space after the key separates key and value.
  • Empty lines are allowed.
  • Comment lines (starting with #) are allowed.
  • Leading whitespace is ignored.

The convertor is a function that converts its single argument to a valid Python type. The default is str() but other possibilities are int() (for integers) or float() for floating point numbers.

The raw tables are stored in the strings

MDAnalysis.topology.tables.TABLE_ATOMELEMENTS = '\n# translation of atomnames to types/element\n# based on CHARMM and AMBER usage with a little bit of GROMOS (and PROPKA)\n# NOTE: CL might be ambiguous and is interpreted as chloride!\n\n# --------- ------------------\n# atomname element\n# --------- ------------------\n\n# Bromide\nBR BR\n\n# Calcium\nCAL CA\nC0 CA\nCA2+ CA\n\n# Cesium\nCES CS\n\n# Chloride\nCLA CL\nCLAL CL\nCL CL\nCL- CL\n\n# Iodide\nIOD I\n\n# Iron\nFE FE\nFE2 FE\n\n# Lithium\nLIT LI\nLI LI\nLI+ LI\nQL LI\n\n# Magnesium\nMG MG\nMG2+ MG\n\n# Noble gases\n## XXX collides with NE, HE in Arg XXX\n## XXX so we remove the noble gases XXX\n##HE HE\n##NE NE\n\n# Potassium\nK K\nPOT K\nK+ K\nQK K\n\n# Sodium\nSOD NA\nNA NA\nNA+ NA\nQN NA\n\n# Zink\nZN ZN\n\n# Copper\nCU CU\n\n# Cesium\nCS CS\nCS+ CS\nCES CS\n\n# Cerium??\nQC CE\n\n# Rubidium\nRB RB\nQR RB\n\n# special carbons (Amber?)\nBC C\nAC C\n\n# dummy atom types\nMW DUMMY\n\n# other types are guessed from the name; see\n# topology.core.guess_atom_elements()\n'

Table with hard-coded special atom names, used for guessing atom types with MDAnalysis.topology.core.guess_atom_element().

MDAnalysis.topology.tables.TABLE_MASSES = '\n# masses for elements in atomic units (u)\n# (taken from CHARMM and Gromacs atommass.dat)\n\n#------------ -----------\n# atomtype mass\n#------------ -----------\nAc 227.028\nAl 26.981539\nAm 243\nSb 121.757\nAr 39.948\nAs 74.92159\nAt 210\nBa 137.327\nBk 247\nBe 9.012182\nBi 208.98037\nBh 262\nB 10.811\nBR 79.90400\nCd 112.411\nCA 40.08000\nCf 251\nC 12.01100\nCe 140.11600\nCS 132.90000\nCL 35.45000\nCr 51.9961\nCo 58.9332\nCU 63.54600\nCm 247\nDb 262\nDy 162.5\nEs 252\nEr 167.26\nEu 151.965\nFm 257\nF 18.99800\nFr 223\nGd 157.25\nGa 69.723\nGe 72.61\nAu 196.96654\nHf 178.49\nHs 265\nHE 4.00260\nHo 164.93032\nH 1.00800\nIn 114.82\nI 126.90450\nIr 192.22\nFE 55.84700\nKr 83.8\nLa 138.9055\nLr 262\nPb 207.2\nLi 6.941\nLu 174.967\nMG 24.30500\nMn 54.93805\nMt 266\nMd 258\nHg 200.59\nMo 95.94\nN 14.00700\nNA 22.98977\nNd 144.24\nNE 20.17970\nNp 237.048\nNi 58.6934\nNb 92.90638\nNo 259\nOs 190.2\nO 15.99900\nPd 106.42\nP 30.97400\nPt 195.08\nPu 244\nPo 209\nK 39.10200\nPr 140.90765\nPm 145\nPa 231.0359\nRa 226.025\nRn 222\nRe 186.207\nRh 102.9055\nRB 85.46780\nRu 101.07\nRf 261\nSm 150.36\nSc 44.95591\nSg 263\nSe 78.96\nSi 28.0855\nAg 107.8682\nNa 22.989768\nSr 87.62\nS 32.06000\nTa 180.9479\nTc 98\nTe 127.6\nTb 158.92534\nTl 204.3833\nTh 232.0381\nTm 168.93421\nSn 118.71\nTi 47.88\nW 183.85\nU 238.0289\nV 50.9415\nXe 131.29\nYb 173.04\nY 88.90585\nZN 65.37000\nZr 91.224\nDUMMY 0.0\n'

Plain-text table with atomic masses in u.