cycle20 1 рік тому
батько
коміт
a9bab647a1

+ 2 - 2
src/extensions/tmdet/symmetry.ts

@@ -27,13 +27,13 @@ function constructChainListFromOperations(pdbtmDescriptor: PDBTMDescriptor): str
     const excludedChains: string[] = [];
     // add chain deletes
     const biomatrix = pdbtmDescriptor.additional_entry_annotations.biomatrix;
-    if (biomatrix != undefined && biomatrix.chain_deletes != undefined) {
+    if (biomatrix?.chain_deletes) {
         biomatrix.chain_deletes.forEach(
             chainId => excludedChains.push(chainId)
         );
     }
     // exclude result of transformations
-    if (biomatrix != undefined && biomatrix.matrix_list != undefined) {
+    if (biomatrix?.matrix_list) {
         biomatrix.matrix_list.forEach(
             matrix => matrix.apply_to_chain_list.forEach(
                 applyItem => excludedChains.push(applyItem.new_chain_id)

+ 3 - 3
src/extensions/tmdet/transformation.ts

@@ -19,14 +19,14 @@ import { MembraneOrientation } from './prop';
 import { TmDetColorThemeProvider } from './tmdet-color-theme';
 import { DebugUtil } from '../../apps/tm-viewer';
 
-export async function applyTransformations(plugin: PluginUIContext, pdbtmDescriptor: PDBTMDescriptor) {
+export function applyTransformations(plugin: PluginUIContext, pdbtmDescriptor: PDBTMDescriptor) {
     const annotations = pdbtmDescriptor.additional_entry_annotations;
 
     const membraneTransformation = transformationForStateTransform(pdbtmDescriptor.additional_entry_annotations.membrane.transformation_matrix);
 
-    if (annotations.biomatrix) {
+    if (annotations?.biomatrix?.matrix_list) {
         annotations.biomatrix.matrix_list.forEach(function(mx) {
-            mx.apply_to_chain_list.forEach(async function(chainPair) {
+            mx.apply_to_chain_list.forEach(function(chainPair) {
                 let id  = chainPair.chain_id;
                 let newId = chainPair.new_chain_id;
                 const mtx = transformationForStateTransform(mx.transformation_matrix);