-
Notifications
You must be signed in to change notification settings - Fork 48
/
README.md.html
133 lines (98 loc) · 5.25 KB
/
README.md.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<meta charset="utf-8">
<style>img { max-width: 100%; }</style>
- Thanks to [Timothy Ryan Rogers](https://github.com/tryanrogers1)
# Introduction
This FitMol Fortran program is designed to perform a rotation on a molecule such that it minimizes the RMSD of its coordinates with respect to a __reference__ molecule.
# Compiling
Before running the program, you should compile the `FitMol.f90` file, using a suitable Fortran compiler. Examples of possible compile commands are:
```
ifort FitMol.f90 -o fitmol.exe
gfortran FitMol.f90 -o fitmol.exe
```
# Running
## interactive
After compiling, this is how to use the `fitmol` program interactively(See more details following, regarding how to prepare the input file):
1. Call the program via `./fitmol.exe`
2. Program will ask for name of the input `.xyz` file.
3. Enter the name, less the `.xyz` extension.
4. Program will ask if you want to fit now.
5. Enter `y` and return.
This program will then print to the screen the rotation matrix determined for the test molecule, as well as some other information.
### multiple fitting
More than one molecule can be fitted at the same time. To do this, the first molecule
in the `.xyz` file must be the reference molecule. As many other molecules as you wish can
be concatenated below it.
### center
By default, the center of rotation is the geometrical center of the molecule in each `.xyz` file. If you want to use a different center of rotation, make the first character(s) of the `.xyz` comment line match the atom number you wish to use.
For example, the following file has only two molecules in it, and is requesting that `fitmol` use the 4th atom as the center of rotation:
```c
5
4 ref
C -1.48058263 0.37621359 0.00000000
H -1.12392821 -0.63259642 0.00000000
H -1.12390979 0.88061178 0.87365150
H -1.12390979 0.88061178 -0.87365150
H -2.55058263 0.37622677 0.00000000
5
rot-1
C -4.44483465 5.42771734 3.70387923
H -3.62171823 5.47750008 4.38571575
H -5.24576124 4.87701765 4.15125653
H -4.77786291 6.41821850 3.47388006
H -4.13399585 4.93813311 2.80466484
```
### weighting
Additionally, if you wish to give special weight/importance to certain atoms during the fitting/rotation, you can list their weight(s) next to them in the reference structure.
For example, the following file is letting `fitmol` use the center of geometry as the center of rotation, but has given special weight to the `C` atom:
```c
5
4 ref
C -1.48058263 0.37621359 0.00000000 20.0
H -1.12392821 -0.63259642 0.00000000 1.0
H -1.12390979 0.88061178 0.87365150 1.0
H -1.12390979 0.88061178 -0.87365150 1.0
H -2.55058263 0.37622677 0.00000000 1.0
5
rot-1
C -4.44483465 5.42771734 3.70387923
H -3.62171823 5.47750008 4.38571575
H -5.24576124 4.87701765 4.15125653
H -4.77786291 6.41821850 3.47388006
H -4.13399585 4.93813311 2.80466484
```
### output
The program will produce an output file called `<input_filename>~Fit.xyz`, which is a valid `.xyz` file of all the molecules, and the non-reference molecules have been rotated according to the RMSD-minimizing rotation matrices. In addition, the weights of the reference molecule are printed, and the RMSD of each fitted molecule is printed in its comment line.
For example, this file shows two identical methane molecules using no special weights, so that upon rotation, an RMSD of zero was obtained:
```cpp
5
ref Ref Mol
C -0.000000020 0.000000090 0.000000000 1.0
H 0.356654400 -1.008809920 0.000000000 1.0
H 0.356672820 0.504398280 0.873651500 1.0
H 0.356672820 0.504398280 -0.873651500 1.0
H -1.070000020 0.000013270 0.000000000 1.0
5
rot-1 RMSD(Fit)= 0.000000
C -0.000000020 0.000000088 -0.000000004
H 0.356654403 -1.008809916 0.000000003
H 0.356672819 0.504398275 0.873651502
H 0.356672818 0.504398279 -0.873651502
H -1.070000019 0.000013274 0.000000000
```
## non-interactive
Alternatively, the program can be run non-interactively by simply giving the name of the input file. For example, the following syntax would execute the `fitmol` program on a file called `ch4.xyz`:
```
./fitmol.exe ch4
```
For non-interactive execution, the center of rotation can be defined with a second commandline argument. For example, the following syntax would execute the `fitmol` program on a file called `ch4.xyz`, using atom #1 as the rotation center:
```
./fitmol.exe ch4 1
```
## TODO
1. maximum number of atoms is fixed to 2000. Using allocatable array.
2. <del>all molecules should have the same numner of atoms.</del>
3. <del>fitting and RMSD calculation use different set of atoms.</del>
<style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace; font-size:5px;}</style>
<!--link rel="stylesheet" href="./markdeep/latex.css?"-->
<script src="../markdeep.js"></script><!--script src="https://casual-effects.com/markdeep/latest/markdeep.min.js"></script-->
<!--script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script-->