UNPKG

molstar

Version:

A comprehensive macromolecular library.

67 lines (66 loc) 1.41 kB
/** * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> */ // from NGL const ProteinOneLetterCodes = { 'HIS': 'H', 'ARG': 'R', 'LYS': 'K', 'ILE': 'I', 'PHE': 'F', 'LEU': 'L', 'TRP': 'W', 'ALA': 'A', 'MET': 'M', 'PRO': 'P', 'CYS': 'C', 'ASN': 'N', 'VAL': 'V', 'GLY': 'G', 'SER': 'S', 'GLN': 'Q', 'TYR': 'Y', 'ASP': 'D', 'GLU': 'E', 'THR': 'T', 'SEC': 'U', // as per IUPAC definition 'PYL': 'O', // as per IUPAC definition // charmm ff 'HSD': 'H', 'HSE': 'H', 'HSP': 'H', 'LSN': 'K', 'ASPP': 'D', 'GLUP': 'E', // amber ff 'HID': 'H', 'HIE': 'H', 'HIP': 'H', 'LYN': 'K', 'ASH': 'D', 'GLH': 'E', }; const DnaOneLetterCodes = { 'DA': 'A', 'DC': 'C', 'DG': 'G', 'DT': 'T', 'DU': 'U' }; const RnaOneLetterCodes = { 'A': 'A', 'C': 'C', 'G': 'G', 'T': 'T', 'U': 'U' }; export function getProteinOneLetterCode(residueName) { const code = ProteinOneLetterCodes[residueName]; return code || 'X'; } export function getRnaOneLetterCode(residueName) { const code = RnaOneLetterCodes[residueName]; return code || 'X'; } export function getDnaOneLetterCode(residueName) { const code = DnaOneLetterCodes[residueName]; return code || 'X'; }