Skip to content
Snippets Groups Projects
Select Git revision
  • fe8530771699c2d4f56230df46cbc79cef735cc2
  • master default protected
  • rednatco-v2
  • base-pairs-ladder
  • rednatco
  • test
  • ntc-tube-uniform-color
  • ntc-tube-missing-atoms
  • restore-vertex-array-per-program
  • watlas2
  • dnatco_new
  • cleanup-old-nodejs
  • webmmb
  • fix_auth_seq_id
  • update_deps
  • ext_dev
  • ntc_balls
  • nci-2
  • plugin
  • bugfix-0.4.5
  • nci
  • v0.5.0-dev.1
  • v0.4.5
  • v0.4.4
  • v0.4.3
  • v0.4.2
  • v0.4.1
  • v0.4.0
  • v0.3.12
  • v0.3.11
  • v0.3.10
  • v0.3.9
  • v0.3.8
  • v0.3.7
  • v0.3.6
  • v0.3.5
  • v0.3.4
  • v0.3.3
  • v0.3.2
  • v0.3.1
  • v0.3.0
41 results

cif.ts

Blame
  • user avatar
    Alexander Rose authored
    fe853077
    History
    cif.ts 1.10 KiB
    /**
     * 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'
    import parseBinary from './cif/binary/parser'
    import { Frame } from './cif/data-model'
    import { toDatabaseCollection, toDatabase } from './cif/schema'
    import { mmCIF_Schema, mmCIF_Database } from './cif/schema/mmcif'
    import { CCD_Schema, CCD_Database } from './cif/schema/ccd'
    import { BIRD_Schema, BIRD_Database } from './cif/schema/bird'
    
    export default {
        parse: (data: string|Uint8Array) => typeof data === 'string' ? parseText(data) : parseBinary(data),
        parseText,
        parseBinary,
        toDatabaseCollection,
        toDatabase,
        schema: {
            mmCIF: (frame: Frame) => toDatabase<mmCIF_Schema, mmCIF_Database>(mmCIF_Schema, frame),
            CCD: (frame: Frame) => toDatabase<CCD_Schema, CCD_Database>(CCD_Schema, frame),
            BIRD: (frame: Frame) => toDatabase<BIRD_Schema, BIRD_Database>(BIRD_Schema, frame)
        }
    }
    
    export * from './cif/data-model'