def test_dihedral_feat(): print(base_dir) pool = Pool(6) yaml_file = load_yaml_file(os.path.join(base_dir,"mdl_dir","project.yaml")) for prt in ["kinase_1", "kinase_2"]: print(prt) prj = yaml_file["project_dict"][prt][0] featurize_project_wrapper(yaml_file, prt, feat=None, stride=1, view=pool) feat = DihedralFeaturizer(types=['phi', 'psi','chi1']) flist = glob.glob(os.path.join(base_dir, prt , yaml_file["protein_dir"],"*.hdf5")) for i in np.random.choice(flist, 3): trj = mdt.load(i) my_feat = feat.partial_transform(trj) expected_fname = os.path.join(base_dir, prt, yaml_file["feature_dir"], os.path.splitext(os.path.basename(i))[0]+".jl") calc_feat = verboseload(expected_fname) assert np.allclose(my_feat, calc_feat) return True
def featurize_series(yaml_file, ip_view, protein_list = None): """ :param yaml_file: The yaml file to work with :param ip_view: ipython view(required) :param protein_list: list of proteins, if None then all the proteins in yaml_file["protein_list"] are processed :return: converted and concatenated trajectories in yaml_file["base_dir"]+protein_name+trajectories and the stripped files in yaml_file["base_dir"]+protein_name+protein_traj """ yaml_file = load_yaml_file(yaml_file) if protein_list is None: protein_list = yaml_file["protein_list"] for protein in protein_list: featurize_project_wrapper(yaml_file, protein, None, 1, ip_view) return
def featurize_series(yaml_file, ip_view, protein_list=None): """ :param yaml_file: The yaml file to work with :param ip_view: ipython view(required) :param protein_list: list of proteins, if None then all the proteins in yaml_file["protein_list"] are processed :return: converted and concatenated trajectories in yaml_file["base_dir"]+protein_name+trajectories and the stripped files in yaml_file["base_dir"]+protein_name+protein_traj """ yaml_file = load_yaml_file(yaml_file) if protein_list is None: protein_list = yaml_file["protein_list"] for protein in protein_list: featurize_project_wrapper(yaml_file, protein, None, 1, ip_view) return