LOOS  v2.3.2
axis_with_membrane.py
1 #!/usr/bin/env python
2 """
3  axis_with_membrane computes the cosine between the first
4  principal axis of a selection and the Z-axis (i.e. the putative membrane
5  normal). This is written out for a trajectory as a time series...
6 """
7 """
8 
9  This file is part of LOOS.
10 
11  LOOS (Lightweight Object-Oriented Structure library)
12  Copyright (c) 2012 Tod Romo, Grossfield Lab
13  Department of Biochemistry and Biophysics
14  School of Medicine & Dentistry, University of Rochester
15 
16  This package (LOOS) is free software: you can redistribute it and/or modify
17  it under the terms of the GNU General Public License as published by
18  the Free Software Foundation under version 3 of the License.
19 
20  This package is distributed in the hope that it will be useful,
21  but WITHOUT ANY WARRANTY; without even the implied warranty of
22  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  GNU General Public License for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with this program. If not, see <http://www.gnu.org/licenses/>.
27 """
28 
29 
30 
31 from math import *
32 import sys
33 import loos
34 import loos.pyloos
35 
36 ## Command line arguments
37 model_name = sys.argv[1]
38 traj_name = sys.argv[2]
39 selection = sys.argv[3]
40 
41 # Define the system first
42 mol = loos.createSystem(model_name)
43 traj = loos.pyloos.Trajectory(traj_name, mol, subset=selection)
44 
45 for frame in traj:
46 
47  # Compute the principal axes for the subset of atoms given above
48  axes = frame.principalAxes()
49 
50  # Print out time, and the dot-product between
51  # The Z-axis (i.e. membrane normal) and the first principal axes
52  # of the subset of atoms
53  print traj.index(), "\t", axes[0].z()
54 
55 
Python-based wrapper for LOOS Trajectories This class turns a loos Trajectory into something more pyt...
Definition: trajectories.py:55
AtomicGroup createSystem(const std::string &filename, const std::string &filetype)
Definition: sfactories.cpp:119