Compare commits

...

13 Commits
3.1.3 ... 3.1.4

Author SHA1 Message Date
Peter Schmidtke
20635fa1a8 Merge pull request #29 from drewnutt/master
fix mdpocket to allow for reading in list of pdb files
2020-05-14 23:21:59 +02:00
Peter Schmidtke
a32fc24dc0 Merge branch 'master' into master 2020-05-14 23:19:46 +02:00
pschmidtke
b05d452d19 bugfix issue #24 2020-05-14 23:16:27 +02:00
pschmidtke
a03516e737 sample mdpocket output files 2020-05-14 23:15:51 +02:00
pschmidtke
019ad934bd sample mdpocket input files files 2020-05-14 23:15:35 +02:00
Peter Schmidtke
eb8287f325 adding install instructions for mac 2020-05-14 19:37:04 +02:00
Andrew(Drew) McNutt
40a446ea2b fix division to produce int as done in python2 2020-04-17 17:46:19 -04:00
Andrew(Drew) McNutt
6726e3cb37 python2 to python3 using 2to3 2020-04-02 14:48:38 -04:00
Andrew(Drew) McNutt
662e535f0a fix mdpocket to allow for reading in list of pdb files 2020-04-01 15:14:11 -04:00
Peter Schmidtke
82c0796ecb Update INSTALL.txt 2020-03-10 11:56:35 +01:00
Peter Schmidtke
0e012b4e28 Update README.md 2020-03-10 11:55:38 +01:00
Peter Schmidtke
fc4ad14f55 Merge pull request #28 from Discngine/add-license-1
Create LICENSE
2020-03-10 03:54:58 -07:00
Peter Schmidtke
0d998c42ba Create LICENSE 2020-03-10 11:54:42 +01:00
23 changed files with 382451 additions and 114 deletions

View File

@@ -1,22 +1,4 @@
// Fpocket brought to you by Vincent Le Guilloux & Peter Schmidtke
//
// GNU GPL
//
// This file is part of the fpocket package.
//
// fpocket 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.
//
// fpocket 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 fpocket. If not, see <http://www.gnu.org/licenses/>.
//
===========================
DEPENDENCIES :
===========================

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Peter Schmidtke & Vincent Le Guilloux
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -51,7 +51,10 @@ sudo make install
```
#### Compiling on Mac
Install MacPorts https://www.macports.org/ for instance (needed for netcdf install)
```
sudo port install netcdf
export LIBRARY_PATH=/opt/local/lib
git clone https://github.com/Discngine/fpocket.git
cd fpocket
make ARCH=MACOSXX86_64
@@ -133,7 +136,7 @@ Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c6
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
## Acknowledgments

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
2yex.pdb
3ot3.pdb
3pa3.pdb
3pa4.pdb
3tki.pdb
4hyi.pdb
4rvk.pdb
5opb.pdb
5opu.pdb
5oq5.pdb

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,184 @@
ATOM 1 C PTH 1 -8.641 4.782 5.052 0.00 0.00
ATOM 2 C PTH 1 -8.641 4.782 6.052 0.00 0.00
ATOM 3 C PTH 1 -8.641 5.782 6.052 0.00 0.00
ATOM 4 C PTH 1 -7.641 4.782 5.052 0.00 0.00
ATOM 5 C PTH 1 -7.641 4.782 6.052 0.00 0.00
ATOM 6 C PTH 1 -7.641 5.782 3.052 0.00 0.00
ATOM 7 C PTH 1 -7.641 5.782 4.052 0.00 0.00
ATOM 8 C PTH 1 -7.641 5.782 6.052 0.00 0.00
ATOM 9 C PTH 1 -7.641 6.782 7.052 0.00 0.00
ATOM 10 C PTH 1 -6.641 4.782 3.052 0.00 0.00
ATOM 11 C PTH 1 -6.641 4.782 4.052 0.00 0.00
ATOM 12 C PTH 1 -6.641 5.782 3.052 0.00 0.00
ATOM 13 C PTH 1 -6.641 5.782 4.052 0.00 0.00
ATOM 14 C PTH 1 -6.641 5.782 5.052 0.00 0.00
ATOM 15 C PTH 1 -6.641 5.782 6.052 0.00 0.00
ATOM 16 C PTH 1 -6.641 5.782 7.052 0.00 0.00
ATOM 17 C PTH 1 -6.641 6.782 3.052 0.00 0.00
ATOM 18 C PTH 1 -6.641 6.782 4.052 0.00 0.00
ATOM 19 C PTH 1 -6.641 6.782 7.052 0.00 0.00
ATOM 20 C PTH 1 -6.641 20.782 12.052 0.00 0.00
ATOM 21 C PTH 1 -5.641 4.782 4.052 0.00 0.00
ATOM 22 C PTH 1 -5.641 5.782 3.052 0.00 0.00
ATOM 23 C PTH 1 -5.641 5.782 4.052 0.00 0.00
ATOM 24 C PTH 1 -5.641 5.782 5.052 0.00 0.00
ATOM 25 C PTH 1 -5.641 6.782 4.052 0.00 0.00
ATOM 26 C PTH 1 -5.641 6.782 5.052 0.00 0.00
ATOM 27 C PTH 1 -4.641 5.782 4.052 0.00 0.00
ATOM 28 C PTH 1 -4.641 5.782 5.052 0.00 0.00
ATOM 29 C PTH 1 -4.641 6.782 4.052 0.00 0.00
ATOM 30 C PTH 1 -2.641 12.782 -14.948 0.00 0.00
ATOM 31 C PTH 1 -2.641 13.782 -14.948 0.00 0.00
ATOM 32 C PTH 1 -2.641 13.782 -13.948 0.00 0.00
ATOM 33 C PTH 1 -1.641 12.782 -14.948 0.00 0.00
ATOM 34 C PTH 1 -1.641 13.782 -15.948 0.00 0.00
ATOM 35 C PTH 1 -1.641 13.782 -14.948 0.00 0.00
ATOM 36 C PTH 1 -0.641 11.782 -15.948 0.00 0.00
ATOM 37 C PTH 1 -0.641 12.782 -15.948 0.00 0.00
ATOM 38 C PTH 1 0.359 11.782 -15.948 0.00 0.00
ATOM 39 C PTH 1 1.359 7.782 18.052 0.00 0.00
ATOM 40 C PTH 1 1.359 7.782 19.052 0.00 0.00
ATOM 41 C PTH 1 1.359 8.782 19.052 0.00 0.00
ATOM 42 C PTH 1 1.359 8.782 20.052 0.00 0.00
ATOM 43 C PTH 1 1.359 26.782 -9.948 0.00 0.00
ATOM 44 C PTH 1 2.359 6.782 18.052 0.00 0.00
ATOM 45 C PTH 1 2.359 7.782 18.052 0.00 0.00
ATOM 46 C PTH 1 2.359 7.782 19.052 0.00 0.00
ATOM 47 C PTH 1 2.359 8.782 19.052 0.00 0.00
ATOM 48 C PTH 1 2.359 8.782 20.052 0.00 0.00
ATOM 49 C PTH 1 3.359 4.782 17.052 0.00 0.00
ATOM 50 C PTH 1 3.359 5.782 17.052 0.00 0.00
ATOM 51 C PTH 1 3.359 5.782 18.052 0.00 0.00
ATOM 52 C PTH 1 3.359 6.782 17.052 0.00 0.00
ATOM 53 C PTH 1 3.359 6.782 18.052 0.00 0.00
ATOM 54 C PTH 1 3.359 8.782 19.052 0.00 0.00
ATOM 55 C PTH 1 3.359 8.782 20.052 0.00 0.00
ATOM 56 C PTH 1 3.359 9.782 20.052 0.00 0.00
ATOM 57 C PTH 1 3.359 19.782 -13.948 0.00 0.00
ATOM 58 C PTH 1 3.359 19.782 -12.948 0.00 0.00
ATOM 59 C PTH 1 3.359 20.782 -12.948 0.00 0.00
ATOM 60 C PTH 1 3.359 21.782 -12.948 0.00 0.00
ATOM 61 C PTH 1 3.359 21.782 -11.948 0.00 0.00
ATOM 62 C PTH 1 4.359 4.782 16.052 0.00 0.00
ATOM 63 C PTH 1 4.359 4.782 17.052 0.00 0.00
ATOM 64 C PTH 1 4.359 5.782 15.052 0.00 0.00
ATOM 65 C PTH 1 4.359 5.782 16.052 0.00 0.00
ATOM 66 C PTH 1 4.359 5.782 17.052 0.00 0.00
ATOM 67 C PTH 1 4.359 5.782 18.052 0.00 0.00
ATOM 68 C PTH 1 4.359 6.782 16.052 0.00 0.00
ATOM 69 C PTH 1 4.359 6.782 17.052 0.00 0.00
ATOM 70 C PTH 1 4.359 8.782 19.052 0.00 0.00
ATOM 71 C PTH 1 4.359 8.782 20.052 0.00 0.00
ATOM 72 C PTH 1 4.359 9.782 19.052 0.00 0.00
ATOM 73 C PTH 1 4.359 9.782 20.052 0.00 0.00
ATOM 74 C PTH 1 4.359 20.782 -12.948 0.00 0.00
ATOM 75 C PTH 1 4.359 21.782 -12.948 0.00 0.00
ATOM 76 C PTH 1 5.359 4.782 15.052 0.00 0.00
ATOM 77 C PTH 1 5.359 5.782 15.052 0.00 0.00
ATOM 78 C PTH 1 5.359 5.782 16.052 0.00 0.00
ATOM 79 C PTH 1 6.359 5.782 -0.948 0.00 0.00
ATOM 80 C PTH 1 6.359 5.782 0.052 0.00 0.00
ATOM 81 C PTH 1 6.359 5.782 1.052 0.00 0.00
ATOM 82 C PTH 1 6.359 6.782 0.052 0.00 0.00
ATOM 83 C PTH 1 6.359 6.782 1.052 0.00 0.00
ATOM 84 C PTH 1 6.359 7.782 0.052 0.00 0.00
ATOM 85 C PTH 1 6.359 7.782 1.052 0.00 0.00
ATOM 86 C PTH 1 7.359 -0.218 -1.948 0.00 0.00
ATOM 87 C PTH 1 7.359 0.782 -1.948 0.00 0.00
ATOM 88 C PTH 1 7.359 5.782 -0.948 0.00 0.00
ATOM 89 C PTH 1 7.359 5.782 0.052 0.00 0.00
ATOM 90 C PTH 1 7.359 5.782 1.052 0.00 0.00
ATOM 91 C PTH 1 7.359 6.782 -0.948 0.00 0.00
ATOM 92 C PTH 1 7.359 6.782 0.052 0.00 0.00
ATOM 93 C PTH 1 7.359 6.782 1.052 0.00 0.00
ATOM 94 C PTH 1 7.359 6.782 16.052 0.00 0.00
ATOM 95 C PTH 1 7.359 7.782 -0.948 0.00 0.00
ATOM 96 C PTH 1 7.359 7.782 0.052 0.00 0.00
ATOM 97 C PTH 1 7.359 7.782 16.052 0.00 0.00
ATOM 98 C PTH 1 7.359 7.782 17.052 0.00 0.00
ATOM 99 C PTH 1 7.359 8.782 17.052 0.00 0.00
ATOM 100 C PTH 1 7.359 8.782 18.052 0.00 0.00
ATOM 101 C PTH 1 7.359 9.782 18.052 0.00 0.00
ATOM 102 C PTH 1 7.359 9.782 19.052 0.00 0.00
ATOM 103 C PTH 1 8.359 -1.218 -2.948 0.00 0.00
ATOM 104 C PTH 1 8.359 -1.218 -1.948 0.00 0.00
ATOM 105 C PTH 1 8.359 -1.218 -0.948 0.00 0.00
ATOM 106 C PTH 1 8.359 -0.218 -2.948 0.00 0.00
ATOM 107 C PTH 1 8.359 -0.218 -1.948 0.00 0.00
ATOM 108 C PTH 1 8.359 -0.218 -0.948 0.00 0.00
ATOM 109 C PTH 1 8.359 0.782 -2.948 0.00 0.00
ATOM 110 C PTH 1 8.359 0.782 -1.948 0.00 0.00
ATOM 111 C PTH 1 8.359 4.782 15.052 0.00 0.00
ATOM 112 C PTH 1 8.359 5.782 16.052 0.00 0.00
ATOM 113 C PTH 1 8.359 6.782 -0.948 0.00 0.00
ATOM 114 C PTH 1 8.359 6.782 16.052 0.00 0.00
ATOM 115 C PTH 1 8.359 6.782 17.052 0.00 0.00
ATOM 116 C PTH 1 8.359 7.782 -0.948 0.00 0.00
ATOM 117 C PTH 1 8.359 7.782 16.052 0.00 0.00
ATOM 118 C PTH 1 8.359 7.782 17.052 0.00 0.00
ATOM 119 C PTH 1 8.359 8.782 -0.948 0.00 0.00
ATOM 120 C PTH 1 8.359 8.782 18.052 0.00 0.00
ATOM 121 C PTH 1 8.359 9.782 17.052 0.00 0.00
ATOM 122 C PTH 1 8.359 9.782 18.052 0.00 0.00
ATOM 123 C PTH 1 9.359 -2.218 -1.948 0.00 0.00
ATOM 124 C PTH 1 9.359 -1.218 -2.948 0.00 0.00
ATOM 125 C PTH 1 9.359 -1.218 -1.948 0.00 0.00
ATOM 126 C PTH 1 9.359 -1.218 -0.948 0.00 0.00
ATOM 127 C PTH 1 9.359 -0.218 -2.948 0.00 0.00
ATOM 128 C PTH 1 9.359 -0.218 -1.948 0.00 0.00
ATOM 129 C PTH 1 9.359 0.782 -2.948 0.00 0.00
ATOM 130 C PTH 1 9.359 5.782 15.052 0.00 0.00
ATOM 131 C PTH 1 9.359 6.782 16.052 0.00 0.00
ATOM 132 C PTH 1 9.359 7.782 -14.948 0.00 0.00
ATOM 133 C PTH 1 9.359 17.782 -6.948 0.00 0.00
ATOM 134 C PTH 1 9.359 18.782 -6.948 0.00 0.00
ATOM 135 C PTH 1 9.359 24.782 -0.948 0.00 0.00
ATOM 136 C PTH 1 10.359 6.782 16.052 0.00 0.00
ATOM 137 C PTH 1 10.359 7.782 16.052 0.00 0.00
ATOM 138 C PTH 1 10.359 10.782 15.052 0.00 0.00
ATOM 139 C PTH 1 10.359 17.782 -6.948 0.00 0.00
ATOM 140 C PTH 1 10.359 17.782 -5.948 0.00 0.00
ATOM 141 C PTH 1 10.359 18.782 -6.948 0.00 0.00
ATOM 142 C PTH 1 10.359 18.782 -5.948 0.00 0.00
ATOM 143 C PTH 1 10.359 18.782 -4.948 0.00 0.00
ATOM 144 C PTH 1 10.359 18.782 -3.948 0.00 0.00
ATOM 145 C PTH 1 10.359 19.782 -3.948 0.00 0.00
ATOM 146 C PTH 1 10.359 24.782 -0.948 0.00 0.00
ATOM 147 C PTH 1 10.359 25.782 -0.948 0.00 0.00
ATOM 148 C PTH 1 11.359 7.782 15.052 0.00 0.00
ATOM 149 C PTH 1 11.359 8.782 15.052 0.00 0.00
ATOM 150 C PTH 1 11.359 9.782 15.052 0.00 0.00
ATOM 151 C PTH 1 11.359 10.782 14.052 0.00 0.00
ATOM 152 C PTH 1 11.359 17.782 -6.948 0.00 0.00
ATOM 153 C PTH 1 11.359 17.782 -5.948 0.00 0.00
ATOM 154 C PTH 1 11.359 18.782 -6.948 0.00 0.00
ATOM 155 C PTH 1 11.359 18.782 -5.948 0.00 0.00
ATOM 156 C PTH 1 11.359 18.782 -4.948 0.00 0.00
ATOM 157 C PTH 1 11.359 18.782 -3.948 0.00 0.00
ATOM 158 C PTH 1 11.359 19.782 -5.948 0.00 0.00
ATOM 159 C PTH 1 11.359 19.782 -4.948 0.00 0.00
ATOM 160 C PTH 1 11.359 19.782 -3.948 0.00 0.00
ATOM 161 C PTH 1 11.359 19.782 -2.948 0.00 0.00
ATOM 162 C PTH 1 11.359 20.782 -3.948 0.00 0.00
ATOM 163 C PTH 1 11.359 20.782 -2.948 0.00 0.00
ATOM 164 C PTH 1 11.359 21.782 -0.948 0.00 0.00
ATOM 165 C PTH 1 11.359 22.782 -0.948 0.00 0.00
ATOM 166 C PTH 1 12.359 8.782 14.052 0.00 0.00
ATOM 167 C PTH 1 12.359 8.782 15.052 0.00 0.00
ATOM 168 C PTH 1 12.359 9.782 15.052 0.00 0.00
ATOM 169 C PTH 1 12.359 19.782 -4.948 0.00 0.00
ATOM 170 C PTH 1 12.359 20.782 -2.948 0.00 0.00
ATOM 171 C PTH 1 12.359 21.782 -1.948 0.00 0.00
ATOM 172 C PTH 1 12.359 21.782 -0.948 0.00 0.00
ATOM 173 C PTH 1 12.359 22.782 -1.948 0.00 0.00
ATOM 174 C PTH 1 12.359 22.782 -0.948 0.00 0.00
ATOM 175 C PTH 1 12.359 22.782 0.052 0.00 0.00
ATOM 176 C PTH 1 12.359 23.782 -0.948 0.00 0.00
ATOM 177 C PTH 1 13.359 13.782 27.052 0.00 0.00
ATOM 178 C PTH 1 13.359 13.782 28.052 0.00 0.00
ATOM 179 C PTH 1 13.359 22.782 -0.948 0.00 0.00
ATOM 180 C PTH 1 14.359 17.782 -7.948 0.00 0.00
ATOM 181 C PTH 1 15.359 16.782 -8.948 0.00 0.00
ATOM 182 C PTH 1 15.359 16.782 -7.948 0.00 0.00
ATOM 183 C PTH 1 15.359 17.782 -8.948 0.00 0.00
ATOM 184 C PTH 1 15.359 17.782 -7.948 0.00 0.00

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
0.215480
0.271399
0.217237
0.212487
0.221198
0.217482
0.234323
0.224301
0.218361
0.211592

View File

@@ -14,7 +14,7 @@ if __name__ == "__main__":
pdbname = str(basename)+".pdb"
pdir = "results/"+basename+"/clusterinfo.txt"
print pdbname+" - "+pdir+"\n"
print(pdbname+" - "+pdir+"\n")
f = open(pdir)
lines = f.readlines()

View File

@@ -73,14 +73,14 @@ z=0
y=0
x=0
print "Reading the grid. Depending on the number of data points you have this might take a while...."
print("Reading the grid. Depending on the number of data points you have this might take a while....")
path=open(pathOutput,"w")
counter=1
for count in range(n_entries/3) :
for count in range(n_entries//3) :
c=f.readline().split()
if(len(c)!=3) :
print "error reading grid data"
print("error reading grid data")
sys.exit("exiting the program")
for i in range(3):
if (iso_value<0 and float(c[i]) < iso_value) or (iso_value > 0 and float(c[i]) > iso_value) :
@@ -98,4 +98,4 @@ for count in range(n_entries/3) :
path.close()
f.close()
print "finished writing %s"%(pathOutput)
print("finished writing %s"%(pathOutput))

View File

@@ -212,6 +212,8 @@ s_mdparams* get_mdpocket_args(int nargs, char **args) {
case M_MDPAR_INPUT_FILE:
str_list_file = optarg;
status++;
break;
case M_MDPAR_OUTPUT_FILE:
@@ -246,6 +248,7 @@ s_mdparams* get_mdpocket_args(int nargs, char **args) {
print_mdpocket_usage(stdout);
} else {
if (str_list_file) {
int res = add_list_snapshots(str_list_file, par);
if (res <= 0) {
fprintf(stdout, "! No data has been read.\n");
@@ -292,97 +295,55 @@ s_mdparams* get_mdpocket_args(int nargs, char **args) {
int: Number of file read.
*/
int add_list_snapshots(char *str_list_file, s_mdparams *par) {
FILE *f;
int nread = 0,
status;
int add_list_snapshots(char *str_list_file, s_mdparams *par)
{
FILE *f;
int n,
nread = 0,
status ;
int nfiles=0;
char buf[M_MAX_PDB_NAME_LEN],
snapbuf[M_MAX_PDB_NAME_LEN*2+6];
char buf[M_MAX_PDB_NAME_LEN * 2 + 6],
snapbuf[M_MAX_PDB_NAME_LEN],
infbuf[M_MAX_PDB_NAME_LEN * 2 + 6],
origbuf1[20],
origbuf2[20],
origbuf3[20],
resbuf[20],
extbuf1[20],
extbuf2[20],
extbuf3[20];
/* Loading data. */
f = fopen(str_list_file, "r") ;
if(f) {
//first read the amount of files to read
while(fgets(buf, 210, f)) {
n = par->nfiles ;
status = sscanf(buf, "%s", snapbuf) ;
if(status < 1) {
fprintf(stderr, "! Skipping row '%s' with bad format (status %d).\n",
buf, status) ;
}
else {
nfiles ++;
}
}
fprintf(stdout,"Identified %d snapshots to analyze\n",nfiles);
fflush(stdout);
/* Loading data. */
f = fopen(str_list_file, "r");
/*
printf(str_list_file);
*/
if (f) {
while (fgets(buf, 210, f)) {
/*
printf("B: %s\n" , buf);
*/
status = sscanf(buf, "%s", snapbuf);
if (status < 1) {
fprintf(stderr, "! Skipping row '%s' with bad format (status %d).\n",
buf, status);
} else {
if (strncmp(snapbuf, "#origin", 7) == 0) {
//status=sscanf(buf,"%s\t%d\t%d\t%d",infbuf,par->grid_origin[0],par->grid_origin[1],par->grid_origin[2]);
status = sscanf(buf, "%s\t%s\t%s\t%s", infbuf, origbuf1, origbuf2, origbuf3);
if (status >= 0) {
if (str_is_float(origbuf1, M_SIGN) && str_is_float(origbuf2, M_SIGN) && str_is_float(origbuf3, M_SIGN)) {
par->grid_origin[0] = atof(origbuf1);
par->grid_origin[1] = atof(origbuf2);
par->grid_origin[2] = atof(origbuf3);
fprintf(stdout, "Grid origin \t\t: %.3f %.3f %.3f\n", par->grid_origin[0], par->grid_origin[1], par->grid_origin[2]);
} else {
fprintf(stderr, "WARNING : failed to parse origin specified in the input, this calculaion will use an automatically detected origin\n");
}
//
fflush(stdout);
} else {
fprintf(stderr, "WARNING : failed to read the origin specified in the input file\n");
}
} else if (strncmp(snapbuf, "#resolution", 11) == 0) {
//status=sscanf(buf,"%s\t%d\t%d\t%d",infbuf,par->grid_origin[0],par->grid_origin[1],par->grid_origin[2]);
status = sscanf(buf, "%s\t%s", infbuf, resbuf);
if (status >= 0) {
if (str_is_float(resbuf, M_NO_SIGN)) {
par->grid_spacing = atof(resbuf);
fprintf(stdout, "Grid resolution \t: %.3f\n", par->grid_spacing);
} else fprintf(stderr, "WARNING : failed to parse resolution specified in the input, this calculaion will use an automatically assigned resolution\n");
//
fflush(stdout);
} else fprintf(stderr, "WARNING : failed to read the resolution specified in the input file\n");
} else if (strncmp(snapbuf, "#extent", 7) == 0) {
//status=sscanf(buf,"%s\t%d\t%d\t%d",infbuf,par->grid_origin[0],par->grid_origin[1],par->grid_origin[2]);
status = sscanf(buf, "%s\t%s\t%s\t%s", infbuf, extbuf1, extbuf2, extbuf3);
if (status >= 0) {
if (str_is_float(extbuf1, M_NO_SIGN) && str_is_float(extbuf2, M_NO_SIGN) && str_is_float(extbuf3, M_NO_SIGN)) {
par->grid_extent[0] = (int) atof(extbuf1), par->grid_extent[1] = (int) atof(extbuf2), par->grid_extent[2] = (int) atof(extbuf3);
fprintf(stdout, "Grid extent \t\t: %d %d %d\n", par->grid_extent[0], par->grid_extent[1], par->grid_extent[2]);
} else fprintf(stderr, "WARNING : failed to parse extent specified in the input, this calculaion will use an automatically assigned grid extent\n");
//
fflush(stdout);
} else fprintf(stderr, "WARNING : failed to read the extent specified in the input file\n");
} else {
nread += add_snapshot(snapbuf, par);
if(nfiles>0){
par->fsnapshot = (char**) my_malloc( (nfiles) * sizeof (char*));
fseek(f, 0, SEEK_SET);
while(fgets(buf, 210, f)) {
status = sscanf(buf, "%s", snapbuf) ;
if(status < 1) {
fprintf(stderr, "! Skipping row '%s' with bad format (status %d).\n",
buf, status) ;
}
else {
nread += add_snapshot(snapbuf, par) ;
}
}
}
} else {
fprintf(stderr, "! File %s doesn't exists\n", str_list_file);
}
fclose(f);
return nread;
}
else {
fprintf(stderr, "! File %s doesn't exists\n", str_list_file) ;
}
fclose(f);
return nread ;
}
/**
@@ -406,15 +367,12 @@ int add_list_snapshots(char *str_list_file, s_mdparams *par) {
*/
int add_snapshot(char *snapbuf, s_mdparams *par) {
int nm1;
FILE *f = fopen_pdb_check_case(snapbuf, "r");
if (f) {
nm1 = par->nfiles;
par->nfiles += 1;
par->fsnapshot = (char**) my_realloc(par->fsnapshot, (par->nfiles) * sizeof (char*));
par->fsnapshot[nm1] = (char *) my_malloc((strlen(snapbuf) + 1) * sizeof (char));
strcpy(par->fsnapshot[nm1], snapbuf);