Skip to content

[MINOR] Enable pdb_splitmodel to handle more than 9999 models #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

ntxxt
Copy link

@ntxxt ntxxt commented Mar 25, 2025

To solve this #170 issue

Copy link
Member

@joaomcteixeira joaomcteixeira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally disagree with this for the same reason expressed by @JoaoRodrigues here:

#170 (comment)

However, I understand what @amjjbonvin argued after. Still, I disagree with this PR as it deviates from the official PDB format. Users can quickly create their branch to apply this change locally if needed.

In any case, if this PR is to be accepted it should be as @JoaoRodrigues said afterwards in the issue and not in the current form of line[6:].

Good point, I'd still keep then the model number starting at position 11 but open-ended. Otherwise you will indeed parse bad files with numbers where they should not be and they might be interpreted wrong by different tools, e.g.

Cheers!

@amjjbonvin
Copy link
Member

amjjbonvin commented May 7, 2025 via email

Modified to read the model number from column 11 on
@amjjbonvin amjjbonvin requested review from joaomcteixeira and rvhonorato and removed request for mgiulini July 17, 2025 11:22
Copy link
Member

@rvhonorato rvhonorato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is a small edit but if merged represents a big shift in the philosophy of this project. pdb-tools has also strictly adhered to the PDB File Format and there is a lot of value on that.

My first suggestion would be to not merge this and to avoid using pdb-tools for this use case (with more than 9999 models, and any other that falls outside the format).

However, considering this project lives in the haddocking organization and that this was built by the group, to help the group, I think the need of the group should go above the PDB File Format.

Even tho it's not a major change, imo pdb-tools should be bumped to v3.0.0 if this gets merged, considering my point above.

@amjjbonvin
Copy link
Member

And to add to that, the current version, when encountering more than 9999 models will overwrite over models, e.g. model 11000 will be written as model 1000, overwriting the first instance of model 1000. And this without warning.

@amjjbonvin
Copy link
Member

amjjbonvin commented Jul 18, 2025

And while at it, pdb_mkensemble does allow for more than 9999 models... up to 99999 actually:

 fmt_MODEL = "MODEL    {:>5d}\n"

So to be consistent we could use here instead:

model_no = line[10:15].strip()

@ntxxt
Copy link
Author

ntxxt commented Jul 18, 2025

And to add to that, the current version, when encountering more than 9999 models will overwrite over models, e.g. model 11000 will be written as model 1000, overwriting the first instance of model 1000. And this without warning.

Yes. This is exactly what I found trying to do clustering with hd3 with more than 9999 models.

@rvhonorato rvhonorato changed the title Enable pdb_splitmodel to handel more than 9999 models [MINOR] Enable pdb_splitmodel to handle more than 9999 models Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants