|
18 | 18 | from __future__ import print_function |
19 | 19 | from builtins import object |
20 | 20 | import numpy as np |
21 | | -import warnings |
22 | 21 | from six.moves import range |
23 | 22 | try: |
24 | 23 | import six.moves.cPickle as pickle |
25 | 24 | except ImportWarning as warn: |
26 | 25 | import pickle |
27 | | - |
28 | 26 | import os |
29 | | -import multiprocessing |
30 | | -import sys |
31 | | - |
| 27 | +import ast |
32 | 28 | # PyBILT imports |
33 | 29 | from . import com_frame as cf |
34 | 30 | from . import leaflet as lf |
|
38 | 34 | from . import plot_protocols as pp |
39 | 35 | from pybilt.common.running_stats import RunningStats |
40 | 36 | from . import mda_data as md |
41 | | -import MDAnalysis as mda |
| 37 | + |
42 | 38 | # import the coordinate wrapping function--for unwrapping |
43 | 39 | from pybilt.mda_tools.mda_unwrap_vectorized import wrap_coordinates, \ |
44 | 40 | wrap_coordinates_parallel |
@@ -509,7 +505,7 @@ def parse_input_script(self, input_script_name): |
509 | 505 | if key in ['structure', 'trajectory', 'selection']: |
510 | 506 | second_term = line.replace(key, '', 1).strip() |
511 | 507 | if key == 'selection': |
512 | | - second_term = eval(second_term) |
| 508 | + second_term = ast.literal_eval(second_term) |
513 | 509 | commands[key] = second_term |
514 | 510 | else: |
515 | 511 | if key in self._valid_commands: |
@@ -856,28 +852,19 @@ def _build_leaflets_orientation(self): |
856 | 852 | 'lower': lf.Leaflet('lower')} |
857 | 853 | l = 0 |
858 | 854 | for lipcom in com_frame.lipidcom: |
859 | | - sel_str = "resname {} and resid {}".format(lipcom.type, lipcom.resid) |
860 | | - # residue = self._mda_data.mda_universe.select_atoms(sel_str) |
861 | 855 | resname = lipcom.type |
862 | 856 | resid = lipcom.resid |
863 | 857 | tail_str = "resname {} and resid {} and name {}".format(resname, resid,self.rep_settings['leaflets']['orientation_atoms'][resname][0]) |
864 | 858 | tail = self._mda_data.mda_universe.select_atoms(tail_str) |
865 | | - # print(tail, len(tail)) |
866 | 859 | tail_v = tail.center_of_mass() |
867 | 860 | head_str = "resname {} and resid {} and name {}".format(resname, resid,self.rep_settings['leaflets']['orientation_atoms'][resname][1]) |
868 | 861 | head = self._mda_data.mda_universe.select_atoms(head_str) |
869 | 862 | head_v = head.center_of_mass() |
870 | | - # print(tail_v) |
871 | | - # print(head_v) |
872 | 863 | vec = head_v - tail_v |
873 | | - # print(vec) |
874 | 864 | norm = self.settings['norm'] |
875 | 865 | norm_vec = np.zeros(3) |
876 | 866 | norm_vec[norm] = 1.0 |
877 | 867 | cost = np.dot(vec, norm_vec)/np.sqrt(np.dot(vec, vec)) |
878 | | - # print(tail_str, head_str) |
879 | | - # print(tail_v, head_v, cost) |
880 | | - # print(" ") |
881 | 868 | pos = "" |
882 | 869 | if cost > 0.0: |
883 | 870 | pos = 'upper' |
@@ -917,10 +904,6 @@ def __next__(self): |
917 | 904 | builds the necessary objects (e.g. COMFrame) and then executes the |
918 | 905 | analysis of each analysis that was initialized in the setup. |
919 | 906 |
|
920 | | - Args: |
921 | | - nprocs (int): An integer specifying the number of cores to use in |
922 | | - multithreaded parallelelization. |
923 | | -
|
924 | 907 | """ |
925 | 908 | if self._current_frame > self._last_frame: |
926 | 909 | raise StopIteration() |
@@ -971,7 +954,7 @@ def __next__(self): |
971 | 954 | self._oldcoords = oldcoord |
972 | 955 | # print (wrapcoord) |
973 | 956 | if self._analysis_protocol.use_objects['com_frame']: |
974 | | - # now build the COMFrame |
| 957 | + # now build the COMFrame |
975 | 958 | self.reps['com_frame'] = cf.COMFrame(frame, self._mda_data.bilayer_sel, |
976 | 959 | wrapcoord, |
977 | 960 | name_dict = |
|
0 commit comments