Skip to content
Snippets Groups Projects
Commit b74b7744 authored by Alexander Rose's avatar Alexander Rose
Browse files

cif schema updates

parent 066431b4
No related branches found
No related tags found
No related merge requests found
...@@ -80,12 +80,11 @@ and navigate to `build/viewer` ...@@ -80,12 +80,11 @@ and navigate to `build/viewer`
### Code generation ### Code generation
**CIF schemas** **CIF schemas**
Install CIFTools `npm install ciftools -g`
export NODE_PATH="build/src"; node build/src/apps/schema-generator/schema-from-cif-dic.js -ts -o src/mol-io/reader/cif/schema/mmcif.ts --fieldNamesPath data/mmcif-field-names.csv --name mmCIF cifschema -mip ../../../../mol-data -o src/mol-io/reader/cif/schema/mmcif.ts -p mmCIF
cifschema -mip ../../../../mol-data-o src/mol-io/reader/cif/schema/ccd.ts -p CCD
export NODE_PATH="build/src"; node build/src/apps/schema-generator/schema-from-cif-dic.js -ts -o src/mol-io/reader/cif/schema/ccd.ts --fieldNamesPath data/ccd-field-names.csv --name CCD cifschema -mip ../../../../mol-data -o src/mol-io/reader/cif/schema/bird.ts -p BIRD
export NODE_PATH="build/src"; node build/src/apps/schema-generator/schema-from-cif-dic.js -ts -o src/mol-io/reader/cif/schema/bird.ts --fieldNamesPath data/bird-field-names.csv --name BIRD
**GraphQL schemas** **GraphQL schemas**
......
/** /**
* Copyright (c) 2017-2018 mol* contributors, licensed under MIT, See LICENSE file for more info. * Copyright (c) 2017-2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
* *
* Code-generated 'BIRD' schema file. Dictionary versions: mmCIF 5.309, IHM 0.141, CARB draft. * Code-generated 'BIRD' schema file. Dictionary versions: mmCIF 5.311, IHM 1.0, CARB draft.
* *
* @author mol-star package (src/apps/schema-generator/generate) * @author molstar/ciftools package
*/ */
import { Database, Column } from '../../../../mol-data/db' import { Database, Column } from '../../../../mol-data/db'
...@@ -84,6 +84,10 @@ export const BIRD_Schema = { ...@@ -84,6 +84,10 @@ export const BIRD_Schema = {
* corresponding to the chemical definition for the molecule. * corresponding to the chemical definition for the molecule.
*/ */
chem_comp_id: str, chem_comp_id: str,
/**
* Special details about this molecule.
*/
compound_details: str,
/** /**
* Description of this molecule. * Description of this molecule.
*/ */
......
/** /**
* Copyright (c) 2017-2018 mol* contributors, licensed under MIT, See LICENSE file for more info. * Copyright (c) 2017-2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
* *
* Code-generated 'CCD' schema file. Dictionary versions: mmCIF 5.309, IHM 0.141, CARB draft. * Code-generated 'CCD' schema file. Dictionary versions: mmCIF 5.311, IHM 1.0, CARB draft.
* *
* @author mol-star package (src/apps/schema-generator/generate) * @author molstar/ciftools package
*/ */
import { Database, Column } from '../../../../mol-data/db' import { Database, Column } from '../../../../mol-data/db'
...@@ -167,6 +167,10 @@ export const CCD_Schema = { ...@@ -167,6 +167,10 @@ export const CCD_Schema = {
* Date component was last modified. * Date component was last modified.
*/ */
pdbx_modified_date: str, pdbx_modified_date: str,
/**
* This data item holds the current release status for the component.
*/
pdbx_release_status: Aliased<'REL' | 'HOLD' | 'HPUB' | 'OBS' | 'DEL' | 'REF_ONLY'>(str),
/** /**
* This data item identifies the deposition site that processed * This data item identifies the deposition site that processed
* this chemical component defintion. * this chemical component defintion.
......
This diff is collapsed.
...@@ -329,6 +329,17 @@ function splitTable<T extends Table<any>>(table: T, col: Column<number>) { ...@@ -329,6 +329,17 @@ function splitTable<T extends Table<any>>(table: T, col: Column<number>) {
return ret; return ret;
} }
function getModelGroupName(model_id: number, format: mmCIF_Format) {
const { ihm_model_group, ihm_model_group_link } = format.data;
const link = Table.pickRow(ihm_model_group_link, i => ihm_model_group_link.model_id.value(i) === model_id)
if (link) {
const group = Table.pickRow(ihm_model_group, i => ihm_model_group.id.value(i) === link.group_id)
if (group) return group.name
}
return ''
}
async function readIHM(ctx: RuntimeContext, format: mmCIF_Format, formatData: FormatData) { async function readIHM(ctx: RuntimeContext, format: mmCIF_Format, formatData: FormatData) {
// when `atom_site.ihm_model_id` is undefined fall back to `atom_site.pdbx_PDB_model_num` // when `atom_site.ihm_model_id` is undefined fall back to `atom_site.pdbx_PDB_model_num`
const atom_sites_modelColumn = format.data.atom_site.ihm_model_id.isDefined ? format.data.atom_site.ihm_model_id : format.data.atom_site.pdbx_PDB_model_num const atom_sites_modelColumn = format.data.atom_site.ihm_model_id.isDefined ? format.data.atom_site.ihm_model_id : format.data.atom_site.pdbx_PDB_model_num
...@@ -345,7 +356,7 @@ async function readIHM(ctx: RuntimeContext, format: mmCIF_Format, formatData: Fo ...@@ -345,7 +356,7 @@ async function readIHM(ctx: RuntimeContext, format: mmCIF_Format, formatData: Fo
const models: Model[] = []; const models: Model[] = [];
const { model_id, model_name, model_group_name } = ihm_model_list; const { model_id, model_name } = ihm_model_list;
for (let i = 0; i < ihm_model_list._rowCount; i++) { for (let i = 0; i < ihm_model_list._rowCount; i++) {
const id = model_id.value(i); const id = model_id.value(i);
...@@ -364,7 +375,7 @@ async function readIHM(ctx: RuntimeContext, format: mmCIF_Format, formatData: Fo ...@@ -364,7 +375,7 @@ async function readIHM(ctx: RuntimeContext, format: mmCIF_Format, formatData: Fo
const data: IHMData = { const data: IHMData = {
model_id: id, model_id: id,
model_name: model_name.value(i), model_name: model_name.value(i),
model_group_name: model_group_name.value(i), model_group_name: getModelGroupName(id, format),
entities: entities, entities: entities,
atom_site, atom_site,
atom_site_sourceIndex, atom_site_sourceIndex,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment