Distance Between Pores¶
Calculate the pore-to-pore distance from an MD trajectory of an HII LLC membrane
usage: p2p.py [-h] [-t TRAJ] [-g GRO] [-begin BEGIN] [-end END] [-skip SKIP]
[-p PORES] [-c COMPONENT [COMPONENT ...]] [-E EQUIL]
[-x EXCLUDE [EXCLUDE ...]] [--auto_exclude] [-b NBOOT]
[--plot_every PLOT_EVERY] [--noshow] [--save] [--plot_avg]
[--plot_std] [-T T] [--buffer BUFFER]
Named Arguments¶
| -t, --traj | Path to input file Default: “PR.trr” |
| -g, --gro | Coordinate configuration file (.gro, .pdb) Default: “berendsen.gro” |
| -begin, --begin | |
Frame to begin calculations Default: 0 | |
| -end, --end | Frame to stop calculations Default: -1 |
| -skip, --skip | Sample every nth frame Default: 1 |
| -p, --pores | Number of pores in unit cell Default: 4 |
| -c, --component | |
Name of monomer component used to track pore positions. This script will calculate the average coordinate of each in each pore. Special predefined cases include: “tails”, “Tails”, “benzene”, “Benzene”, “Head Groups, “tail_ends”, “tail_fronts”, “Sodium”. These are specific to Na-GA3C11 Default: “NA” | |
| -E, --equil | Frame number where system is equilibrated. “auto” will use pymbar.timeseries.DetectEquilibration to determine which frame to start at. It is often worth double checking its choice manually Default: “auto” |
| -x, --exclude | Index of p2p distance to exclude as written inthe list: [“1-2”, “1-3”, “1-4”, “2-3”, “2-4”, “3-4”] Default: [4] |
| --auto_exclude | Specifying this will override args.exclude and decide which pore-to-pore distance to exclude automatically by dropping the highest value Default: False |
| -b, --nboot | Number of bootstrap trials for generating statistics Default: 2000 |
| --plot_every | Plot every n frames Default: 1 |
| --noshow | Specify this flag to prevent the plot from showing Default: False |
| --save | Save the output plot Default: False |
| --plot_avg | Plot average p2p distance at each frame Default: False |
| --plot_std | Plot average p2p distance at each frame Default: False |
| -T | Use for concatenated trajectories of simulations run at multiple temperatures. Supply the name of index file (ascii format) with temperatures and times where the switch occurs. On each line supply the info with the format temp:time |
| --buffer | Fraction (of membrane thickness) of top and bottom ofmembrane to exclude from p2p calculations. Useful if you solvate both sides with water andions float into solution. Default: 0 |
Functions¶
-
p2p.restrict_atoms(t, component)¶ Restrict trajectory of coordinates to selected atoms
Parameters: - t (mdtraj.core.trajectory.Trajectory) – mdtraj trajectory object
- component (str or list) – names of components to be used for tracking pore centers.
Returns:
-
p2p.avg_pore_loc(npores, pos, buffer=0)¶ Calculate average pore location for each pore at each frame
Parameters: - no_pores (int) – the number of pores in the unit cell
- pos (numpy.ndarray, shape(ncomponents, 3) or numpy.ndarray, shape(nframes, ncomponents, 3)) – the coordinates of the component(s) which you are using to locate the pore centers
- buffer (float) – fraction (of membrane thickness) of top and bottom of membrane to exclude from p2p calculations
Returns: numpy array containing the x, y coordinates of the center of each pore at each frame
-
p2p.p2p(p_centers, distances)¶ Calculate all pairwise pore-to-pore distances (4 pores is the only number of pores implemented currently)
Parameters: - p_centers (numpy.ndarray, shape(p_centers.shape[0], p_centers.shape[1], 2)) – the x, y locations of the pore centers
- distances (int) – the number of distinct distances between pores
Returns: (np.ndarray, shape(p_centers.shape[0], distances, 2) All frame-by-frame pore-to-pore distances
-
p2p.p2p_stats(p2ps, exclude, nboot, equil)¶ Calculate the average and spread of pore-to-pore distances
Parameters: - p2ps (numpy.ndarray, shape(nframes, np2p_distances)) – all of the pore-to-pore distances
- exclude (int or str) – exclude a certain pore-to-pore interaction (such as the distance from pores on opposite sides of a parallelogram as is the case in a hexagonal system). If ‘auto’, then exclude will be automatically selected
- nboot (int) – number of bootstrap trials to use when generating statistics
- equil (int or str) – the trajectory frame at which to start generating statistics. Care about this parameter if you choose to detect equilibration manually. Otherwise ‘auto’ will use pymbar to find it for you
Returns: the average and standard deviation of pore to pore distances