Commit d38e18cb authored by Berk Onat's avatar Berk Onat

Initial Commit

parents
# Tinker Parser
[NOMAD Laboratory CoE](http://nomad-coe.eu) parser for [TINKER](https://dasher.wustl.edu/tinker/)
## Version 0.0.1
This is the parser for Tinker in [TINKER](https://dasher.wustl.edu/tinker/).
The official version lives at:
git@gitlab.mpcdf.mpg.de:nomad-lab/parser-tinker.git
You can browse it at:
https://gitlab.rzg.mpg.de/nomad-lab/parser-tinker
It relies on having the nomad-meta-info and the python-common repositories one level higher.
The simplest way to have this is to check out nomad-lab-base recursively:
git clone --recursive git@gitlab.mpcdf.mpg.de:nomad-lab/nomad-lab-base.git
This parser will be in the directory parsers/tinker of this repository.
## Running and Testing the Parser
### Requirements
The required python packages can be installed with (see [python-common](https://gitlab.rzg.mpg.de/nomad-lab/python-common)):
pip install -r nomad-lab-base/python-common/requirements.txt
### Usage
Tinker MD log output files can be parsed with:
python TINKERParser.py [path/toFile]
### Test Files
Example log output files of Tinker can be found in the directory test/examples.
More details about the calculations and files are explained in README file of test/examples.
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6.1 virtualenv at /labEnv3" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/parser-amber.iml" filepath="$PROJECT_DIR$/.idea/parser-amber.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="projectConfiguration" value="Nosetests" />
<option name="PROJECT_TEST_RUNNER" value="Nosetests" />
</component>
</module>
\ No newline at end of file
This diff is collapsed.
import logging
import os
PARSERNAME = "TINKER"
PROGRAMNAME = "tinker"
PARSERVERSION = "0.0.1"
PARSERMETANAME = PARSERNAME.lower()
PARSERTAG = 'x_' + PARSERMETANAME
PARSER_INFO_DEFAULT = {
'name' : PARSERMETANAME+'-parser',
'version': PARSERVERSION
}
META_INFO_PATH = os.path.normpath(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"../../../../nomad-meta-info/meta_info/nomad_meta_info/"+PARSERMETANAME+".nomadmetainfo.json"))
LOGGER = logging.getLogger("nomad."+PROGRAMNAME+"Parser")
def set_excludeList(self):
"""Sets the exclude list for x_
Returns:
the list of names
"""
excludelist = [
PARSERTAG+'_mdin_verbatim_writeout',
PARSERTAG+'_dumm_text',
PARSERTAG+'_dummy',
PARSERTAG+'_mdin_wt'
]
excludelist.extend([PARSERTAG+'_mdin_file_%s' % fileNL.lower() for fileNL in self.fileDict.keys()])
excludelist.extend([PARSERTAG+'_mdin_%s' % cntrlNL.lower() for cntrlNL in self.cntrlDict.keys()])
excludelist.extend([PARSERTAG+'_mdin_%s' % ewaldNL.lower() for ewaldNL in self.ewaldDict.keys()])
excludelist.extend([PARSERTAG+'_mdin_%s' % qmmmNL.lower() for qmmmNL in self.qmmmDict.keys()])
return excludelist
def set_includeList():
"""Sets the include list for x_
Returns:
the list of names
"""
includelist = []
return includelist
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
import sys
import os
import os.path
basedir = os.path.dirname(os.path.abspath(__file__))
commondir = os.path.normpath(os.path.join(basedir,"../../../../python-common/common/python"))
if not commondir in sys.path:
sys.path.insert(0, commondir)
package eu.nomad_lab.parsers
import eu.nomad_lab
import eu.nomad_lab.DefaultPythonInterpreter
import org.{ json4s => jn }
import eu.{ nomad_lab => lab }
import scala.collection.breakOut
object TinkerParser extends SimpleExternalParserGenerator(
name = "TinkerParser",
parserInfo = jn.JObject(
("name" -> jn.JString("TinkerParser")) ::
("parserId" -> jn.JString("TinkerParser" + lab.TinkerVersionInfo.version)) ::
("versionInfo" -> jn.JObject(
("nomadCoreVersion" -> jn.JObject(lab.NomadCoreVersionInfo.toMap.map {
case (k, v) => k -> jn.JString(v.toString)
}(breakOut): List[(String, jn.JString)])) ::
(lab.TinkerVersionInfo.toMap.map {
case (key, value) =>
(key -> jn.JString(value.toString))
}(breakOut): List[(String, jn.JString)])
)) :: Nil
),
mainFileTypes = Seq("text/.*"),
mainFileRe = """\s*#+\s*TINKER\s*---\s*Software\s*Tools\s*for\s*Molecular\s*Design\s*#+\s*""".r,
cmd = Seq(DefaultPythonInterpreter.pythonExe(), "${envDir}/parsers/tinker/parser/parser-tinker/TINKERParser.py",
"${mainFilePath}"),
resList = Seq(
"parser-tinker/TINKERParser.py",
"parser-tinker/TINKERDictionary.py",
"parser-tinker/TINKERCommon.py",
"parser-tinker/setup_paths.py",
"nomad_meta_info/public.nomadmetainfo.json",
"nomad_meta_info/common.nomadmetainfo.json",
"nomad_meta_info/meta_types.nomadmetainfo.json"
"nomad_meta_info/tinker.nomadmetainfo.json"
) ++ DefaultPythonInterpreter.commonFiles(),
dirMap = Map(
"parser-tinker" -> "parsers/tinker/parser/parser-tinker",
"nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info",
"python" -> "python-common/common/python/nomadcore"
) ++ DefaultPythonInterpreter.commonDirMapping(),
metaInfoEnv = Some(lab.meta.KnownMetaInfoEnvs.tinker)
)
package eu.nomad_lab.parsers
import org.specs2.mutable.Specification
object TinkerParserTests extends Specification {
"TinkerParserTest" >> {
"[Anion in Water (xyz sequence of outputs with 643 atoms)] test with json-events" >> {
ParserRun.parse(TinkerParser, "parsers/tinker/test/examples/anion/anion.log", "json-events") must_== ParseResult.ParseSuccess
}
"[Anion in Water (xyz sequence of outputs with 643 atoms)] test with json" >> {
ParserRun.parse(TinkerParser, "parsers/tinker/test/examples/anion/anion.log", "json") must_== ParseResult.ParseSuccess
}
"[Ice (.arc trajectory with 3024 atoms)] test with json-events" >> {
ParserRun.parse(TinkerParser, "parsers/tinker/test/examples/ice/ice.log", "json-events") must_== ParseResult.ParseSuccess
}
"[Ice (.arc trajectory with 3024 atoms)] test with json" >> {
ParserRun.parse(TinkerParser, "parsers/tinker/test/examples/ice/ice.log", "json") must_== ParseResult.ParseSuccess
}
}
}
# Tests:
### Source of Tests:
The tests are taken from Tinker (version 8.1) examples in [TINKER](http://dasher.wustl.edu/tinker/).
### TEST Directory for the TINKER Package
This directory contains some test casess illustrating use of
several of the programs in the TINKER package.
For example, the argon.run file contains the commands to run
the first test case. The resulting output is found in the file
argon.log.
#### ANION
estimation of the free energy of hydration
of Cl- anion vs. Br- anion via a 2 picosecond
simulation on a "hybrid" anion in a box of
water, followed by free energy perturbation
#### ARGON
minimization followed by 6 picoseconds
of a molecular dynamics run on a periodic
box containing 150 argon atoms
#### ENKEPHALIN
generation of coordinates from the
amino acid sequence and phi/psi angles,
followed by energy minimization and
determination of the lowest frequency
normal mode
#### ICE/WATER
short MD simulation of the monoclinic ice V
crystal form using the iAMOEBA water model,
neighbor lists and PME electrostatics
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
anion
1 20
0.5
300.0
4
y
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
cp anion.dyn0 anion.dyn
../bin/dynamic anion 1000 2.0 0.1 2 300.0
../bin/alchemy < anion.dat
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
########################################################################
## ##
## Keyfile for the argon box TINKER molecular dynamics example. ##
## Note the use of "lights" to speed vdw computation, and the ##
## fixed random number seed forcing the calculation to generate ##
## the same trajectory each time for validation purposes. ##
## ##
########################################################################
parameters ../params/mm3
lights
randomseed 123456789
a-axis 26.0206
vdw-cutoff 12.0
tau-pressure 1.0e+20
This diff is collapsed.
cp argon.1st argon.xyz
../bin/minimize argon 1.0
../bin/dynamic argon 3000 2.0 1.0 4 150.87 49.0
#rm argon.xyz* argon.dyn argon.0*
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
parameters oplsaa
printout 100
digits 8
This diff is collapsed.
../bin/protein < enkephalin.dat
../bin/minimize enkephalin 0.00001
../bin/vibrate enkephalin -7 8
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment