diff --git a/src/mol-data/structure/export/mmcif.ts b/src/mol-data/structure/export/mmcif.ts index 47e54ac0b41825ba26d7ac7549ed11bf46d986f0..d3fb005b040bf5fcf146b59f468b284dadc8f95d 100644 --- a/src/mol-data/structure/export/mmcif.ts +++ b/src/mol-data/structure/export/mmcif.ts @@ -51,31 +51,32 @@ const entity: Encoder.CategoryDefinition<number, Entity> = { const atom_site: Encoder.CategoryDefinition<Atom.Location> = { name: 'atom_site', fields: [ - str<Atom.Location>('group_PDB', P.residue.group_PDB), - int<Atom.Location>('id', P.atom.id), - str<Atom.Location>('type_symbol', P.atom.type_symbol as any), - str<Atom.Location>('label_atom_id', P.atom.label_atom_id), - str<Atom.Location>('label_alt_id', P.atom.label_alt_id), - - str<Atom.Location>('label_comp_id', P.residue.label_comp_id), - int<Atom.Location>('label_seq_id', P.residue.label_seq_id), - str<Atom.Location>('pdbx_PDB_ins_code', P.residue.pdbx_PDB_ins_code), - - str<Atom.Location>('label_asym_id', P.chain.label_asym_id), - str<Atom.Location>('label_entity_id', P.chain.label_entity_id), - - float<Atom.Location>('Cartn_x', P.atom.x), - float<Atom.Location>('Cartn_y', P.atom.y), - float<Atom.Location>('Cartn_z', P.atom.z), - float<Atom.Location>('occupancy', P.atom.occupancy), - str<Atom.Location>('pdbx_formal_charge', P.atom.pdbx_formal_charge), - - str<Atom.Location>('auth_atom_id', P.atom.auth_atom_id), - str<Atom.Location>('auth_comp_id', P.residue.auth_comp_id), - int<Atom.Location>('auth_seq_id', P.residue.auth_seq_id), - str<Atom.Location>('auth_asym_id', P.chain.auth_asym_id), - - str<Atom.Location>('pdbx_operator_name', P.unit.operator_name), + str('group_PDB', P.residue.group_PDB), + int('id', P.atom.id), + str('type_symbol', P.atom.type_symbol as any), + str('label_atom_id', P.atom.label_atom_id), + str('label_alt_id', P.atom.label_alt_id), + + str('label_comp_id', P.residue.label_comp_id), + int('label_seq_id', P.residue.label_seq_id), + str('pdbx_PDB_ins_code', P.residue.pdbx_PDB_ins_code), + + str('label_asym_id', P.chain.label_asym_id), + str('label_entity_id', P.chain.label_entity_id), + + float('Cartn_x', P.atom.x), + float('Cartn_y', P.atom.y), + float('Cartn_z', P.atom.z), + float('occupancy', P.atom.occupancy), + str('pdbx_formal_charge', P.atom.pdbx_formal_charge), + + str('auth_atom_id', P.atom.auth_atom_id), + str('auth_comp_id', P.residue.auth_comp_id), + int('auth_seq_id', P.residue.auth_seq_id), + str('auth_asym_id', P.chain.auth_asym_id), + + int('pdbx_PDB_model_num', P.unit.model_num), + str('pdbx_operator_name', P.unit.operator_name) ] }; diff --git a/src/mol-data/structure/query/properties.ts b/src/mol-data/structure/query/properties.ts index 5b396b4a412cd160173da8f7839cbe0ceb9e70ef..87cfa8cec12ca175e6dbba9650f2501def27754d 100644 --- a/src/mol-data/structure/query/properties.ts +++ b/src/mol-data/structure/query/properties.ts @@ -68,7 +68,8 @@ const entity = { } const unit = { - operator_name: Atom.property(l => l.unit.operator.name) + operator_name: Atom.property(l => l.unit.operator.name), + model_num: Atom.property(l => l.unit.model.modelNum) } const Properties = { diff --git a/src/perf-tests/structure.ts b/src/perf-tests/structure.ts index d5815068f30a017f8a76c0eb00f3e2fe9758aba0..613782de8cdfbebcdfc64ca7da89bc6da17e1a8e 100644 --- a/src/perf-tests/structure.ts +++ b/src/perf-tests/structure.ts @@ -241,9 +241,9 @@ export namespace PropertyAccess { //const { structures, models } = await readCIF('e:/test/quick/1jj2_full.bcif'); //const { structures, models } = await readCIF('e:/test/quick/3j3q_updated.cif'); - console.log(toMmCIFString('test', structures[0])); + // console.log(toMmCIFString('test', structures[0])); - return; + // return; console.log('parsed'); @@ -280,7 +280,9 @@ export namespace PropertyAccess { chainTest: Q.pred.inSet(P.chain.auth_asym_id, ['A', 'B', 'C', 'D']), residueTest: Q.pred.eq(P.residue.auth_comp_id, 'ALA') }); - q(structures[0]); + const q0r = q(structures[0]); + console.log(toMmCIFString('test', Selection.union(q0r))); + console.time('q1') q1(structures[0]); console.timeEnd('q1')