|
@@ -9,6 +9,7 @@ import mmCIF from '../../../mol-io/reader/cif/schema/mmcif'
|
|
|
import Model from '../../model'
|
|
|
import Interval from '../../../mol-base/collections/integer/interval'
|
|
|
import Segmentation from '../../../mol-base/collections/integer/segmentation'
|
|
|
+import uuId from '../../../mol-base/utils/uuid'
|
|
|
|
|
|
function findModelBounds(data: mmCIF, startIndex: number) {
|
|
|
const num = data.atom_site.pdbx_PDB_model_num;
|
|
@@ -23,7 +24,7 @@ function segment(data: mmCIF, bounds: Interval) {
|
|
|
const start = Interval.start(bounds), end = Interval.end(bounds);
|
|
|
const residues = [0], chains = [0], entities = [0];
|
|
|
|
|
|
- const { label_entity_id, auth_asym_id, auth_seq_id, pdbx_PDB_ins_code } = data.atom_site;
|
|
|
+ const { label_entity_id, auth_asym_id, auth_seq_id, pdbx_PDB_ins_code, label_comp_id } = data.atom_site;
|
|
|
|
|
|
let offset = 1;
|
|
|
for (let i = start + 1; i < end; i++) {
|
|
@@ -31,7 +32,8 @@ function segment(data: mmCIF, bounds: Interval) {
|
|
|
const newChain = newEntity || !auth_asym_id.areValuesEqual(i - 1, i);
|
|
|
const newResidue = newChain
|
|
|
|| !auth_seq_id.areValuesEqual(i - 1, i)
|
|
|
- || !pdbx_PDB_ins_code.areValuesEqual(i - 1, i);
|
|
|
+ || !pdbx_PDB_ins_code.areValuesEqual(i - 1, i)
|
|
|
+ || !label_comp_id.areValuesEqual(i - 1, i);
|
|
|
|
|
|
if (newEntity) entities[entities.length] = offset;
|
|
|
if (newResidue) residues[residues.length] = offset;
|
|
@@ -53,9 +55,12 @@ function segment(data: mmCIF, bounds: Interval) {
|
|
|
function createModel(raw: RawData, data: mmCIF, bounds: Interval): Model {
|
|
|
const segments = segment(data, bounds);
|
|
|
return {
|
|
|
+ id: uuId(),
|
|
|
sourceData: raw,
|
|
|
common: 0 as any,
|
|
|
macromolecule: 0 as any,
|
|
|
+ conformation: 0 as any,
|
|
|
+ version: { data: 0, conformation: 0 },
|
|
|
atomCount: Interval.size(bounds),
|
|
|
segments
|
|
|
};
|