Git Product home page Git Product logo

Comments (6)

OWissett avatar OWissett commented on June 3, 2024 1

I have just had a look at the updated version of the lexer compared to one crates.io, looks much better since we should not get index errors causing panics! which is much better :)

from pdbtbx.

OWissett avatar OWissett commented on June 3, 2024

I also get this error:

thread 'structure::tests::from_pdbtbx' panicked at 'index out of bounds: the len is 67 but the index is 67', /home/sasa/.cargo/registry/src/github.com-1ecc6299db9ec823/pdbtbx-0.10.1/src/read/pdb/lexer.rs:723:31

After investigating the source code, the DBREF sections appear to be causing this problem.

Please let me know if I am doing something wrong? or is this an issue with the crate?

To me it seems like an issue with the crate, since I am using regular PDB files and following the documentation on how to load them

from pdbtbx.

OWissett avatar OWissett commented on June 3, 2024

Interim fix - DELETE the entire header

from pdbtbx.

douweschulte avatar douweschulte commented on June 3, 2024

Any crash is an issue with the crate. I will look into what is causing the issues and see if I can get a fix in. Thanks for opening the issue!

from pdbtbx.

douweschulte avatar douweschulte commented on June 3, 2024

It is a bit of an ugly fix but I lowered the level of the MASTER record mismatch so that ErrorLevel::Loose will not panic anymore on these errors. Because that was ultimately all that kept the file from running when I took the original PDB file. I can see you had more reported issues in your first crash, I could not replicate those. If these issues persist please send me the file you run so I can debug what is happening.

A bit of backstory, there are 2207 atoms (1931 ATOM + 276 HETATM of which 244 HOH) in the file but the MASTER record claims there are 2187. I have not yet found the definition which determines the MASTER record number.

As a side project I restructured the whole lexing code so that errors like the second crash are pretty much impossible (there are a handful of cases left out of the hundreds before). So thanks for the push I needed to clean up this code!

Side note: if you want to run the version of pdbtbx with this patch you will have to run it directly from git until a new release is made: pdbtbx = {git = "https://github.com/douweschulte/pdbtbx"}.

from pdbtbx.

douweschulte avatar douweschulte commented on June 3, 2024

Perfect! If any of the issues pops up again or you find any new ones, please open an issue again. Thanks again for sending it in!

from pdbtbx.

Related Issues (20)

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.