def time_leafletfinder(self, cutoff, sparse, pbc): """Benchmark LeafletFinder for test lipid membrane system. """ leaflet.LeafletFinder(universe=self.u, select=self.headgroup_sel, cutoff=cutoff, pbc=pbc, sparse=sparse)
def find_leaflets(mdsys): """ Find and leaflets in the simulation using PO4 beads """ #print "Current frame: ", mdsys.trajectory.frame cut = 15 while 1: lfls = leaflet.LeafletFinder(mdsys, 'name PO4', cutoff=cut, pbc=True) if len(lfls.groups()) <= 2: break else: cut += 0.5 if len(lfls.groups()) != 2: raise ValueError("Problem don't have x2 leaflets.") top_head, bot_head = lfls.groups() rt = float(len(top_head)) / len(bot_head) if rt > 1.3 or rt < 0.77: raise ValueError("Uneven leaflets.") return top_head, bot_head