소스 검색

added CCD schema

Alexander Rose 7 년 전
부모
커밋
c73f68023f
3개의 변경된 파일156개의 추가작업 그리고 2개의 파일을 삭제
  1. 60 0
      data/ccd-field-names.csv
  2. 5 2
      src/mol-io/reader/cif.ts
  3. 91 0
      src/mol-io/reader/cif/schema/ccd.ts

+ 60 - 0
data/ccd-field-names.csv

@@ -0,0 +1,60 @@
+chem_comp.id
+chem_comp.name
+chem_comp.type
+chem_comp.pdbx_type
+chem_comp.formula
+chem_comp.mon_nstd_parent_comp_id
+chem_comp.pdbx_synonyms
+chem_comp.pdbx_formal_charge
+chem_comp.pdbx_initial_date
+chem_comp.pdbx_modified_date
+chem_comp.pdbx_ambiguous_flag
+chem_comp.pdbx_release status
+chem_comp.pdbx_replaced_by
+chem_comp.pdbx_replaces
+chem_comp.formula_weight
+chem_comp.one_letter_code
+chem_comp.three_letter_code
+chem_comp.pdbx_model_coordinates_details
+chem_comp.pdbx_model_coordinates_missing_flag
+chem_comp.pdbx_ideal_coordinates_details
+chem_comp.pdbx_ideal_coordinates_missing_flag
+chem_comp.pdbx_model_coordinates_db_code
+chem_comp.pdbx_processing_site
+
+chem_comp_atom.comp_id
+chem_comp_atom.atom_id
+chem_comp_atom.alt_atom_id
+chem_comp_atom.type_symbol
+chem_comp_atom.charge
+chem_comp_atom.pdbx_align
+chem_comp_atom.pdbx_aromatic_flag
+chem_comp_atom.pdbx_leaving_atom_flag
+chem_comp_atom.pdbx_stereo_config
+chem_comp_atom.model_Cartn_x
+chem_comp_atom.model_Cartn_y
+chem_comp_atom.model_Cartn_z
+chem_comp_atom.pdbx_model_Cartn_x_ideal
+chem_comp_atom.pdbx_model_Cartn_y_ideal
+chem_comp_atom.pdbx_model_Cartn_z_ideal
+chem_comp_atom.pdbx_ordinal
+
+chem_comp_bond.comp_id
+chem_comp_bond.atom_id_1
+chem_comp_bond.atom_id_2
+chem_comp_bond.value_order
+chem_comp_bond.pdbx_aromatic_flag
+chem_comp_bond.pdbx_stereo_config
+chem_comp_bond.pdbx_ordinal
+
+pdbx_chem_comp_descriptor.comp_id
+pdbx_chem_comp_descriptor.type
+pdbx_chem_comp_descriptor.program
+pdbx_chem_comp_descriptor.program_version
+pdbx_chem_comp_descriptor.descriptor
+
+pdbx_chem_comp_identifier.comp_id
+pdbx_chem_comp_identifier.type 
+pdbx_chem_comp_identifier.program
+pdbx_chem_comp_identifier.program_version
+pdbx_chem_comp_identifier.identifier

+ 5 - 2
src/mol-io/reader/cif.ts

@@ -1,7 +1,8 @@
 /**
- * Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ * Copyright (c) 2017-2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
  *
  * @author David Sehnal <david.sehnal@gmail.com>
+ * @author Alexander Rose <alexander.rose@weirdbyte.de>
  */
 
 import parseText from './cif/text/parser'
@@ -9,13 +10,15 @@ import parseBinary from './cif/binary/parser'
 import { Frame } from './cif/data-model'
 import { toDatabase } from './cif/schema'
 import { mmCIF_Schema, mmCIF_Database } from './cif/schema/mmcif'
+import { CCD_Schema, CCD_Database } from './cif/schema/ccd'
 
 export default {
     parseText,
     parseBinary,
     toDatabase,
     schema: {
-        mmCIF: (frame: Frame) => toDatabase<mmCIF_Schema, mmCIF_Database>(mmCIF_Schema, frame)
+        mmCIF: (frame: Frame) => toDatabase<mmCIF_Schema, mmCIF_Database>(mmCIF_Schema, frame),
+        CCD: (frame: Frame) => toDatabase<CCD_Schema, CCD_Database>(CCD_Schema, frame)
     }
 }
 

+ 91 - 0
src/mol-io/reader/cif/schema/ccd.ts

@@ -0,0 +1,91 @@
+/**
+ * Copyright (c) 2017-2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ *
+ * Code-generated 'CCD' schema file
+ *
+ * @author mol-star package (src/apps/schema-generator/generate)
+ */
+
+import { Database, Column } from 'mol-data/db'
+
+import Schema = Column.Schema
+
+const str = Schema.str;
+const int = Schema.int;
+const float = Schema.float;
+const coord = Schema.coord;
+
+const Aliased = Schema.Aliased;
+// const Matrix = Schema.Matrix;
+// const Vector = Schema.Vector;
+
+export const CCD_Schema = {
+    chem_comp: {
+        formula: str,
+        formula_weight: float,
+        id: str,
+        mon_nstd_parent_comp_id: str,
+        name: str,
+        one_letter_code: str,
+        three_letter_code: str,
+        type: str,
+        pdbx_synonyms: str,
+        pdbx_type: str,
+        pdbx_ambiguous_flag: str,
+        pdbx_replaced_by: str,
+        pdbx_replaces: str,
+        pdbx_formal_charge: int,
+        pdbx_model_coordinates_details: str,
+        pdbx_model_coordinates_db_code: str,
+        pdbx_ideal_coordinates_details: str,
+        pdbx_ideal_coordinates_missing_flag: Aliased<'Y' | 'N'>(str),
+        pdbx_model_coordinates_missing_flag: Aliased<'Y' | 'N'>(str),
+        pdbx_initial_date: str,
+        pdbx_modified_date: str,
+        pdbx_processing_site: str,
+    },
+    chem_comp_atom: {
+        alt_atom_id: str,
+        atom_id: str,
+        charge: int,
+        model_Cartn_x: coord,
+        model_Cartn_y: coord,
+        model_Cartn_z: coord,
+        comp_id: str,
+        type_symbol: str,
+        pdbx_align: int,
+        pdbx_ordinal: int,
+        pdbx_model_Cartn_x_ideal: coord,
+        pdbx_model_Cartn_y_ideal: coord,
+        pdbx_model_Cartn_z_ideal: coord,
+        pdbx_stereo_config: Aliased<'R' | 'S' | 'N'>(str),
+        pdbx_aromatic_flag: Aliased<'Y' | 'N'>(str),
+        pdbx_leaving_atom_flag: Aliased<'Y' | 'N'>(str),
+    },
+    chem_comp_bond: {
+        atom_id_1: str,
+        atom_id_2: str,
+        comp_id: str,
+        value_order: Aliased<'sing' | 'doub' | 'trip' | 'quad' | 'arom' | 'poly' | 'delo' | 'pi'>(str),
+        pdbx_ordinal: int,
+        pdbx_stereo_config: Aliased<'E' | 'Z' | 'N'>(str),
+        pdbx_aromatic_flag: Aliased<'Y' | 'N'>(str),
+    },
+    pdbx_chem_comp_descriptor: {
+        comp_id: str,
+        descriptor: str,
+        type: str,
+        program: str,
+        program_version: str,
+    },
+    pdbx_chem_comp_identifier: {
+        comp_id: str,
+        identifier: str,
+        type: str,
+        program: str,
+        program_version: str,
+    },
+}
+
+export type CCD_Schema = typeof CCD_Schema;
+export interface CCD_Database extends Database<CCD_Schema> { }