Browse Source

Feature #232: rotated membrane normal

cycle20 2 years ago
parent
commit
043db501d3

+ 1 - 0
package.json

@@ -147,6 +147,7 @@
     "react": "^17.0.1",
     "react-dom": "^17.0.1",
     "rxjs": "^6.6.6",
+    "source-map-loader": "^3.0.1",
     "swagger-ui-dist": "^3.37.2",
     "tslib": "^2.1.0",
     "util.promisify": "^1.0.1",

+ 1 - 1
src/apps/viewer/index.html

@@ -55,7 +55,7 @@
             });
 
             // Set PDB Id here
-            var regionDescriptors = {"pdb-id":"1afo","creation-date":"2021-09-03","is-transmembrane":1,"membrane-normal":{"x":Math.sin(Math.PI/2)*17.5,"y":0,"z":Math.cos(Math.PI/2)*17.5},"chains":[{"chain_id":"A","type":"alpha","seq":"VQLAHHFSEPEITLIIFGVMAGVIGTILLISYGIRRLIKK","regions":{"1":{"auth_ids":[62,63,64,65,66,67,68,69,70,71,72,73],"color":[255,0,0]},"H":{"auth_ids":[74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95],"color":[255,255,0]},"2":{"auth_ids":[96,97,98,99,100,101],"color":[0,0,255]}}},{"chain_id":"B","type":"alpha","seq":"VQLAHHFSEPEITLIIFGVMAGVIGTILLISYGIRRLIKK","regions":{"1":{"auth_ids":[62,63,64,65,66,67,68,69,70,71,72,73],"color":[255,0,0]},"H":{"auth_ids":[74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99],"color":[255,255,0]},"2":{"auth_ids":[100,101],"color":[0,0,255]}}}]};
+            var regionDescriptors = {"pdb-id":"1afo","creation-date":"2021-09-03","is-transmembrane":1,"membrane-normal":{"x":0,"y":0,"z":17.5},"chains":[{"chain_id":"A","type":"alpha","seq":"VQLAHHFSEPEITLIIFGVMAGVIGTILLISYGIRRLIKK","regions":{"1":{"auth_ids":[62,63,64,65,66,67,68,69,70,71,72,73],"color":[255,0,0]},"H":{"auth_ids":[74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95],"color":[255,255,0]},"2":{"auth_ids":[96,97,98,99,100,101],"color":[0,0,255]}}},{"chain_id":"B","type":"alpha","seq":"VQLAHHFSEPEITLIIFGVMAGVIGTILLISYGIRRLIKK","regions":{"1":{"auth_ids":[62,63,64,65,66,67,68,69,70,71,72,73],"color":[255,0,0]},"H":{"auth_ids":[74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99],"color":[255,255,0]},"2":{"auth_ids":[100,101],"color":[0,0,255]}}}]};
             var pdbtmId = regionDescriptors["pdb-id"];
             regionDescriptors.format = 'mmcif'
             function loadPdb() {

+ 7 - 6
src/apps/viewer/index.ts

@@ -80,24 +80,25 @@ export class Viewer {
         const membraneNormal: Vec3 = Vec3.fromObj(
             regionDescriptors['membrane-normal']
         );
-        console.log('DEBUG-01');
+        membraneNormal[0] = membraneNormal[2];
+        membraneNormal[2] = 0;
+
+        console.log('DEBUG-01', membraneNormal);
         const membrane: MembraneOrientation = {
             planePoint1: Vec3.fromArray(Vec3.zero(), membraneNormal, 0),
             planePoint2: Vec3.fromArray(Vec3.zero(), membraneNormal, 0),
-            // NOTE: centroid is not 0,0,0. It is x,y,0. Right?
             centroid: Vec3.fromArray(
-                Vec3.zero(), [ membraneNormal[0], membraneNormal[1], 0 ], 0
+                Vec3.zero(), [ 0, 0, 0 ], 0
             ),
             normalVector: membraneNormal,
 
             // (NOTE: the TMDET extension calculates and sets it during applying preset)
             radius: regionDescriptors[ 'radius' ]
         };
-        membrane.planePoint2[2] *= -1;
-
+        membrane.planePoint2[0] *= -1;
 
 
-        console.log('DEBUG-02');
+        console.log('DEBUG-02', membrane.planePoint2);
 
         localStorage.setItem(MEMBRANE_STORAGE_KEY, JSON.stringify(membrane));
 

+ 2 - 0
src/extensions/tmdet/algorithm.ts

@@ -173,6 +173,8 @@ export async function calculate(runtime: RuntimeContext, structure: Structure, p
         planePoint2: membrane.planePoint2,
         stats: HphobHphil.initial(ctx)
     };
+    window.console.debug('candidate:', candidate);
+
     const extent = adjustExtent(ctx, candidate, center);
 
     return {

+ 6 - 1
webpack.config.common.js

@@ -21,7 +21,12 @@ const sharedConfig = {
                     { loader: 'css-loader', options: { sourceMap: false } },
                     { loader: 'sass-loader', options: { sourceMap: false } },
                 ]
-            }
+            },
+            {
+                test: /\.js$/,
+                enforce: 'pre',
+                use: ['source-map-loader'],
+            },
         ]
     },
     plugins: [