Skip to content

Commit

Permalink
feat: expose create_plumed_input (#483)
Browse files Browse the repository at this point in the history
* feat: make stride variable
* feat: expose plumed input creation in cli
* doc: update changes
* make indexgroup interactive and fix file handling
  • Loading branch information
KRiedmiller authored Sep 11, 2024
1 parent 338abde commit 505c823
Show file tree
Hide file tree
Showing 53 changed files with 1,001 additions and 906 deletions.
4 changes: 2 additions & 2 deletions _freeze/guide/references/cmd_ref/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"hash": "cab46d65eea8ceb09bc30204aa5999b6",
"hash": "f55183c333948bb0adb9b003d26cda79",
"result": {
"engine": "jupyter",
"markdown": "---\nexecute:\n echo: true\ntitle: CLI Arguments\n---\n\n\n\n\n\nThe prefered method of starting a KIMMDY run is via the command line, though [Python entry points](../../_reference/cmd.qmd) are supported as well.\n\n## KIMMDY\n\n\n::: {#f025a1ca .cell execution_count=1}\n``` {.python .cell-code}\n!kimmdy --help\n```\n\n::: {.cell-output .cell-output-stdout}\n```\nusage: kimmdy [-h] [--input INPUT] [--checkpoint CHECKPOINT]\r\n [--loglevel LOGLEVEL] [--logfile LOGFILE] [--show-plugins]\r\n [--generate-jobscript] [--version] [--debug] [--callgraph]\r\n\r\nWelcome to KIMMDY. `kimmdy` runs KIMMDY, further tools are available as\r\n`kimmdy-...` commands. These are `-analysis`, `-modify-top` and `-build-\r\nexamples`. Access their help with `kimmdy-... -h.`\r\n\r\noptions:\r\n -h, --help show this help message and exit\r\n --input INPUT, -i INPUT\r\n Kimmdy input file. Default `kimmdy.yml`\r\n --checkpoint CHECKPOINT, -c CHECKPOINT\r\n File path of a kimmdy.cpt file to restart KIMMDY from\r\n a checkpoint. If a directory is given, the file\r\n kimmdy.cpt in that directory is used.\r\n --loglevel LOGLEVEL, -l LOGLEVEL\r\n logging level (CRITICAL, ERROR, WARNING, INFO, DEBUG)\r\n --logfile LOGFILE, -f LOGFILE\r\n logfile\r\n --show-plugins List available plugins\r\n --generate-jobscript Instead of running KIMMDY directly, generate at\r\n jobscript.sh for slurm HPC clusters.You can then run\r\n this jobscript with sbatch jobscript.sh\r\n --version show program's version number and exit\r\n --debug on error, drop into debugger\r\n --callgraph Generate visualization of function calls. Mostly\r\n useful for debugging and documentation.\r\n```\n:::\n:::\n\n\n## Analysis\n\n::: {#ae57bf41 .cell execution_count=2}\n``` {.python .cell-code}\n!kimmdy-analysis --help\n```\n\n::: {.cell-output .cell-output-stdout}\n```\nusage: kimmdy-analysis [-h] module ...\r\n\r\nWelcome to the KIMMDY analysis module. Use this module to analyse existing\r\nKIMMDY runs.\r\n\r\npositional arguments:\r\n module\r\n trjcat Concatenate trajectories of a KIMMDY run\r\n energy Plot GROMACS energy for a KIMMDY run\r\n radical_population\r\n Plot population of radicals for one or multiple KIMMDY\r\n run(s)\r\n rates Plot rates of all possible reactions after a MD run.\r\n Rates must have been saved!\r\n runtime Plot runtime of the tasks of a kimmdy run.\r\n\r\noptions:\r\n -h, --help show this help message and exit\r\n```\n:::\n:::\n\n\n## Remove Hydrogen\n\nThis module builds or restores the example directory in the package.\n\n::: {#d354a57c .cell execution_count=3}\n``` {.python .cell-code}\n!kimmdy-modify-top --help\n```\n\n::: {.cell-output .cell-output-stdout}\n```\nusage: kimmdy-modify-top [-h] [-p] [-r REMOVEH [REMOVEH ...]] [-c GROFILE]\r\n [-t RESIDUETYPES] [-x RADICALS]\r\n top out\r\n\r\nWelcome to the KIMMDY modify top module\r\n\r\npositional arguments:\r\n top GROMACS top file\r\n out Output top file name\r\n\r\noptions:\r\n -h, --help show this help message and exit\r\n -p, --parameterize Parameterize topology with grappa. (default: False)\r\n -r REMOVEH [REMOVEH ...], --removeH REMOVEH [REMOVEH ...]\r\n Remove one or more hydrogens by atom nrs in the top\r\n file. (default: None)\r\n -c GROFILE, --grofile GROFILE\r\n If necessary, also apply actions on gro file to create\r\n a compatible gro/top file pair. (default: None)\r\n -t RESIDUETYPES, --residuetypes RESIDUETYPES\r\n GROMACS style residuetypes file. Necessary for\r\n parameterization with non-amber atom types. (default:\r\n None)\r\n -x RADICALS, --radicals RADICALS\r\n Radicals in the system PRIOR to removing hydrogens\r\n with the removeH option. (default: )\r\n```\n:::\n:::\n\n\n## Examples\n\nThis module builds or restores the example directory in the package.\n\n::: {#8f4df5b5 .cell execution_count=4}\n``` {.python .cell-code}\n!kimmdy-build-examples --help\n```\n\n::: {.cell-output .cell-output-stdout}\n```\nusage: kimmdy-build-examples [-h] [-r [RESTORE]]\r\n\r\nBuild examples for KIMMDY.\r\n\r\noptions:\r\n -h, --help show this help message and exit\r\n -r [RESTORE], --restore [RESTORE]\r\n Overwrite input files in existing example directories,\r\n use keyword 'hard' to also delete output files.\r\n```\n:::\n:::\n\n\n",
"markdown": "---\nexecute:\n echo: true\ntitle: Analysis\n---\n\n\n\n\n\n\n# CLI Arguments\n\nThe prefered method of starting a KIMMDY run is via the command line, though [Python entry points](../../_reference/cmd.qmd) are supported as well.\n\n## KIMMDY\n\n\n::: {#3b93130d .cell execution_count=1}\n``` {.python .cell-code}\n!kimmdy --help\n```\n\n::: {.cell-output .cell-output-stdout}\n```\nusage: kimmdy [-h] [--input INPUT] [--loglevel LOGLEVEL] [--logfile LOGFILE]\r\n [--show-plugins] [--generate-jobscript] [--version] [--debug]\r\n [--callgraph]\r\n\r\nWelcome to KIMMDY. `kimmdy` runs KIMMDY, further tools are available as\r\n`kimmdy-...` commands. These are `-analysis`, `-modify-top` and `-build-\r\nexamples`. Access their help with `kimmdy-... -h.`\r\n\r\noptions:\r\n -h, --help show this help message and exit\r\n --input INPUT, -i INPUT\r\n Kimmdy input file. Default `kimmdy.yml`\r\n --loglevel LOGLEVEL, -l LOGLEVEL\r\n logging level (CRITICAL, ERROR, WARNING, INFO, DEBUG)\r\n --logfile LOGFILE, -f LOGFILE\r\n logfile\r\n --show-plugins List available plugins\r\n --generate-jobscript Instead of running KIMMDY directly, generate at\r\n jobscript.sh for slurm HPC clusters.You can then run\r\n this jobscript with sbatch jobscript.sh\r\n --version show program's version number and exit\r\n --debug on error, drop into debugger\r\n --callgraph Generate visualization of function calls. Mostly\r\n useful for debugging and documentation.\r\n```\n:::\n:::\n\n\n\n\n::: {#da853220 .cell execution_count=2}\n``` {.python .cell-code}\n!kimmdy-analysis --help\n```\n\n::: {.cell-output .cell-output-stdout}\n```\nusage: kimmdy-analysis [-h] module ...\r\n\r\nWelcome to the KIMMDY analysis module. Use this module to analyse existing\r\nKIMMDY runs.\r\n\r\npositional arguments:\r\n module\r\n trjcat Concatenate trajectories of a KIMMDY run\r\n energy Plot GROMACS energy for a KIMMDY run\r\n radical_population Plot population of radicals for one or multiple KIMMDY\r\n run(s)\r\n radical_migration Create a json of radical migration events for further\r\n analysis.\r\n rates Plot rates of all possible reactions after a MD run.\r\n Rates must have been saved!\r\n runtime Plot runtime of the tasks of a kimmdy run.\r\n reaction_participation\r\n Plot counts of reaction participation per atom id\r\n\r\noptions:\r\n -h, --help show this help message and exit\r\n```\n:::\n:::\n\n\n## Create plumed input\n\nThis module creates input files for plumed based on a topology and index file.\n\n::: {#62f32141 .cell execution_count=3}\n``` {.python .cell-code}\n!kimmdy-create-plumed --help\n```\n\n::: {.cell-output .cell-output-stdout}\n```\nusage: kimmdy-create-plumed [-h] [--entries-to-remove [ENTRIES_TO_REMOVE ...]]\r\n [--stride STRIDE] -p TOP -i INDEX --indexgroup\r\n INDEXGROUP\r\n\r\nBuild plumed input file. Requires a topology file and a gromacs index file.\r\n\r\noptions:\r\n -h, --help show this help message and exit\r\n --entries-to-remove [ENTRIES_TO_REMOVE ...]\r\n Either atomnames or bonds, i.e. atomnames separated by\r\n a hyphen that should not be written to the plumed\r\n configuration file. Default: C-N H* O*\r\n --stride STRIDE Frequency of plumed output as multiple of the md\r\n timestep. Default: 100\r\n -p TOP, --top TOP Gromacs topology file path.\r\n -i INDEX, --index INDEX\r\n Gromacs index file path.\r\n --indexgroup INDEXGROUP\r\n Index group name out of which bonds will be written to\r\n the plumed configuration file.\r\n```\n:::\n:::\n\n\n## Remove Hydrogen\n\nThis module builds or restores the example directory in the package.\n\n::: {#5f68f86b .cell execution_count=4}\n``` {.python .cell-code}\n!kimmdy-modify-top --help\n```\n\n::: {.cell-output .cell-output-stdout}\n``````````````````````````\nusage: kimmdy-modify-top [-h] [-p] [--grappa_tag GRAPPA_TAG]\r\n [--grappa_charge_model GRAPPA_CHARGE_MODEL]\r\n [-r REMOVEH [REMOVEH ...]] [-c GRO] [-a]\r\n [-t RESIDUETYPES] [-x RADICALS [RADICALS ...]]\r\n [-w INCLUDE] [-b EXCLUDE]\r\n top out\r\n\r\nWelcome to the KIMMDY modify top module\r\n\r\npositional arguments:\r\n top GROMACS top file\r\n out Output top file name. Stem reused for gro if\r\n applicabel.\r\n\r\noptions:\r\n -h, --help show this help message and exit\r\n -p, --parameterize Parameterize topology with grappa. (default: False)\r\n --grappa_tag GRAPPA_TAG\r\n Set grappa model tag for parameterization. (default:\r\n latest)\r\n --grappa_charge_model GRAPPA_CHARGE_MODEL\r\n Set grappa charge model for parameterization.\r\n (default: amber99)\r\n -r REMOVEH [REMOVEH ...], --removeH REMOVEH [REMOVEH ...]\r\n Remove one or more hydrogens by atom nrs in the top\r\n file. (default: None)\r\n -c GRO, --gro GRO If necessary, also apply actions on gro file to create\r\n a compatible gro/top file pair. Output analog to top.\r\n (default: None)\r\n -a, --search_amber_rad\r\n Automatic radical search only implemented for amber.\r\n If you douse another ff, set this to false, and\r\n provide a list of radicalsmanually, if necessary.\r\n (default: False)\r\n -t RESIDUETYPES, --residuetypes RESIDUETYPES\r\n GROMACS style residuetypes file. Necessary for\r\n parameterization with non-amber atom types. (default:\r\n None)\r\n -x RADICALS [RADICALS ...], --radicals RADICALS [RADICALS ...]\r\n Radicals in the system PRIOR to removing hydrogens\r\n with the removeH option. (default: None)\r\n -w INCLUDE, --include INCLUDE\r\n Include certain GROMACS topology molecules in\r\n `Reactive` molecule. Reads molecule names from a csv\r\n file. (default: None)\r\n -b EXCLUDE, --exclude EXCLUDE\r\n Exclude certain GROMACS topology molecules in\r\n `Reactive` molecule. Reads molecule names from a csv\r\n file. (default: None)\r\n``````````````````````````\n:::\n:::\n\n\n## Examples\n\nThis module builds or restores the example directory in the package.\n\n::: {#ab9478d8 .cell execution_count=5}\n``` {.python .cell-code}\n!kimmdy-build-examples --help\n```\n\n::: {.cell-output .cell-output-stdout}\n```\nusage: kimmdy-build-examples [-h] [-r [RESTORE]]\r\n\r\nBuild examples for KIMMDY.\r\n\r\noptions:\r\n -h, --help show this help message and exit\r\n -r [RESTORE], --restore [RESTORE]\r\n Overwrite input files in existing example directories,\r\n use keyword 'hard' to also delete output files.\r\n```\n:::\n:::\n\n\n",
"supporting": [
"cmd_ref_files/figure-html"
],
Expand Down
11 changes: 9 additions & 2 deletions _inv/python_objects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5489,6 +5489,7 @@ email.encoders.encode_quopri py:function 1 library/email.encoders.html#$ -
email.errors py:module 0 library/email.errors.html#module-$ -
email.errors.BoundaryError py:exception 1 library/email.errors.html#$ -
email.errors.HeaderParseError py:exception 1 library/email.errors.html#$ -
email.errors.HeaderWriteError py:exception 1 library/email.errors.html#$ -
email.errors.MessageError py:exception 1 library/email.errors.html#$ -
email.errors.MessageParseError py:exception 1 library/email.errors.html#$ -
email.errors.MultipartConversionError py:exception 1 library/email.errors.html#$ -
Expand Down Expand Up @@ -5717,6 +5718,7 @@ email.policy.Policy.max_line_length py:attribute 1 library/email.policy.html#$ -
email.policy.Policy.message_factory py:attribute 1 library/email.policy.html#$ -
email.policy.Policy.raise_on_defect py:attribute 1 library/email.policy.html#$ -
email.policy.Policy.register_defect py:method 1 library/email.policy.html#$ -
email.policy.Policy.verify_generated_headers py:attribute 1 library/email.policy.html#$ -
email.policy.SMTP py:data 1 library/email.policy.html#$ -
email.policy.SMTPUTF8 py:data 1 library/email.policy.html#$ -
email.policy.compat32 py:data 1 library/email.policy.html#$ -
Expand Down Expand Up @@ -11934,9 +11936,11 @@ xml.etree.ElementTree.XMLID py:function 1 library/xml.etree.elementtree.html#$ -
xml.etree.ElementTree.XMLParser py:class 1 library/xml.etree.elementtree.html#$ -
xml.etree.ElementTree.XMLParser.close py:method 1 library/xml.etree.elementtree.html#$ -
xml.etree.ElementTree.XMLParser.feed py:method 1 library/xml.etree.elementtree.html#$ -
xml.etree.ElementTree.XMLParser.flush py:method 1 library/xml.etree.elementtree.html#$ -
xml.etree.ElementTree.XMLPullParser py:class 1 library/xml.etree.elementtree.html#$ -
xml.etree.ElementTree.XMLPullParser.close py:method 1 library/xml.etree.elementtree.html#$ -
xml.etree.ElementTree.XMLPullParser.feed py:method 1 library/xml.etree.elementtree.html#$ -
xml.etree.ElementTree.XMLPullParser.flush py:method 1 library/xml.etree.elementtree.html#$ -
xml.etree.ElementTree.XMLPullParser.read_events py:method 1 library/xml.etree.elementtree.html#$ -
xml.etree.ElementTree.canonicalize py:function 1 library/xml.etree.elementtree.html#$ -
xml.etree.ElementTree.dump py:function 1 library/xml.etree.elementtree.html#$ -
Expand Down Expand Up @@ -12021,13 +12025,15 @@ xml.parsers.expat.xmlparser.ExternalEntityParserCreate py:method 1 library/pyexp
xml.parsers.expat.xmlparser.ExternalEntityRefHandler py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.GetBase py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.GetInputContext py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.GetReparseDeferralEnabled py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.NotStandaloneHandler py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.NotationDeclHandler py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.Parse py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.ParseFile py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.ProcessingInstructionHandler py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.SetBase py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.SetParamEntityParsing py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.SetReparseDeferralEnabled py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.StartCdataSectionHandler py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.StartDoctypeDeclHandler py:method 1 library/pyexpat.html#$ -
xml.parsers.expat.xmlparser.StartElementHandler py:method 1 library/pyexpat.html#$ -
Expand Down Expand Up @@ -12674,6 +12680,7 @@ asynchronous iterator std:term -1 glossary.html#term-asynchronous-iterator -
asynchronous-generator-functions std:label -1 reference/expressions.html#$ Asynchronous generator functions
asynchronous-generator-methods std:label -1 reference/expressions.html#$ Asynchronous generator-iterator methods
asyncio-awaitables std:label -1 library/asyncio-task.html#$ Awaitables
asyncio-cli std:label -1 library/asyncio.html#$ asyncio REPL
asyncio-coroutine-not-scheduled std:label -1 library/asyncio-dev.html#$ Detect never-awaited coroutines
asyncio-custom-policies std:label -1 library/asyncio-policy.html#$ Custom Policies
asyncio-debug-mode std:label -1 library/asyncio-dev.html#$ Debug Mode
Expand Down Expand Up @@ -12788,7 +12795,7 @@ bpo-36817-whatsnew std:label -1 whatsnew/3.8.html#$ f-strings support = for self
break std:label -1 reference/simple_stmts.html#$ The break statement
break std:pdbcommand 1 library/pdb.html#pdbcommand-$ -
browser-controllers std:label -1 library/webbrowser.html#$ Browser Controller Objects
bsd0 std:label -1 license.html#$ ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON 3.10.13 DOCUMENTATION
bsd0 std:label -1 license.html#$ ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON 3.10.15 DOCUMENTATION
buffer std:2to3fixer 1 library/2to3.html#to3fixer-$ -
buffer-request-types std:label -1 c-api/buffer.html#$ Buffer request types
buffer-structs std:label -1 c-api/typeobj.html#$ Buffer Object Structures
Expand Down Expand Up @@ -14296,7 +14303,7 @@ provisional package std:term -1 glossary.html#term-provisional-package -
proxy-basic-auth-handler std:label -1 library/urllib.request.html#$ ProxyBasicAuthHandler Objects
proxy-digest-auth-handler std:label -1 library/urllib.request.html#$ ProxyDigestAuthHandler Objects
proxy-handler std:label -1 library/urllib.request.html#$ ProxyHandler Objects
psf-license std:label -1 license.html#$ PSF LICENSE AGREEMENT FOR PYTHON 3.10.13
psf-license std:label -1 license.html#$ PSF LICENSE AGREEMENT FOR PYTHON 3.10.15
publishing-python-packages std:label -1 distributing/index.html#$ Reading the Python Packaging User Guide
pure-embedding std:label -1 extending/embedding.html#$ Pure Embedding
pure-mod std:label -1 distutils/examples.html#$ Pure Python distribution (by module)
Expand Down
2 changes: 1 addition & 1 deletion docs/_reference/analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.5.56">
<meta name="generator" content="quarto-1.5.53">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down
2 changes: 1 addition & 1 deletion docs/_reference/cmd.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.5.56">
<meta name="generator" content="quarto-1.5.53">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down
2 changes: 1 addition & 1 deletion docs/_reference/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.5.56">
<meta name="generator" content="quarto-1.5.53">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down
2 changes: 1 addition & 1 deletion docs/_reference/constants.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.5.56">
<meta name="generator" content="quarto-1.5.53">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down
Loading

0 comments on commit 505c823

Please sign in to comment.