1

I would like to use the python wrapper for packmol (MDAPackmol) for my research. In order to do so, I have tried to work with the example code and pdb files provided on GitHub so I can gain an understanding of the how to use the wrapper. However, when I run the code, I receive the following error message: ValueError: invalid literal for int() with base 10.

Here is the full trace back:

full trace back

The error originates at start.resname being a zero-length string. It seems to be a problem with the resname having a number and a letter and thus is a problem with Universe (the object returned by load_packmol_output). Thus, there is a problem with the residues. I am now wondering if this is an error with how MDAnalysis is downloaded/installed or a missing dependency. Any advice or insight would be greatly appreciated. Thanks!

BioGeek
  • 21,897
  • 23
  • 83
  • 145
bioinf99
  • 11
  • 4
  • Can you update your question with full stacktrace of your error. I am unable to reproduce your ValueError. And just to make sure, you are using `['inside box 0. 0. 0. 40. 40. 40.']` as instruction (a `str` inside a `list`) instead of what you posted, right? – BioGeek Jul 08 '20 at 09:35
  • Thank you for you comment. Yes, that is what I am using. Sorry for the typo. – bioinf99 Jul 08 '20 at 14:23

1 Answers1

0

I can't really reproduce your error, but let's work backward from your stacktrace.

enter image description here

We're on line 184 in mdapackmol.py. The part that fails is int(start.resname[1:]). If I run the example code, then start.resname is equal to R0, so start.resname[1:] is '0' and int(start.resname[1:]) is 0.

enter image description here

In your case, start.resname is probably something like R, so start.resname[1:] is '' and int(start.resname[1:]) then fails with a ValueError.

The rest of your stacktrace doesn't provide enough information to deduce why your start.resname doesn't have the desired format. But try to run your code in an editor with debugging support (like for example VSCode like I did in the screenshot above), add ample breakpoints and try to step through your code and the MDAPackmolCode until you find where things go wrong

BioGeek
  • 21,897
  • 23
  • 83
  • 145
  • Thank you so much! I will try what you suggested. Glad the wrapper should work: this will really help my group out. – bioinf99 Jul 11 '20 at 15:25