|
@@ -45,7 +45,7 @@ function constructChainListFromOperations(pdbtmDescriptor: PDBTMDescriptor): str
|
|
|
return excludedChains;
|
|
|
}
|
|
|
|
|
|
-function tmDetSymmetryFromMmCif(model: Model, chainsForOperExpression: string[]) {
|
|
|
+function tmDetSymmetryFromMmCif(model: Model, excludedChains: string[]) {
|
|
|
if (!MmcifFormat.is(model.sourceData)) return;
|
|
|
|
|
|
let data = model.sourceData.data.db;
|
|
@@ -53,8 +53,12 @@ function tmDetSymmetryFromMmCif(model: Model, chainsForOperExpression: string[])
|
|
|
// update chains (asym) for each author_defined_assemly
|
|
|
// NOTE: We assume that the first assembly is an author defined assembly.
|
|
|
const currentAssemblyId: string = data.pdbx_struct_assembly_gen.assembly_id.value(0);
|
|
|
+ excludedChains = union(
|
|
|
+ excludedChains,
|
|
|
+ Array.from(data.pdbx_nonpoly_scheme.asym_id.toArray())
|
|
|
+ );
|
|
|
const result: string[][] = createAsymIdColumnData(
|
|
|
- data.pdbx_struct_assembly_gen, currentAssemblyId, chainsForOperExpression
|
|
|
+ data.pdbx_struct_assembly_gen, currentAssemblyId, excludedChains
|
|
|
);
|
|
|
asymIdColumnData = asymIdColumnData.concat(result);
|
|
|
|
|
@@ -65,13 +69,26 @@ function tmDetSymmetryFromMmCif(model: Model, chainsForOperExpression: string[])
|
|
|
{
|
|
|
assembly_id: data.pdbx_struct_assembly_gen.assembly_id,
|
|
|
asym_id_list: asym_id_list_column,
|
|
|
- oper_expression: data.pdbx_struct_assembly_gen.oper_expression
|
|
|
+ //oper_expression: data.pdbx_struct_assembly_gen.oper_expression
|
|
|
+ // NOTE: we expect here pdbx_struct_assembly_gen has only one row
|
|
|
+ oper_expression: Column.ofStringArray([ '1' ])
|
|
|
}
|
|
|
);
|
|
|
+ DebugUtil.log('Orig. assembly_gen', Table.formatToString(data.pdbx_struct_assembly_gen));
|
|
|
+ DebugUtil.log('Updated assembly_gen', Table.formatToString(updated_pdbx_struct_assembly_gen));
|
|
|
+
|
|
|
+ DebugUtil.log('Oper expression:', data.pdbx_struct_assembly_gen.oper_expression.toArray());
|
|
|
+ DebugUtil.log('Non-poly entities:', Table.formatToString(data.pdbx_entity_nonpoly));
|
|
|
+ DebugUtil.log('Non-poly chains:', data.pdbx_nonpoly_scheme.asym_id.toArray());
|
|
|
|
|
|
- DebugUtil.log('Excluded chains:', chainsForOperExpression);
|
|
|
+ DebugUtil.log('Excluded chains:', excludedChains);
|
|
|
DebugUtil.log('Included chains:', result);
|
|
|
|
|
|
+ DebugUtil.log('oper_list table: original:', Table.formatToString(data.pdbx_struct_oper_list));
|
|
|
+ DebugUtil.log('oper_list table: first row', Table.formatToString(
|
|
|
+ Table.ofRows(data.pdbx_struct_oper_list._schema, [ Table.getRow(data.pdbx_struct_oper_list, 0) ]))
|
|
|
+ );
|
|
|
+
|
|
|
return ModelSymmetry.fromData({
|
|
|
symmetry: data.symmetry,
|
|
|
cell: data.cell,
|
|
@@ -102,3 +119,10 @@ function minus(a: string[], b: string[]): string[] {
|
|
|
const b_set = new Set(b);
|
|
|
return a.filter(x => !b_set.has(x));
|
|
|
}
|
|
|
+
|
|
|
+// union of two string arrays (interpreted as sets)
|
|
|
+function union(a: string[], b: string[]): string[] {
|
|
|
+ const a_set = new Set(a);
|
|
|
+ b.forEach(item => a_set.add(item));
|
|
|
+ return Array.from(a_set.values());
|
|
|
+}
|