# # MoleCuilder - creates and alters molecular systems # Copyright (C) 2017 Frederik Heber # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ### Blog entry about many ways to translate an atom AT_SETUP([Examples - ways to translate an atom]) AT_KEYWORDS([blog translate-atom]) # prepare config file=water.xyz AT_CHECK([/bin/cp ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/pre/water.xyz $file], 0, [ignore], [ignore]) AT_CHECK([chmod u+w $file], 0) # 1. use translate-atom AT_CHECK([../../molecuilder --input water_translateatom.xyz -o xyz --load $file --select-atom-by-element O --translate-atoms --position "1,0,0"], 0, [ignore], [ignore]) AT_CHECK([diff -I".*olecuilder.*" water_translateatom.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0) # 2. use translate-molecule variant a AT_CHECK([../../molecuilder --input water_translatemolecule1_stage1.xyz -o xyz --load water.xyz --select-all-molecules --translate-molecules --position "1,0,0"], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder --input water_translatemolecule1.xyz -o xyz --load water_translatemolecule1_stage1.xyz --select-atom-by-element H --translate-atoms --position "-1,0,0"], 0, [ignore], [ignore]) AT_CHECK([diff -I".*olecuilder.*" water_translatemolecule1.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0) # 3. use translate-molecule variant b AT_CHECK([../../molecuilder --input water_translatemolecule2.xyz -o xyz --load water.xyz --update-molecules --select-molecules-by-formula O --translate-molecules --position "1,0,0" ], 0, [ignore], [ignore]) AT_CHECK([diff -I".*olecuilder.*" water_translatemolecule2.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0) # 4. use random-perturbation AT_CHECK([../../molecuilder --input water_randomperturbation.xyz -o xyz --load water.xyz --set-random-number-distribution "uniform_int" --random-number-distribution-parameters "min=0;max=2;" --set-random-number-engine "mt19937" --random-number-engine-parameters "seed=120;" --select-atom-by-element O --random-perturbation 1.], 0, [ignore], [ignore]) AT_CHECK([diff -I".*olecuilder.*" water_randomperturbation.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0) # 5. use stretch-bond and change-bond-angle (twice, old 0.910914 A, old angle 104.449 def) # we need to use tremolo format as pdb does not have enough output precision AT_CHECK([../../molecuilder --input water_stretchbond_stage1.data -o tremolo --set-tremolo-atomdata "Id type x=3 neighbors=4" --load water.xyz -I --select-atom-by-id 2 0 --stretch-bond 0.624310820025], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder --input water_stretchbond.pdb -o pdb --load water_stretchbond_stage1.data --select-atom-by-id 2 1 --stretch-bond 1.80824887668 --select-all-atoms --change-bond-angle 45.3788358886 --select-all-molecules --rotate-around-self 70.008595817 --axis "0,1,0" --add-empty-boundary "4.28,5,4.628"], 0, [ignore], [ignore]) # we need to strip down to three digits of output precision, hence extra pdb to xyz step AT_CHECK([../../molecuilder --input water_stretchbond.pdb -o xyz], 0, [ignore], [ignore]) AT_CHECK([diff -I".*olecuilder.*" water_stretchbond.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0) # 6. use fill-volume AT_CHECK([../../molecuilder --input water_fillvolume.xyz -o xyz --load water.xyz --create-shape --shape-name cyl --shape-type cylinder --stretch "1,1,1" --translation "5.28,6,5.628" --select-shape-by-name cyl --select-all-molecules -v 3 --fill-volume --count 12 --clear-molecule-selection --select-molecule-by-order 1 2 3 --remove-molecule --select-atom-by-element H --translate-atoms --position "-1,0,0"], 0, [ignore], [ignore]) AT_CHECK([diff -I".*olecuilder.*" water_fillvolume.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0) # 7. use fill-surface AT_CHECK([../../molecuilder --input water_fillsurface.xyz -o xyz --load water.xyz --create-shape --shape-name ball --shape-type sphere --stretch "1,1,1" --translation "6,6,5" --select-shape-by-name ball --select-all-molecules --fill-surface --Alignment-Axis "0,1,0" --count 1 --select-atom-by-element H --translate-atoms --position "-1,0,0"], 0, [ignore], [ignore]) AT_CHECK([diff -I".*olecuilder.*" water_fillsurface.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0) # 8. use remove-atom and add-atom AT_CHECK([../../molecuilder --input water_removeaddatom.xyz -o xyz --load water.xyz --select-atom-by-element O --remove-atom --add-atom O --domain-position "6,5,4.628"], 0, [ignore], [ignore]) AT_CHECK([diff -I".*olecuilder.*" water_removeaddatom.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0) # 9. use mirror-atoms AT_CHECK([../../molecuilder --input water_mirroratoms.xyz -o xyz --load water.xyz --select-atom-by-element O --mirror-atoms "1,0,0" --plane-offset 5.5], 0, [ignore], [ignore]) AT_CHECK([diff -I".*olecuilder.*" water_mirroratoms.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0) # 10. use scale-box AT_CHECK([../../molecuilder --input water_scalebox.xyz -o xyz --load water.xyz --change-box "10,0,10,0,0,10" --scale-box "1.2,1,1" --select-atom-by-id 0 --translate-atoms --position "-1.144,0,0" --invert-atoms --unselect-atom-by-element O --mirror-atoms "1,0,0" --plane-offset 4.708], 0, [ignore], [ignore]) AT_CHECK([diff -I".*olecuilder.*" water_scalebox.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0) AT_CLEANUP