Hi. I was wondering if anyone knows how to establish x,y,z coordinates in python. I want to be able to extract this data from a text file.
Here are sample lines in my text file:
ATOM 1 N GLN A 4 62.131 49.287 59.621 1.00 67.10 N
ATOM 2 CA GLN A 4 61.622 47.885 59.534 1.00 66.22 C
ATOM 3 C GLN A 4 60.854 47.447 60.792 1.00 64.45 C
ATOM 4 O GLN A 4 61.449 46.949 61.746 1.00 65.40 O
ATOM 5 CB GLN A 4 62.791 46.916 59.278 1.00 68.46 C
ATOM 6 CG GLN A 4 64.038 47.141 60.142 1.00 70.82 C
ATOM 7 CD GLN A 4 64.869 45.875 60.316 1.00 72.24 C
ATOM 8 OE1 GLN A 4 64.489 44.974 61.060 1.00 72.13 O
ATOM 9 NE2 GLN A 4 66.004 45.804 59.626 1.00 74.37 N
I need the coordinates so I can calculate the distances between different atoms. I have been putting the x,y,z values into separate lists and doing it this way. I would like to keep track of which atoms the distances are calculated from, but it's difficult with the way I was doing it before.
Any help would be greatly appreciated.