December 2017
Beginner
412 pages
10h 8m
English
Let’s add one final complication. Suppose that molecules didn’t have END markers but instead just a COMPND line followed by one or more ATOM lines. How would we read multiple molecules from a single file in that case?
| | COMPND AMMONIA |
| | ATOM 1 N 0.257 -0.363 0.000 |
| | ATOM 2 H 0.257 0.727 0.000 |
| | ATOM 3 H 0.771 -0.727 0.890 |
| | ATOM 4 H 0.771 -0.727 -0.890 |
| | COMPND METHANOL |
| | ATOM 1 C -0.748 -0.015 0.024 |
| | ATOM 2 O 0.558 0.420 -0.278 |
| | ATOM 3 H -1.293 -0.202 -0.901 |
| | ATOM 4 H -1.263 0.754 0.600 |
| | ATOM 5 H -0.699 -0.934 0.609 |
| | ATOM 6 H 0.716 1.404 0.137 |
At first glance, it doesn’t seem much different from the problem we just solved: read_molecule could extract the molecule’s name from the COMPND line and then read ATOM lines until it got either ...
Read now
Unlock full access