示例#1
0
    def setup_class(self):
        """Initialize all data."""
        lipids_tops = lipids.read_lipids_topH(
            [lipids.PATH_JSON / "Berger_POPC.json"])

        # Input parameters
        self.pdb = self.PATH_DATA / "10POPC.pdb"
        self.defop = self.PATH_DATA / "OP_def_BergerPOPC.def"
        self.dic_lipid = lipids_tops["Berger_POPC"]

        self.begin = 0
        self.end = 1

        # attributes
        self.universe_woH = mda.Universe(str(self.pdb))
        self.dic_atname2genericname = init_dics.make_dic_atname2genericname(
            self.defop)
        self.dic_OP, self.dic_corresp_numres_index_dic_OP = init_dics.init_dic_OP(
            self.universe_woH, self.dic_atname2genericname,
            self.dic_lipid['resname'])
        self.dic_Cname2Hnames = init_dics.make_dic_Cname2Hnames(self.dic_OP)

        # Compute the order parameter
        core.fast_build_all_Hs_calc_OP(self.universe_woH, self.begin, self.end,
                                       self.dic_OP, self.dic_lipid,
                                       self.dic_Cname2Hnames)
示例#2
0
    def _recreate_dicts(self, def_file):
        """Recreate dicts variable from a new `def_file`.

        Parameters
        ----------
        def_file : str
            path of the new definiton file.
        """
        self.dic_atname2genericname = init_dics.make_dic_atname2genericname(
            def_file)
        self.dic_OP, self.dic_corresp_numres_index_dic_OP = init_dics.init_dic_OP(
            self.universe_woH, self.dic_atname2genericname,
            self.dic_lipid['resname'])
        self.dic_Cname2Hnames = init_dics.make_dic_Cname2Hnames(self.dic_OP)
示例#3
0
    def setup_class(self):
        """Initialize attributes."""
        lipids_tops = lipids.read_lipids_topH(
            [lipids.PATH_JSON / "Berger_POPC.json"])

        # Input parameters
        self.pdb = self.PATH_DATA / "2POPC.pdb"
        self.defop = self.PATH_DATA / "OP_def_BergerPOPC.def"
        self.dic_lipid = lipids_tops["Berger_POPC"]

        # attributes
        self.universe_woH = mda.Universe(str(self.pdb))

        self.dic_atname2genericname = init_dics.make_dic_atname2genericname(
            self.defop)
        self.dic_OP, self.dic_corresp_numres_index_dic_OP = init_dics.init_dic_OP(
            self.universe_woH, self.dic_atname2genericname,
            self.dic_lipid['resname'])
        self.dic_Cname2Hnames = init_dics.make_dic_Cname2Hnames(self.dic_OP)
示例#4
0
def test_make_dic_Cname2Hnames(inputs):
    """Test for make_dic_Cname2Hnames().

    Parameters
    ----------
    inputs : function
        Callback which generates input data.
    """
    dic_OP, _ = init_dics.init_dic_OP(inputs['universe'],
                                      inputs['dic_atname2genericname'],
                                      inputs['dic_lipid']['resname'])

    dic = init_dics.make_dic_Cname2Hnames(dic_OP)

    # Number of Carbons with attached hydrogens
    assert len(dic) == 40
    assert dic['C1'] == ('H11', 'H12', 'H13')
    assert dic['C13'] == ('H131', )
    assert dic['C49'] == ('H491', 'H492')
    assert dic['CA2'] == ('HA21', 'HA22', 'HA23')