@@ -48,11 +48,11 @@ class MapContacts(object):
48
48
:type nslices: int, optional
49
49
"""
50
50
51
- def __init__ (self , u , ag1 , ag2 , nproc = 1 , frames = None , cutoff = 10.0 ,
51
+ def __init__ (self , u , ag1 , ag2 , nproc = 1 , frames = None , max_cutoff = 10.0 ,
52
52
nslices = 100 ):
53
53
self .u , self .nproc = u , nproc
54
54
self .ag1 , self .ag2 = ag1 , ag2
55
- self .cutoff , self .frames , self .nslices = cutoff , frames , nslices
55
+ self .cutoff , self .frames , self .nslices = max_cutoff , frames , nslices
56
56
57
57
def run (self ):
58
58
"""Run contact analysis and save to `contacts.pkl`
@@ -81,7 +81,7 @@ def run(self):
81
81
'traj' : self .u .trajectory .filename ,
82
82
'ag1' : self .ag1 , 'ag2' : self .ag2 ,
83
83
'ts' : self .u .trajectory .dt / 1000 ,
84
- 'cutoff' : self .cutoff })
84
+ 'cutoff' : self .max_cutoff })
85
85
86
86
contact_map = np .memmap ('.tmpmap' , mode = 'w+' ,
87
87
shape = (mapsize , 5 ), dtype = dtype )
@@ -160,6 +160,7 @@ def run(self):
160
160
memmap = pickle .load (f )
161
161
# memmap = np.load(self.map_name, mmap_mode='r')
162
162
dtype = memmap .dtype
163
+
163
164
memmap = memmap [memmap [:, - 2 ] <= self .cutoff ]
164
165
else :
165
166
raise FileNotFoundError (f'{ self .map_name } not found. Specify the '
@@ -232,9 +233,13 @@ def _lipswap(self, lip, memarr, i):
232
233
233
234
234
235
if __name__ == '__main__' :
236
+ """DOCSSS
237
+ """
235
238
import argparse
236
- parser = argparse .ArgumentParser ()
237
- parser .add_argument ('--top' , type = str )
239
+ parser = argparse .ArgumentParser (description = "Create the primary contact \
240
+ map and collect contacts based on the \
241
+ desired cutoff distance" )
242
+ parser .add_argument ('--top' , type = str , help = "Topology" )
238
243
parser .add_argument ('--traj' , type = str )
239
244
parser .add_argument ('--sel1' , type = str )
240
245
parser .add_argument ('--sel2' , type = str )
0 commit comments