# # MoleCuilder - creates and alters molecular systems # Copyright (C) 2013 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 . # ### fit partial particle charges AT_SETUP([Potential - Fit partial charges - atomfragment check]) AT_KEYWORDS([potential parse-homologies fit-partial-charges save-particle-parameters]) AT_SKIP_IF([../../molecuilder --help fit-partial-charges; if test $? -eq 5; then /bin/true; else /bin/false; fi]) input=water.pdb homologyfile=homology_grid.dat AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitPartialCharges/pre/$input $input], 0) AT_CHECK([chmod u+w $input], 0, [ignore], [ignore]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitPartialCharges/pre/$homologyfile $homologyfile], 0) AT_CHECK([chmod u+w $homologyfile], 0, [ignore], [ignore]) # fails because atomFragments has not been parsed AT_CHECK([../../molecuilder -l $input --select-all-atoms --parse-homologies $homologyfile --fit-partial-charges --radius 1.5 --save-particle-parameters water.particles], 5, [stdout], [ignore]) AT_CLEANUP AT_SETUP([Potential - Fit partial charges to water]) AT_KEYWORDS([potential parse-homologies fit-partial-charges save-particle-parameters]) AT_SKIP_IF([../../molecuilder --help fit-partial-charges; if test $? -eq 5; then /bin/true; else /bin/false; fi]) # homology file created with water.pdb and as follows: # molecuilder -i water.pdb --select-all-atoms --fragment-molecule --distance 2 --order 1 --fragment-automation --server-address 127.0.0.1 --server-port 1026 --DoLongrange 1 --grid 5 --store-grids 1 --analyse-fragment-results --save-homologies homology_grid.dat --save-atom-fragments atomfragments.dat input=water.pdb homologyfile=homology_grid.dat atomfragmentsfile=atomfragments.dat AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitPartialCharges/pre/$input $input], 0) AT_CHECK([chmod u+w $input], 0, [ignore], [ignore]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitPartialCharges/pre/$homologyfile $homologyfile], 0) AT_CHECK([chmod u+w $homologyfile], 0, [ignore], [ignore]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitPartialCharges/pre/$atomfragmentsfile $atomfragmentsfile], 0) AT_CHECK([chmod u+w $atomfragmentsfile], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder -l $input --select-all-atoms --parse-homologies $homologyfile --parse-atom-fragments $atomfragmentsfile --fit-partial-charges --radius 1.5 --save-particle-parameters water.particles], 0, [stdout], [ignore]) # check that L_2 error is below 1e-6 AT_CHECK([grep "L2-Norm" stdout | awk '{if ($6 > 1e1) exit 1}'], 0, [ignore], [ignore]) AT_CHECK([grep "L1-Norm" stdout | awk '{if ($6 > 1e0) exit 1}'], 0, [ignore], [ignore]) AT_CHECK([grep "Adding particle O1.*-0.73" stdout], 0, [ignore], [ignore]) AT_CHECK([grep "Adding particle H1.*0.36" stdout], 0, [ignore], [ignore]) AT_CHECK([grep "atom O1.*received .*O1" stdout], 0, [ignore], [ignore]) AT_CHECK([grep "atom H2.*received .*H1" stdout], 0, [ignore], [ignore]) AT_CHECK([grep "atom H3.*received .*H1" stdout], 0, [ignore], [ignore]) AT_CHECK([diff water.particles ${abs_top_srcdir}/tests/regression/Potential/FitPartialCharges/post/water.particles], 0) AT_CLEANUP