Browse Source

model-server: added optional assemblyName param to /residueInteraction

David Sehnal 4 years ago
parent
commit
30d34584bf
3 changed files with 16 additions and 4 deletions
  1. 5 0
      src/servers/model/CHANGELOG.md
  2. 10 3
      src/servers/model/server/api.ts
  3. 1 1
      src/servers/model/version.ts

+ 5 - 0
src/servers/model/CHANGELOG.md

@@ -1,3 +1,8 @@
+# 0.9.2
+* assemblyName in /residueInteraction
+* /ligand query
+* additional export encoding formats
+
 # 0.9.1
 * query-many
 * Config overhaul

+ 10 - 3
src/servers/model/server/api.ts

@@ -123,6 +123,12 @@ const RadiusParam: QueryParamInfo = {
     }
 };
 
+const AssemblyNameParam: QueryParamInfo = {
+    name: 'assembly_name',
+    type: QueryParamType.String,
+    description: 'Assembly name. If none is provided, crystal symmetry (where available) or deposited model is used.'
+};
+
 function Q<Params = any>(definition: Partial<QueryDefinition<Params>>) {
     return definition;
 }
@@ -179,7 +185,7 @@ const QueryMap = {
         }],
         filter: QuerySchemas.assembly
     }),
-    'residueInteraction': Q<{ atom_site: AtomSiteSchema, radius: number }>({
+    'residueInteraction': Q<{ atom_site: AtomSiteSchema, radius: number, assembly_name: string }>({
         niceName: 'Residue Interaction',
         description: 'Identifies all residues within the given radius from the source residue. Takes crystal symmetry into account.',
         query(p) {
@@ -193,10 +199,11 @@ const QueryMap = {
             return Queries.modifiers.includeSurroundings(center, { radius: p.radius !== void 0 ? p.radius : 5, wholeResidues: true });
         },
         structureTransform(p, s) {
+            if (p.assembly_name) return StructureSymmetry.buildAssembly(s, '' + p.assembly_name).run();
             return StructureSymmetry.builderSymmetryMates(s, p.radius !== void 0 ? p.radius : 5).run();
         },
-        jsonParams: [ AtomSiteTestJsonParam, RadiusParam ],
-        restParams: [ ...AtomSiteTestRestParams, RadiusParam ],
+        jsonParams: [ AtomSiteTestJsonParam, RadiusParam, AssemblyNameParam ],
+        restParams: [ ...AtomSiteTestRestParams, RadiusParam, AssemblyNameParam ],
         filter: QuerySchemas.interaction
     }),
     'residueSurroundings': Q<{ atom_site: AtomSiteSchema, radius: number }>({

+ 1 - 1
src/servers/model/version.ts

@@ -4,4 +4,4 @@
  * @author David Sehnal <david.sehnal@gmail.com>
  */
 
-export default '0.9.1';
+export default '0.9.2';