3 cylindrical-thickness.py : compute the thickness of the membrane around
4 a centering selection, output the average as
5 a function of lateral distance from origin
6 The expected use-case for this is looking at lipid packing around a membrane
7 protein, when for whatever region you want to average out the "polar"
10 For example, a command line could look like:
12 cylindrical-thickness.py sim.psf sim.dcd 'segid == "PROT"' 'segid =~ "PE" && name == "P"' 10 30 20
14 This would read the system info from sim.psf, and use the trajectory sim.dcd.
15 The system would be translated such that "PROT" is at the origin, and then
16 the heights of phosphate with segment names containing "PE" would be
19 NOTE: This code assumes the membrane is centered at z = 0. Atoms with
20 z>0 are assigned to the upper leaflet, z<0 the lower leaflet, and the
21 difference between the averages is computed as a function of r.
28 This file is part of LOOS.
30 LOOS (Lightweight Object-Oriented Structure library)
31 Copyright (c) 2013 Tod Romo, Grossfield Lab
32 Department of Biochemistry and Biophysics
33 School of Medicine & Dentistry, University of Rochester
35 This package (LOOS) is free software: you can redistribute it and/or modify
36 it under the terms of the GNU General Public License as published by
37 the Free Software Foundation under version 3 of the License.
39 This package is distributed in the hope that it will be useful,
40 but WITHOUT ANY WARRANTY; without even the implied warranty of
41 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 GNU General Public License for more details.
44 You should have received a copy of the GNU General Public License
45 along with this program. If not, see <http://www.gnu.org/licenses/>.
header = " "
system_file = sys.argv
traj_file = sys.argv
centering_selection_string = sys.argv
target_selection_string = sys.argv
rmin = float(sys.argv)
rmax = float(sys.argv)
rnum_bins = int(sys.argv)
rbin_width = (rmax - rmin) / rnum_bins
upper_sum = numpy.zeros(rnum_bins)
upper_count = numpy.zeros(rnum_bins)
lower_sum = numpy.zeros(rnum_bins)
lower_count = numpy.zeros(rnum_bins)
centroid = centering.centroid()
(rmin2 < r2 < rmax2):
rbin = int((r - rmin)/ rbin_width)
upper_count[rbin] += 1
lower_count[rbin] += 1
107 print "#r Thick UpperHeight LowerHeight"
r = rmin + (i+0.5)*rbin_width
upper_count[rbin] > 0:
upper = upper_sum[i] / upper_count[i]
lower_count[rbin] > 0:
lower = lower_sum[i] / lower_count[i]
r, upper-lower, upper, lower
Python-based wrapper for LOOS Trajectories This class turns a loos Trajectory into something more pyt...
AtomicGroup selectAtoms(const AtomicGroup &source, const std::string selection)
Applies a string-based selection to an atomic group...
AtomicGroup createSystem(const std::string &filename, const std::string &filetype)