TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

273 views
Skip to first unread message

Yuri Piven

unread,
Mar 20, 2022, 11:47:45 AM3/20/22
to gmx_MMPBSA
Hi there!

I got the following error while  working with protein-ligand complex. It seems that this error appears only when complex (same protein in all cases) contain certain type of ligand. With most ligands, calculations goes fine.
Calculation were performed using trajectories from gromacs 2022.


[INFO   ] 20 frames were processed by cpptraj for use in calculation.

[INFO   ] Running calculations on normal system...
[INFO   ] Beginning GB calculations with /home/piven/miniconda3/bin/sander
[INFO   ]   calculating complex contribution...
[INFO   ]   calculating receptor contribution...
[INFO   ]   calculating ligand contribution...
[INFO   ] Parsing results to output files...

  File "/home/piven/miniconda3/bin/gmx_MMPBSA", line 8, in <module>
    sys.exit(gmxmmpbsa())
  File "/home/piven/miniconda3/lib/python3.9/site-packages/GMXMMPBSA/app.py", line 113, in gmxmmpbsa
    app.write_final_outputs()
  File "/home/piven/miniconda3/lib/python3.9/site-packages/GMXMMPBSA/main.py", line 601, in write_final_outputs
    write_outputs(self)
  File "/home/piven/miniconda3/lib/python3.9/site-packages/GMXMMPBSA/output_file.py", line 339, in write_outputs
    final_output.writeline(sys_norm.report_inconsistency())
  File "/home/piven/miniconda3/lib/python3.9/site-packages/GMXMMPBSA/output_file.py", line 668, in writeline
    self.write(line + ls)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Exiting. All files have been retained.
gmx_MMPBSA.log

marioe911116

unread,
Mar 20, 2022, 1:25:34 PM3/20/22
to gmx_MMPBSA
Hi there! could you please send us an example (files) of where this occurs? 

cheers!

Yuri Piven

unread,
Mar 20, 2022, 1:55:33 PM3/20/22
to gmx_MMPBSA

It seems that this error occurs in the same cases when previos version  (1.4.3) gave warning  "WARNING: INCONSISTENCIES EXIST WITHIN INTERNAL POTENTIAL
TERMS. THE VALIDITY OF THESE RESULTS ARE HIGHLY QUESTIONABLE"

воскресенье, 20 марта 2022 г. в 20:25:34 UTC+3, marioe911116:

marioe911116

unread,
Mar 20, 2022, 3:10:43 PM3/20/22
to gmx_MMPBSA
We already fixed the problem (https://github.com/Valdes-Tresanco-MS/gmx_MMPBSA/commit/5c226f42dafa26980ffe0202dc7d642bf89cb9b1)... The problem was in the function that reports the inconsistency warning... please update gmx_MMPBSA from GitHub as follows:


PS: We report inconsistencies in single trajectory protocol when the |average| for any of the internal components (i.e. bond, angle, dihedral) is greater than 0.005... In theory, when using STP the difference in the internal elements should be 0... in your case, the average for dihedral is 0.006 and that's why the inconsistency is reported... in the output file the different components are reported with only 2 significant figures, and that's why you don't see anything weird with the internal potentials... Ultimately, is up to you to decide whether to move forward or not with these results...

cheers!

marioe911116

unread,
Mar 20, 2022, 3:49:23 PM3/20/22
to gmx_MMPBSA
Just a quick note: I was checking more in detail the code and the inconsistencies are reported when any of the |differences| for a given component is greater than 0.005... in your case, the differences obtained for the dihedral component are:

[ 0.0071 -0.0003 -0.017  -0.0078  0.0003  0.0042 -0.009  -0.0009 -0.0051 -0.0342  0.0026 -0.0127 -0.0012 -0.0053  0.001   0.0001 -0.0258  0.0115 0.0041 -0.0091]

as you can see, there are some values whose absolute value is greater than 0.005 and that's why the inconsistency is reported... This should not happen when using STP as differences very close to 0 are expected for the internal potentials... as an example, see the differences obtained for the bond potential in your system:

BOND [-1.00000000e-04 -1.00000000e-04 -2.48689958e-14 -2.13162821e-14 -1.00000000e-04 -7.10542736e-15 -7.10542736e-15 -1.00000000e-04 3.55271368e-14  4.08562073e-14 -9.99999999e-05  3.55271368e-15 6.57252031e-14 
-1.00000000e-04 -8.88178420e-15 -6.39488462e-14 1.00000000e-04 -7.28306304e-14  5.32907052e-14  1.42108547e-14]

hope this helps!

Yuri Piven

unread,
Mar 20, 2022, 4:12:06 PM3/20/22
to gmx_MMPBSA
Thank you very much  for detailed response and fast fix.


With best regards
Yuri

воскресенье, 20 марта 2022 г. в 22:49:23 UTC+3, marioe911116:
Reply all
Reply to author
Forward
0 new messages