Browse Source

added basic support for PNA (peptide nucleic acid)

Alexander Rose 6 years ago
parent
commit
995919a35c

+ 4 - 4
src/mol-geo/representation/structure/visual/polymer-trace-mesh.ts

@@ -11,7 +11,7 @@ import { markElement, getElementLoci, StructureElementIterator } from './util/el
 import { Mesh } from '../../../mesh/mesh';
 import { MeshBuilder } from '../../../mesh/mesh-builder';
 import { getPolymerElementCount, PolymerTraceIterator, createCurveSegmentState, interpolateCurveSegment } from './util/polymer';
-import { SecondaryStructureType, MoleculeType } from 'mol-model/structure/model/types';
+import { SecondaryStructureType, isNucleic } from 'mol-model/structure/model/types';
 import { UnitsMeshVisual, DefaultUnitsMeshProps } from '../units-visual';
 import { SizeThemeProps, SizeTheme } from 'mol-view/theme/size';
 import { OrderedSet } from 'mol-data/int';
@@ -47,10 +47,10 @@ async function createPolymerTraceMesh(ctx: RuntimeContext, unit: Unit, props: Po
         const v = polymerTraceIt.move()
         builder.setGroup(OrderedSet.findPredecessorIndex(unit.elements, v.center.element))
 
-        const isNucleic = v.moleculeType === MoleculeType.DNA || v.moleculeType === MoleculeType.RNA
+        const isNucleicType = isNucleic(v.moleculeType)
         const isSheet = SecondaryStructureType.is(v.secStrucType, SecondaryStructureType.Flag.Beta)
         const isHelix = SecondaryStructureType.is(v.secStrucType, SecondaryStructureType.Flag.Helix)
-        const tension = (isNucleic || isSheet) ? 0.5 : 0.9
+        const tension = (isNucleicType || isSheet) ? 0.5 : 0.9
 
         interpolateCurveSegment(state, v, tension)
 
@@ -64,7 +64,7 @@ async function createPolymerTraceMesh(ctx: RuntimeContext, unit: Unit, props: Po
             let height: number
             if (isHelix) {
                 height = width * aspectRatio
-            } else if (isNucleic) {
+            } else if (isNucleicType) {
                 height = width * aspectRatio;
                 [width, height] = [height, width]
             } else {

+ 18 - 7
src/mol-model/structure/model/types.ts

@@ -50,6 +50,8 @@ export const enum MoleculeType {
     RNA,
     /** DNA, e.g. component type included in `DNAComponentTypeNames` */
     DNA,
+    /** PNA, peptide nucleic acid, comp id included in `PeptideBaseNames` */
+    PNA,
     /** sacharide, e.g. component type included in `SaccharideComponentTypeNames` */
     saccharide
 }
@@ -77,6 +79,12 @@ export const MoleculeTypeAtomRoleId: { [k: number]: { [k in AtomRole]: string }
         direction: 'C1\'', // TODO 'C1*'
         backboneStart: 'P',
         backboneEnd: 'O3\'' // TODO 'O3*'
+    },
+    [MoleculeType.PNA]: {
+        trace: 'N4\'', // TODO 'N4*'
+        direction: 'C7\'', // TODO 'C7*'
+        backboneStart: 'N1\'', // TODO 'N1*'
+        backboneEnd: 'C1\'' // TODO 'C1*'
     }
 }
 
@@ -153,9 +161,10 @@ export const ExtraSaccharideNames = [
 
 export const RnaBaseNames = [ 'A', 'C', 'T', 'G', 'I', 'U' ]
 export const DnaBaseNames = [ 'DA', 'DC', 'DT', 'DG', 'DI', 'DU' ]
-export const PurinBaseNames = [ 'A', 'G', 'DA', 'DG', 'DI' ]
-export const PyrimidineBaseNames = [ 'C', 'T', 'U', 'DC', 'DT', 'DU' ]
-export const BaseNames = RnaBaseNames.concat(DnaBaseNames)
+export const PeptideBaseNames = [ 'APN', 'CPN', 'TPN', 'GPN' ]
+export const PurinBaseNames = [ 'A', 'G', 'DA', 'DG', 'DI', 'APN', 'GPN' ]
+export const PyrimidineBaseNames = [ 'C', 'T', 'U', 'DC', 'DT', 'DU', 'CPN', 'TPN' ]
+export const BaseNames = RnaBaseNames.concat(DnaBaseNames, PeptideBaseNames)
 
 export const isPurinBase = (compId: string) => PurinBaseNames.includes(compId.toUpperCase())
 export const isPyrimidineBase = (compId: string) => PyrimidineBaseNames.includes(compId.toUpperCase())
@@ -164,7 +173,9 @@ export const isPyrimidineBase = (compId: string) => PyrimidineBaseNames.includes
 export function getMoleculeType(compType: string, compId: string) {
     compType = compType.toUpperCase()
     compId = compId.toUpperCase()
-    if (ProteinComponentTypeNames.includes(compType)) {
+    if (PeptideBaseNames.includes(compId)) {
+        return MoleculeType.PNA
+    } else if (ProteinComponentTypeNames.includes(compType)) {
         return MoleculeType.protein
     } else if (RNAComponentTypeNames.includes(compType)) {
         return MoleculeType.RNA
@@ -182,11 +193,11 @@ export function getMoleculeType(compType: string, compId: string) {
 }
 
 export function isPolymer(moleculeType: MoleculeType) {
-    return moleculeType === MoleculeType.protein || moleculeType === MoleculeType.DNA || moleculeType === MoleculeType.RNA
+    return moleculeType === MoleculeType.protein || moleculeType === MoleculeType.DNA || moleculeType === MoleculeType.RNA || moleculeType === MoleculeType.PNA
 }
 
 export function isNucleic(moleculeType: MoleculeType) {
-    return moleculeType === MoleculeType.DNA || moleculeType === MoleculeType.RNA
+    return moleculeType === MoleculeType.DNA || moleculeType === MoleculeType.RNA || moleculeType === MoleculeType.PNA
 }
 
 /**
@@ -484,7 +495,7 @@ export namespace LinkType {
         Covalent             = 0x1,
         MetallicCoordination = 0x2,
         Hydrogen             = 0x4,
-        Ion                  = 0x8,
+        Ionic                = 0x8,
         Sulfide              = 0x10,
         Aromatic             = 0x20,
         Computed             = 0x40

+ 4 - 3
src/mol-view/stage.ts

@@ -109,7 +109,7 @@ export class Stage {
         // this.loadPdbid('2zex') // contains carbohydrate polymer
         // this.loadPdbid('3sgj') // contains carbohydrate polymer
         // this.loadPdbid('3ina') // contains GlcN and IdoA
-        this.loadPdbid('1umz') // contains Xyl (Xyloglucan)
+        // this.loadPdbid('1umz') // contains Xyl (Xyloglucan)
         // this.loadPdbid('1mfb') // contains Abe
         // this.loadPdbid('2gdu') // contains sucrose
         // this.loadPdbid('2fnc') // contains maltotriose
@@ -121,8 +121,9 @@ export class Stage {
         // this.loadMmcifUrl(`../../examples/1cbs_updated.cif`)
         // this.loadMmcifUrl(`../../examples/1crn.cif`)
         // this.loadPdbid('5u0q') // mixed dna/rna in same polymer
-        // this.loadPdbid('1xj9') // peptide nucleic acid
-        // this.loadPdbid('1xj9') // temp
+        // this.loadPdbid('1xj9') // PNA (peptide nucleic acid)
+        this.loadPdbid('5eme') // PNA (peptide nucleic acid) and RNA
+        // this.loadPdbid('5eme') // temp
 
         // this.loadMmcifUrl(`../../../test/pdb-dev/PDBDEV_00000001.cif`) // ok
         // this.loadMmcifUrl(`../../../test/pdb-dev/PDBDEV_00000002.cif`) // ok