Skip to content
Snippets Groups Projects
Commit 9416a887 authored by David Sehnal's avatar David Sehnal
Browse files

CIF export tweak

parent df6cc84e
Branches
Tags
No related merge requests found
...@@ -51,31 +51,32 @@ const entity: Encoder.CategoryDefinition<number, Entity> = { ...@@ -51,31 +51,32 @@ const entity: Encoder.CategoryDefinition<number, Entity> = {
const atom_site: Encoder.CategoryDefinition<Atom.Location> = { const atom_site: Encoder.CategoryDefinition<Atom.Location> = {
name: 'atom_site', name: 'atom_site',
fields: [ fields: [
str<Atom.Location>('group_PDB', P.residue.group_PDB), str('group_PDB', P.residue.group_PDB),
int<Atom.Location>('id', P.atom.id), int('id', P.atom.id),
str<Atom.Location>('type_symbol', P.atom.type_symbol as any), str('type_symbol', P.atom.type_symbol as any),
str<Atom.Location>('label_atom_id', P.atom.label_atom_id), str('label_atom_id', P.atom.label_atom_id),
str<Atom.Location>('label_alt_id', P.atom.label_alt_id), str('label_alt_id', P.atom.label_alt_id),
str<Atom.Location>('label_comp_id', P.residue.label_comp_id), str('label_comp_id', P.residue.label_comp_id),
int<Atom.Location>('label_seq_id', P.residue.label_seq_id), int('label_seq_id', P.residue.label_seq_id),
str<Atom.Location>('pdbx_PDB_ins_code', P.residue.pdbx_PDB_ins_code), str('pdbx_PDB_ins_code', P.residue.pdbx_PDB_ins_code),
str<Atom.Location>('label_asym_id', P.chain.label_asym_id), str('label_asym_id', P.chain.label_asym_id),
str<Atom.Location>('label_entity_id', P.chain.label_entity_id), str('label_entity_id', P.chain.label_entity_id),
float<Atom.Location>('Cartn_x', P.atom.x), float('Cartn_x', P.atom.x),
float<Atom.Location>('Cartn_y', P.atom.y), float('Cartn_y', P.atom.y),
float<Atom.Location>('Cartn_z', P.atom.z), float('Cartn_z', P.atom.z),
float<Atom.Location>('occupancy', P.atom.occupancy), float('occupancy', P.atom.occupancy),
str<Atom.Location>('pdbx_formal_charge', P.atom.pdbx_formal_charge), str('pdbx_formal_charge', P.atom.pdbx_formal_charge),
str<Atom.Location>('auth_atom_id', P.atom.auth_atom_id), str('auth_atom_id', P.atom.auth_atom_id),
str<Atom.Location>('auth_comp_id', P.residue.auth_comp_id), str('auth_comp_id', P.residue.auth_comp_id),
int<Atom.Location>('auth_seq_id', P.residue.auth_seq_id), int('auth_seq_id', P.residue.auth_seq_id),
str<Atom.Location>('auth_asym_id', P.chain.auth_asym_id), str('auth_asym_id', P.chain.auth_asym_id),
str<Atom.Location>('pdbx_operator_name', P.unit.operator_name), int('pdbx_PDB_model_num', P.unit.model_num),
str('pdbx_operator_name', P.unit.operator_name)
] ]
}; };
......
...@@ -68,7 +68,8 @@ const entity = { ...@@ -68,7 +68,8 @@ const entity = {
} }
const unit = { 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 = { const Properties = {
......
...@@ -241,9 +241,9 @@ export namespace PropertyAccess { ...@@ -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/1jj2_full.bcif');
//const { structures, models } = await readCIF('e:/test/quick/3j3q_updated.cif'); //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'); console.log('parsed');
...@@ -280,7 +280,9 @@ export namespace PropertyAccess { ...@@ -280,7 +280,9 @@ export namespace PropertyAccess {
chainTest: Q.pred.inSet(P.chain.auth_asym_id, ['A', 'B', 'C', 'D']), chainTest: Q.pred.inSet(P.chain.auth_asym_id, ['A', 'B', 'C', 'D']),
residueTest: Q.pred.eq(P.residue.auth_comp_id, 'ALA') 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') console.time('q1')
q1(structures[0]); q1(structures[0]);
console.timeEnd('q1') console.timeEnd('q1')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment