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

ANVIL: fix for 6y1z

parent 556d5bb0
No related branches found
No related tags found
No related merge requests found
...@@ -101,6 +101,10 @@ async function initialize(structure: Structure, props: ANVILProps, accessibleSur ...@@ -101,6 +101,10 @@ async function initialize(structure: Structure, props: ANVILProps, accessibleSur
const hydrophobic = new Array<boolean>(); const hydrophobic = new Array<boolean>();
const definition = props.tmdetDefinition ? TMDET_DEFINITION : ANVIL_DEFINITION; const definition = props.tmdetDefinition ? TMDET_DEFINITION : ANVIL_DEFINITION;
function isPartOfEntity(l: StructureElement.Location): boolean {
return !Unit.isAtomic(l.unit) ? notAtomic() : l.unit.model.atomicHierarchy.residues.label_seq_id.valueKind(l.unit.residueIndex[l.element]) === 0;
}
const vec = v3zero(); const vec = v3zero();
for (let i = 0, il = structure.units.length; i < il; ++i) { for (let i = 0, il = structure.units.length; i < il; ++i) {
const unit = structure.units[i]; const unit = structure.units[i];
...@@ -111,8 +115,8 @@ async function initialize(structure: Structure, props: ANVILProps, accessibleSur ...@@ -111,8 +115,8 @@ async function initialize(structure: Structure, props: ANVILProps, accessibleSur
const eI = elements[j]; const eI = elements[j];
l.element = eI; l.element = eI;
// consider only amino acids // consider only amino acids in chains
if (getElementMoleculeType(unit, eI) !== MoleculeType.Protein) { if (getElementMoleculeType(unit, eI) !== MoleculeType.Protein || !isPartOfEntity(l)) {
continue; continue;
} }
...@@ -357,7 +361,7 @@ function membraneSegments(ctx: ANVILContext, membrane: MembraneCandidate): Array ...@@ -357,7 +361,7 @@ function membraneSegments(ctx: ANVILContext, membrane: MembraneCandidate): Array
// collect all residues in membrane layer // collect all residues in membrane layer
for (let k = 0, kl = offsets.length; k < kl; k++) { for (let k = 0, kl = offsets.length; k < kl; k++) {
const unit = units[unitIndices[offsets[k]]]; const unit = units[unitIndices[offsets[k]]];
if (!Unit.isAtomic(unit)) throw 'Property only available for atomic models.'; if (!Unit.isAtomic(unit)) notAtomic();
const elementIndex = elementIndices[offsets[k]]; const elementIndex = elementIndices[offsets[k]];
authAsymId = unit.model.atomicHierarchy.chains.auth_asym_id.value(unit.chainIndex[elementIndex]); authAsymId = unit.model.atomicHierarchy.chains.auth_asym_id.value(unit.chainIndex[elementIndex]);
...@@ -378,7 +382,7 @@ function membraneSegments(ctx: ANVILContext, membrane: MembraneCandidate): Array ...@@ -378,7 +382,7 @@ function membraneSegments(ctx: ANVILContext, membrane: MembraneCandidate): Array
for (let k = 0, kl = offsets.length; k < kl; k++) { for (let k = 0, kl = offsets.length; k < kl; k++) {
const unit = units[unitIndices[offsets[k]]]; const unit = units[unitIndices[offsets[k]]];
if (!Unit.isAtomic(unit)) throw 'Property only available for atomic models.'; if (!Unit.isAtomic(unit)) notAtomic();
const elementIndex = elementIndices[offsets[k]]; const elementIndex = elementIndices[offsets[k]];
authAsymId = unit.model.atomicHierarchy.chains.auth_asym_id.value(unit.chainIndex[elementIndex]); authAsymId = unit.model.atomicHierarchy.chains.auth_asym_id.value(unit.chainIndex[elementIndex]);
...@@ -441,6 +445,10 @@ function membraneSegments(ctx: ANVILContext, membrane: MembraneCandidate): Array ...@@ -441,6 +445,10 @@ function membraneSegments(ctx: ANVILContext, membrane: MembraneCandidate): Array
return refinedSegments; return refinedSegments;
} }
function notAtomic(): never {
throw 'Property only available for atomic models.';
}
/** Filter for membrane residues and calculate the final extent of the membrane layer */ /** Filter for membrane residues and calculate the final extent of the membrane layer */
function adjustExtent(ctx: ANVILContext, membrane: MembraneCandidate, centroid: Vec3): number { function adjustExtent(ctx: ANVILContext, membrane: MembraneCandidate, centroid: Vec3): number {
const { offsets, structure } = ctx; const { offsets, structure } = ctx;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment