Browse Source

stub to consider non-polymer groups for computation

Sebastian Bittrich 6 years ago
parent
commit
fb60cb589d

+ 5 - 4
src/mol-model/structure/structure/unit/accessible-surface-area/compute.ts

@@ -43,10 +43,11 @@ interface AccessibleSurfaceAreaContext {
  * J. A. Rupley. "Environment and Exposure to Solvent of Protein Atoms. Lysozyme and Insulin." JMB (1973).
  */
 function computeAccessibleSurfaceArea(unit: Unit.Atomic, params?: PD.Values<AccessibleSurfaceAreaComputationParams>): AccessibleSurfaceArea {
-    console.log(`computing accessible surface area for unit #${ unit.id + 1 }`);
-
     if (!params) params = PD.getDefaultValues(AccessibleSurfaceAreaComputationParams);
 
+    // TODO non-polymer flag is currently useless as hetatms are located in different units - aim is not to color them, but to compute values correctly - relates to correct ASA computation for inter-chain contacts
+    console.log(`computing accessible surface area for unit #${ unit.id + 1 } - ${ params.numberOfSpherePoints } points, ${ params.probeSize } probe size, ${ params.nonPolymer ? 'honoring' : 'ignoring'} non-polymer atoms`);
+
     const ctx = initialize(unit, params);
     assignRadiusForHeavyAtoms(ctx);
     computePerResidue(ctx);
@@ -66,7 +67,7 @@ function normalizeAccessibleSurfaceArea(ctx: AccessibleSurfaceAreaContext) {
 
     for (let i = 0; i < residues.label_comp_id.rowCount; ++i) {
         // skip entities not part of a polymer chain
-        if (!isPolymer(derived.residue.moleculeType[i])) continue;
+        if (!ctx.params.nonPolymer && !isPolymer(derived.residue.moleculeType[i])) continue;
 
         const maxAsa = (MaxAsa as any)[residues.label_comp_id.value(i)];
         const rasa = accessibleSurfaceArea![i] / (maxAsa === undefined ? DefaultMaxAsa : maxAsa);
@@ -173,7 +174,7 @@ function assignRadiusForHeavyAtoms(ctx: AccessibleSurfaceAreaContext) {
         }
 
         // skip non-polymer groups
-        if (!isPolymer(moleculeType[raI])) {
+        if (!ctx.params.nonPolymer && !isPolymer(moleculeType[raI])) {
             ctx.atomRadius[aI] = missingAccessibleSurfaceAreaValue;
             continue;
         }

+ 2 - 1
src/mol-model/structure/structure/unit/accessible-surface-area/data.ts

@@ -17,7 +17,8 @@ export interface AccessibleSurfaceArea {
 export const AccessibleSurfaceAreaComputationParams = {
     numberOfSpherePoints: PD.Numeric(92, {}, { description: 'number of sphere points to sample per atom: 92 (original paper), 960 (BioJava), 3000 (EPPIC) - see Shrake A, Rupley JA: Environment and exposure to solvent of protein atoms. Lysozyme and insulin. J Mol Biol 1973.' }),
     probeSize: PD.Numeric(1.4, {}, { description: 'corresponds to the size of a water molecule: 1.4 (original paper), 1.5 (occassionally used)' }),
-    buriedRasaThreshold: PD.Numeric(0.16, { min: 0.0, max: 1.0 }, { description: 'below this cutoff of relative accessible surface area a residue will be considered buried - see: Rost B, Sander C: Conservation and prediction of solvent accessibility in protein families. Proteins 1994.' })
+    buriedRasaThreshold: PD.Numeric(0.16, { min: 0.0, max: 1.0 }, { description: 'below this cutoff of relative accessible surface area a residue will be considered buried - see: Rost B, Sander C: Conservation and prediction of solvent accessibility in protein families. Proteins 1994.' }),
+    nonPolymer: PD.Boolean(true, { description: 'Include non-polymer atoms in computation.' })
 }
 
 export namespace SolventAccessibility {

+ 1 - 1
src/tests/browser/render-structure.ts

@@ -61,7 +61,7 @@ function getCartoonRepr() {
 }
 
 async function init() {
-    const cif = await downloadFromPdb(/*'3j3q'*/'1acj')
+    const cif = await downloadFromPdb(/*'3j3q'*/'1hrc')
     const models = await getModels(cif)
 
     const structure = await getStructure(models[0])