Giter VIP home page Giter VIP logo

Comments (8)

arose avatar arose commented on August 25, 2024 1

Yeah it should. the spec could definitely use an overhaul.

from binarycif.

arose avatar arose commented on August 25, 2024

33 is for Float64 arrays

from binarycif.

BradyAJohnston avatar BradyAJohnston commented on August 25, 2024

This is my first time doing this kind of raw byte decoding, so I might be missing something here that is obvious, but why is this the case? Does 33 mean not 33? Are the data types specified as below?

ByteArray {
    kind = "ByteArray"
    type: Int8 | Int16 | Int32 | Uint8 | Uint16 | Uint32 | Float32 | Float64
 #  type:   1  |   2   |   3   |   4   |    5   |   6    |    7    |   33
}

from binarycif.

arose avatar arose commented on August 25, 2024

Not sure it is in the spec. Here is the normative implementation... https://github.com/molstar/molstar/blob/master/src/mol-io/common/binary-cif/encoding.ts#L60-L72

from binarycif.

BradyAJohnston avatar BradyAJohnston commented on August 25, 2024

Okay thanks for the additional clarification. Should this be something that is specified in the spec, if it's the official implementation?

from binarycif.

BradyAJohnston avatar BradyAJohnston commented on August 25, 2024

Are there any other little 'gotchas' you can think of while I'm tackling this?

from binarycif.

arose avatar arose commented on August 25, 2024

I'd look at the molstar implementation or this minimal python implementation https://gist.github.com/dsehnal/b06f5555fa9145da69fe69abfeab6eaf

from binarycif.

BradyAJohnston avatar BradyAJohnston commented on August 25, 2024

Ah many thanks. I was also doing a minimal numpy implementation, and the example you linked does exactly what I am after but they've done it much more cleanly than I had come up with. Wish I had googled a bit harder and I would have saved myself a weekend of tinkering.

Would be useful to have that minimal implementation linked in the README also.

from binarycif.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.