Closed sperezconesa closed 4 years ago
Thank you for the alert!
I'm looking at http://manual.gromacs.org/2019-current/onlinehelp/gmx-trjconv.html and I don't see a way to specify the group from the command line and avoid terminal I/O. A proper solution to this may require modernization of the facilities accessible through trjconv
.
Do you have a suggestion for an update to the gmxapi.commandline_operation()
interface that would address your issue? Would it be sufficient to allow a string to be passed to STDIN?
Also, note that this sort of functionality (trjconv
) is not very vigorously supported by GROMACS developers, but is part of the core purpose of projects like MDAnalysis and MDTraj.
I'm looking at http://manual.gromacs.org/2019-current/onlinehelp/gmx-trjconv.html and I don't see a way to specify the group from the command line and avoid terminal I/O. A proper solution to this may require modernization of the facilities accessible through trjconv.
Trjconv according to the gmx output when you run it will be severely modified in the future (I am not sure if they have an ETA on this...). Probably they should keep this in mind.
Do you have a suggestion for an update to the gmxapi.commandline_operation() interface that would address your issue? Would it be sufficient to allow a string to be passed to STDIN?
This would be enough, it is essentially what I used to do using subprocess or another library that calls the the terminal.
Also, note that this sort of functionality (trjconv) is not very vigorously supported by GROMACS developers, but is part of the core purpose of projects like MDAnalysis and MDTraj. I use MDAnalysis all the time but I like to use trjconv for the initial trajectory modifications since it is much faster than MDAnalysis. After I do this, most stuff I do with MDAnalysis.
Thanks for the help and I really like the work you have done with the API. I look forward to meeting you in Stockholm in a few weeks.
Permitting a string input for command-line operations sounds like the right solution.
Best, --Peter
How about this?
stdin (str): String input to send to STDIN (terminal input) of the executable.
Multiline text sent to stdin should be joined into a single string (e.g. '\n'.join(list_of_strings)
). If multiple strings are provided to stdin, gmxapi will assume an ensemble, and will run one operation for each provided string.
Only string input (:py:func:str
) is currently supported. If you have a use case that requires streaming input or binary input, please open an issue or contact the author(s).
This looks awesome!
The change has been merged to GROMACS master
branch. I will abandon PR #257 and merge from upstream. I will update pypi with a gmxapi 0.2b1 tomorrow, but you can test the new package from the GROMACS master branch or the PR branch. Please let us know if it does not work as expected.
I have updated PyPI with a prerelease package that you can install with
pip install --pre gmxapi==0.2.0a1
To weigh in on whether this should be back-ported to gmxapi 0.1 and GROMACS 2020 release branches, please comment at https://redmine.gromacs.org/issues/3393
I have tryed it out and it works great! I have never used redmine. Should I just comment on why I find this is usefull and should be incorporated to the repository? Do some people believe it shouldn't?
Thanks! The question to be discussed on redmine, if I understand correctly, is whether this is a sufficient "bugfix" to incorporate into Gromacs 2020 or whether it counts more as a "new feature" and should be kept in Gromacs master and targeted towards Gromacs 2021.
Best, --Peter
Peter Kasson, MD, PhD Associate Professor Departments of Molecular Physiology and Biological Physics and of Biomedical Engineering University of Virginia and Department of Cell and Molecular Biology, Uppsala University
On Tue, Feb 25, 2020 at 7:33 AM Sergio Pérez Conesa < notifications@github.com> wrote:
I have tryed it out and it works great! I have never used redmine. Should I just comment on why I find this is usefull and should be incorporated to the repository? Do some people believe it shouldn't?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kassonlab/gmxapi/issues/255?email_source=notifications&email_token=ACRWZNJBQQAIJ5Y4JEGZPFLREU23TA5CNFSM4KWTUNKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM4NF3Y#issuecomment-590926575, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRWZNMSSS2ST6ZVC2QS7Q3REU23TANCNFSM4KWTUNKA .
Right, sorry for the lack of clarity.
The question is basically "should GROMACS 2020.1 (or 2020.2) include a gmxapi 0.1.1 version with this feature?" or "will this be a pre-release feature until gmxapi 0.2 is tagged, which might not happen until GROMACS 2021 is released?"
If you are happy the way things are, then I can revise my suggested install command for posterity.
To get the most recent gmxapi package, including pre-release versions, you can run
pip install --upgrade --pre gmxapi
To update if and only if an official 0.2+ tagged release is available, you could use
pip install --upgrade "gmxapi>=0.2.0a1"
Dear gmxapi users, I am trying to wrap trajectories trough python and I get an error when gmx is asking for user input through the commandline for example. If I run:
I get as outpu:
How can I select the group? Thanks a lot! Sergio