|
@@ -77,7 +77,11 @@ export class Viewer {
|
|
|
|
|
|
////////////////////////////// UNITMP VIEWER PROTOTYPING SECTION
|
|
////////////////////////////// UNITMP VIEWER PROTOTYPING SECTION
|
|
|
|
|
|
|
|
+ private surfaceResidues: number[];
|
|
|
|
+
|
|
async loadWithUNITMPMembraneRepresentation(url: string, regionDescriptors: any) {
|
|
async loadWithUNITMPMembraneRepresentation(url: string, regionDescriptors: any) {
|
|
|
|
+ this.surfaceResidues = regionDescriptors['surface_residues'] as number[];
|
|
|
|
+
|
|
const membraneNormal: Vec3 = Vec3.fromObj(
|
|
const membraneNormal: Vec3 = Vec3.fromObj(
|
|
regionDescriptors['membrane-normal']
|
|
regionDescriptors['membrane-normal']
|
|
);
|
|
);
|
|
@@ -89,11 +93,6 @@ export class Viewer {
|
|
Vec3.zero(), [ membraneNormal[0], membraneNormal[1], 0 ], 0
|
|
Vec3.zero(), [ membraneNormal[0], membraneNormal[1], 0 ], 0
|
|
),
|
|
),
|
|
normalVector: membraneNormal,
|
|
normalVector: membraneNormal,
|
|
-
|
|
|
|
- // TODO: radius is still just a dummy value now.
|
|
|
|
- // Can we send a precalculated value by our backend?
|
|
|
|
- //
|
|
|
|
- // (NOTE: the TMDET extension calculates and sets it during applying preset)
|
|
|
|
radius: regionDescriptors[ 'radius' ]
|
|
radius: regionDescriptors[ 'radius' ]
|
|
};
|
|
};
|
|
membrane.planePoint2[2] *= -1;
|
|
membrane.planePoint2[2] *= -1;
|
|
@@ -156,6 +155,7 @@ export class Viewer {
|
|
color: 'uniform',
|
|
color: 'uniform',
|
|
colorParams: { value: color }
|
|
colorParams: { value: color }
|
|
}));
|
|
}));
|
|
|
|
+ this.indicateSurfaceResidues(this.surfaceResidues, update);
|
|
}
|
|
}
|
|
|
|
|
|
private getQuery(chainId: string, auth_array: number[]): Expression {
|
|
private getQuery(chainId: string, auth_array: number[]): Expression {
|
|
@@ -167,6 +167,33 @@ export class Viewer {
|
|
return query;
|
|
return query;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public indicateSurfaceResidues(residues: number[], update: StateBuilder.To<any, any>) {
|
|
|
|
+ if (residues.length == 0) {
|
|
|
|
+ // nothing to do
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const query: Expression =
|
|
|
|
+ MS.struct.generator.atomGroups({
|
|
|
|
+ 'residue-test': MS.core.set.has([MS.set(...residues), MS.ammp('auth_seq_id')])
|
|
|
|
+ });
|
|
|
|
+ update
|
|
|
|
+ .apply(StateTransforms.Model.StructureSelectionFromExpression,
|
|
|
|
+ {
|
|
|
|
+ label: 'Selected Side Chains', expression: query
|
|
|
|
+ })
|
|
|
|
+ .apply(StateTransforms.Representation.StructureRepresentation3D, createStructureRepresentationParams(
|
|
|
|
+ this.plugin,
|
|
|
|
+ update.selector.data,
|
|
|
|
+ {
|
|
|
|
+ type: "ball-and-stick",
|
|
|
|
+ color: "uniform",
|
|
|
|
+ // purple: iris
|
|
|
|
+ colorParams: { value: Color.fromRgb(215, 115, 255) }
|
|
|
|
+ }
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
|
|
+
|
|
private rotateCamera(): void {
|
|
private rotateCamera(): void {
|
|
function rot90q(v: Vec3, axis: Vec3 = Vec3.create(1, 0, 0)): Vec3 {
|
|
function rot90q(v: Vec3, axis: Vec3 = Vec3.create(1, 0, 0)): Vec3 {
|
|
const q = Quat.setAxisAngle(Quat(), axis, -Math.PI/2);
|
|
const q = Quat.setAxisAngle(Quat(), axis, -Math.PI/2);
|