def test(self):
        # extract xtcs to a temp dir
        xtc_fn = get('XTC.tgz', just_filename=True)
        fh = tarfile.open(xtc_fn, mode='r:gz')
        fh.extractall(self.td)
        fh.close()

        outfn = pjoin(self.td, 'ProjectInfo.yaml')
        # move to that directory
        os.chdir(self.td)

        atom_indices = np.arange(4)

        ConvertDataToHDF.run(projectfn=outfn,
                             conf_filename=get('native.pdb', just_filename=True),
                             input_dir=pjoin(self.td, 'XTC'),
                             source='file',
                             min_length=0,
                             stride=1,
                             rmsd_cutoff=np.inf,
                             atom_indices=atom_indices, iext=".xtc")

        project = load(outfn)
        traj = project.load_conf()
        eq(traj.n_atoms, 4)
Пример #2
0
 def test_a_ConvertDataToHDF(self):
     os.chdir(WorkingDir)
     shutil.copy(PDBFn,"./")
                 #def run(projectfn, PDBfn, InputDir, source, mingen, stride, rmsd_cutoff,  parallel='None'):
     ConvertDataToHDF.run(ProjectFn, PDBFn, TutorialDir+"/XTC", "file", 0, 1, None)
     P1 = Project.load_from(ProjectFn)
     
     r_P1 = Project.load_from(os.path.abspath(os.path.join('..', ReferenceDir, ProjectFn)))
     
     eq_(P1.n_trajs, r_P1.n_trajs)
     npt.assert_equal(P1.traj_lengths, r_P1.traj_lengths)
     eq_(os.path.basename(P1.traj_filename(0)), os.path.basename(r_P1.traj_filename(0)))
Пример #3
0
    def test_a_ConvertDataToHDF(self):
        os.chdir(WorkingDir)
        shutil.copy(PDBFn, "./")
        #def run(projectfn, PDBfn, InputDir, source, mingen, stride, rmsd_cutoff,  parallel='None'):
        ConvertDataToHDF.run(ProjectFn, PDBFn, TutorialDir + "/XTC", "file", 0,
                             1, None)
        P1 = Project.load_from(ProjectFn)

        r_P1 = Project.load_from(
            os.path.abspath(os.path.join('..', ReferenceDir, ProjectFn)))

        eq_(P1.n_trajs, r_P1.n_trajs)
        npt.assert_equal(P1.traj_lengths, r_P1.traj_lengths)
        eq_(os.path.basename(P1.traj_filename(0)),
            os.path.basename(r_P1.traj_filename(0)))
Пример #4
0
    def test(self):
        # extract xtcs to a temp dir
        xtc_fn = get('XTC.tgz', just_filename=True)
        fh = tarfile.open(xtc_fn, mode='r:gz')
        fh.extractall(self.td)
        fh.close()

        outfn = pjoin(self.td, 'ProjectInfo.yaml')
        # mode to that directory
        os.chdir(self.td)
        ConvertDataToHDF.run(projectfn=outfn,
                             PDBfn=get('native.pdb', just_filename=True),
                             InputDir=pjoin(self.td, 'XTC'),
                             source='file',
                             min_length=0,
                             stride=1,
                             rmsd_cutoff=np.inf)

        eq(load(outfn), get('ProjectInfo.yaml'))