コード例 #1
0
ファイル: leaflet.py プロジェクト: zemanj/mdanalysis
 def time_optimize_cutoff(self, sparse, pbc):
     """Benchmark optimize_cutoff for test lipid
     membrane system using default network distance
     range.
     """
     leaflet.optimize_cutoff(universe=self.u,
                             select=self.headgroup_sel,
                             pbc=pbc,
                             sparse=sparse)
コード例 #2
0
def test_optimize_cutoff(universe, lipid_heads):
    cutoff, N = optimize_cutoff(universe, lipid_heads, pbc=True)
    assert N == 2
    assert_almost_equal(cutoff, 10.5, decimal=4)
コード例 #3
0
    for i in list(lipidTypeDic.values()):
        defFlipFlopHeadgroups += i.getNoneLeafletSelection(syst)

    #LOGGER.info('FlipFlopHeadgroups = {}'.format(defFlipFlopHeadgroups))

    # --------------------------------------------------------------------------
    # Define top/bottom leaflets

    # Get beads that define the bilayer leaflets
    # (not in bilayer middle, but closly packed, use linker + first tail bead of lipids that do not flip-flop)
    defHeadgroups = MDAnalysis.core.groups.AtomGroup([], syst)
    for i in list(lipidTypeDic.values()):
        defHeadgroups += i.getLeafletSelection(syst)

    # get leaflets
    rcutoff, n = optimize_cutoff(syst, defHeadgroups)
    lfls = LeafletFinder(syst, defHeadgroups, cutoff=rcutoff, pbc=True)

    grps = lfls.groups()

    if len(grps) == 2:
        LOGGER.info('Found {} leaflet groups'.format(len(grps)))

    # check if they're even
    top_head = grps[0]
    bot_head = grps[1]

    rt = float(len(top_head)) / len(bot_head)
    if rt > 1.3 or rt < 0.77:
        raise ValueError('Found uneven leaflets. top = {}, bot = {}'.format(
            len(top_head), len(bot_head)))
コード例 #4
0
ファイル: test_leaflet.py プロジェクト: kaplajon/mdanalysis
 def test_optimize_cutoff(self):
     from MDAnalysis.analysis.leaflet import optimize_cutoff
     cutoff, N = optimize_cutoff(self.universe, self.lipid_heads, pbc=True)
     assert_equal(N, 2)
     assert_almost_equal(cutoff, 10.5, decimal=4)
コード例 #5
0
        structure = args[0]
    except IndexError:
        raise ValueError("Need structure file (pdb, gro, ...) as input")

    if not os.path.exists(structure):
        raise IOError(errno.ENOENT, "Structure file not found", structure)

    if not options.topology:
        options.topology = structure

    u = MDAnalysis.Universe(options.topology, structure)

    if options.optimize:
        print "# Finding best cutoff (--optimize)..."
        try:
            cutoff, N = optimize_cutoff(u, options.selection, pbc=options.pbc,
                                        max_imbalance=options.max_imbalance)
        except:
            raise RuntimeError("Failed cutoff optimization, try without --optimize")
        print "# Optimized cutoff=%(cutoff).1f A, finding %(N)d disconnected groups" % vars()
    else:
        cutoff = options.cutoff
        print "# Using fixed cutoff=%(cutoff).1f A" % vars()

    LF = LeafletFinder(u, options.selection, cutoff=cutoff, pbc=options.pbc)
    p = get_membrane_parameters(u, LF)

    # show results
    print "#" + 60 * "="
    print "thickness tmem = %(thickness).2f A" % p
    print "center    zmem = %(zmem).2f A" % p
    print "#" + 60 * "="
コード例 #6
0
    except IndexError:
        raise ValueError("Need structure file (pdb, gro, ...) as input")

    if not os.path.exists(structure):
        raise IOError(errno.ENOENT, "PQR file not found", structure)

    if not options.topology:
        options.topology = structure

    u = MDAnalysis.Universe(options.topology, structure)

    if options.optimize:
        print "# Finding best cutoff (--optimize)..."
        try:
            cutoff, N = optimize_cutoff(u,
                                        options.selection,
                                        pbc=options.pbc,
                                        max_imbalance=options.max_imbalance)
        except:
            raise RuntimeError(
                "Failed cutoff optimization, try without --optimize")
        print "# Optimized cutoff={cutoff:.1f} A, finding {N:d} disconnected groups".format(
            **vars())
    else:
        cutoff = options.cutoff
        print "# Using fixed cutoff={cutoff:.1f} A".format(**vars())

    LF = LeafletFinder(u, options.selection, cutoff=cutoff, pbc=options.pbc)

    print "# group sizes = {0!r} ".format(LF.sizes())

    # two leaflets
コード例 #7
0
ファイル: wrapper.py プロジェクト: parashardhapola/bill-view
 def estimate_bilayerDist(self):
     try: 
         self.bilayerDist = optimize_cutoff(self.universe, self.phosphates)
     except IndexError:
         print "Unable to determine cutoff value. Skipping sample %s" % self.name