molstar
Version:
A comprehensive macromolecular library.
72 lines (71 loc) • 1.63 kB
JavaScript
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.getProteinOneLetterCode = getProteinOneLetterCode;
exports.getRnaOneLetterCode = getRnaOneLetterCode;
exports.getDnaOneLetterCode = getDnaOneLetterCode;
// 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'
};
function getProteinOneLetterCode(residueName) {
const code = ProteinOneLetterCodes[residueName];
return code || 'X';
}
function getRnaOneLetterCode(residueName) {
const code = RnaOneLetterCodes[residueName];
return code || 'X';
}
function getDnaOneLetterCode(residueName) {
const code = DnaOneLetterCodes[residueName];
return code || 'X';
}
;