Closed brgstfzj closed 10 months ago
That sounds like a bug. At a minimum, the typos could be fixed.
I haven't been using any of the TOP/ITP code in years and I think today there are other tools available (MDAnalysis has a ITP parser, ParmED can probably do it, possibly gromologist #218 ). If you have an idea how to fix the problem please submit a pull request. Ping me as @orbeckst
so that I get a notification.
Please note that GromacsWrapper is an old package and maintenance is minimal — its core functionality is still good (running gromacs from Python scripts) but the "other stuff" like reading TOP files has not really kept up (and if anything I am considering removing it unless people contribute to maintenance).
@jandom you might have written the TOP/ITP code. Just in case you have any recollection of what you did there, I am pinging you ;-).
thanks for the info!
unfortunately your tool is the only one, that does not alter the parameters in any way when reading the file. The other tools like parmed an the itp parser from MDAnalysis perform somewhat of a calculation with it, that I would have to reverse to get the parameters in the .top file. so, please don't remove it :D
hahah, interesting – I'd be happy to give this a look over the weeknd. @brgstfzj thank you for reporting – are you under some pressing timeline to have this fixed?
@brgstfzj do you have an example input file to reproduce the problem? The topol.top you mentioned in your initial ticket. And your original observation is correct, the parameters are not read-in for angles.
Okay, here is an initial PR to resolve this – doing some good old test-driven development (TDD) to get this under control
example.txt here's a file :)
Fixed in PR #264
@brgstfzj thank you for reporting this error – as indicated above it should be now fixed. You should be able to install this repos 'develop' branch to consume the fixed code.
In terms of limitations: this only fixes the reader code, not the writer code, depending on your use case this may or may not be a problem.
I have a problem when I want to read the topology file to work with the angle values.
when reading a topology file and trying to access the angle values k_theta and theta_0, I run into an issue.
the parameters of the angles (ktheta and theta0) are not being read from the line. (it returns None for both) when changing the section name in the .top file from "angles" to "angletypes", it works.
this behaviour seems to be by design (see gromacs/fileformats/top.py line 474-526). for "angletypes" the parameters are read from the lines but for "angles" they are not...
(and sorry for being nit-picky, but the names of the parameters in your library for these two values are 'ktetha' and 'tetha0'. is this a typo? I think the name of the greek letter is "theta" in both cases.)
Thanks in advance!