예제 #1
0
    def get_topologies(cls, forcefield, water_model):

        if forcefield == "charmm":
            topos = [
                "top_all36_caps.rtf", "top_all36_cgenff.rtf",
                "top_all36_prot.rtf", "top_all36_lipid.rtf",
                "top_all36_carb.rtf", "top_all36_na.rtf",
                "toppar_all36_prot_na_combined.str",
                "toppar_all36_prot_fluoro_alkanes.str"
            ]
            if water_model == "tip3":
                topos.append("toppar_water_ions.str")
            elif water_model == "tip4e":
                topos.append("toppar_water_ions_tip4p_ew.str")
            elif water_model == "spce":
                topos.append("toppar_water_ions_spc_e.str")

        elif forcefield == "opls":
            topos = ["opls_aam.rtf", "opls_aam_caps.rtf"]
            if water_model != "tip3":
                raise DabbleError("Only TIP3 water model supported for OPLS")

        elif forcefield == "amber":
            from dabble.param import AmberWriter  # avoid circular dependency
            return AmberWriter.get_topologies(forcefield, water_model)

        else:
            raise ValueError("Invalid forcefield: '%s'" % forcefield)

        return [cls._get_forcefield_path(top) for top in topos]
예제 #2
0
    def get_topologies(cls, forcefield, water_model):
        """
        Gets the path to GROMACS-format topologies for a given force field
        """

        # Amber, Charmm, and OPLS handled by conversion
        if forcefield == "charmm":
            return CharmmWriter.get_topologies(forcefield, water_model)

        if forcefield == "amber":
            return AmberWriter.get_topologies(forcefield, water_model)

        if forcefield == "opls":
            return CharmmWriter.get_topologies(forcefield, water_model)

        # No forcefields really ship with gromacs right now because
        # I found an error in the OPLS AA/M gromacs implementation and
        # they won't respond to my emails

        # Use GROMACS forcefield for the remaining ones
        #if forcefield == "opls":
        #    ffdir = "oplsaam.ff"

        #elif forcefield == "gromos":
        #    ffdir = "gromos54a7.ff"

        raise DabbleError("Unsupported forcefield %s" % forcefield)