Skip to content
Snippets Groups Projects
Commit fb60cb58 authored by Sebastian Bittrich's avatar Sebastian Bittrich
Browse files

stub to consider non-polymer groups for computation

parent 91fff322
No related branches found
No related tags found
No related merge requests found
...@@ -43,10 +43,11 @@ interface AccessibleSurfaceAreaContext { ...@@ -43,10 +43,11 @@ interface AccessibleSurfaceAreaContext {
* J. A. Rupley. "Environment and Exposure to Solvent of Protein Atoms. Lysozyme and Insulin." JMB (1973). * 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 { 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); 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); const ctx = initialize(unit, params);
assignRadiusForHeavyAtoms(ctx); assignRadiusForHeavyAtoms(ctx);
computePerResidue(ctx); computePerResidue(ctx);
...@@ -66,7 +67,7 @@ function normalizeAccessibleSurfaceArea(ctx: AccessibleSurfaceAreaContext) { ...@@ -66,7 +67,7 @@ function normalizeAccessibleSurfaceArea(ctx: AccessibleSurfaceAreaContext) {
for (let i = 0; i < residues.label_comp_id.rowCount; ++i) { for (let i = 0; i < residues.label_comp_id.rowCount; ++i) {
// skip entities not part of a polymer chain // 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 maxAsa = (MaxAsa as any)[residues.label_comp_id.value(i)];
const rasa = accessibleSurfaceArea![i] / (maxAsa === undefined ? DefaultMaxAsa : maxAsa); const rasa = accessibleSurfaceArea![i] / (maxAsa === undefined ? DefaultMaxAsa : maxAsa);
...@@ -173,7 +174,7 @@ function assignRadiusForHeavyAtoms(ctx: AccessibleSurfaceAreaContext) { ...@@ -173,7 +174,7 @@ function assignRadiusForHeavyAtoms(ctx: AccessibleSurfaceAreaContext) {
} }
// skip non-polymer groups // skip non-polymer groups
if (!isPolymer(moleculeType[raI])) { if (!ctx.params.nonPolymer && !isPolymer(moleculeType[raI])) {
ctx.atomRadius[aI] = missingAccessibleSurfaceAreaValue; ctx.atomRadius[aI] = missingAccessibleSurfaceAreaValue;
continue; continue;
} }
......
...@@ -17,7 +17,8 @@ export interface AccessibleSurfaceArea { ...@@ -17,7 +17,8 @@ export interface AccessibleSurfaceArea {
export const AccessibleSurfaceAreaComputationParams = { 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.' }), 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)' }), 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 { export namespace SolventAccessibility {
......
...@@ -61,7 +61,7 @@ function getCartoonRepr() { ...@@ -61,7 +61,7 @@ function getCartoonRepr() {
} }
async function init() { async function init() {
const cif = await downloadFromPdb(/*'3j3q'*/'1acj') const cif = await downloadFromPdb(/*'3j3q'*/'1hrc')
const models = await getModels(cif) const models = await getModels(cif)
const structure = await getStructure(models[0]) const structure = await getStructure(models[0])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment