예제 #1
0
 def setup(self):
     self.p = ArgumentParser()
예제 #2
0
    logger.info("Generated: %s, Trajectories/", projectfn)

    return


if __name__ == "__main__":
    parser = ArgumentParser(description="""
Merges individual XTC files into continuous lossy HDF5 (.lh5) trajectories.

Can read data from a FAH project (PROJECT/RUN*/CLONE*/frame*.xtc) or from
a directory containing one directory for each trajectory, with all the
relevant XTCs inside that directory (PROJECT/TRAJ*/frame*.xtc).

Output:
  -- 'Trajectories' directory containing all the merged lh5 files
  -- 'ProjectInfo' file containing information MSMBuilder uses in subsequent
     calculations.

NOTE: There has been a change from previous versions of MSMBuilder with
regards to the way snapshots are discarded. In the 'FAH' style reader,
there is an automatic check to see if any two snapshots are the same at
the beginning/end of consecutive xtc/dcd files. If they are the same, one
gets discarded. Further, the FahProject object retains a little more discard
functionality.
""")

    parser.add_argument('project',
                        type=str,
                        help='''The ProjectInfo (.h5) file
        that contains a mapping of the previous work done. If you specify a file that
        exists on disk, conversion will pick up where it left off and simply add data
예제 #3
0
class tester():
    def setup(self):
        self.p = ArgumentParser()

    def cmd(self, value):
        sys.argv = [os.path.abspath(__file__)]
        for e in value.split():
            sys.argv.append(e)

    @property
    def v(self):
        return self.p.parse_args(print_banner=False)

    def add(self, *args, **kwargs):
        self.p.add_argument(*args, **kwargs)

    def test_0(self):
        self.add('a', nargs='+')
        self.cmd('-a 1 2')
        eq_(self.v.a, ['1', '2'])

    def test_1(self):
        self.add('a', nargs='+', type=int)
        self.cmd('-a 1 2')

        eq_(self.v.a, [1, 2])

    def test_2(self):
        self.add('a', type=int)
        self.cmd('-a 4')
        eq_(self.v.a, 4)

    def test_3(self):
        self.add('a', type=float)
        self.cmd('-a 5')
        eq_(self.v.a, 5.0)

    @raises(SystemExit)
    def test_4(self):
        sys.stderr = open('/dev/null', 'w')
        self.add('a', choices=[1, 2], type=float)
        self.cmd('-a 5')
        eq_(self.v.a, 5.0)
        sys.stderr = sys.__stderr__

    def test_5(self):
        self.add('a', choices=['1', '2'], type=int)
        self.cmd('-a 1')
        eq_(self.v.a, 1.0)

#  @expected_failure

    def test_6(self):
        self.add('a', choices=[1, 2], type=int)
        self.cmd('-a 1')
        eq_(self.v.a, 1)

    def test_7(self):
        self.add('a', action='store_true', type=bool)
        self.cmd('-a')
        eq_(self.v.a, True)

    def test_71(self):
        self.add('a', action='store_false', type=bool)
        self.cmd('-a')
        eq_(self.v.a, False)

    def test_8(self):
        self.add('a', action='store_true')
        self.cmd('-a')
        eq_(self.v.a, True)

    def test_81(self):
        self.add('b', action='store_false')
        self.cmd('-b')
        eq_(self.v.b, False)

    def test_9(self):
        self.add('a', default=False, action='store_true', type=bool)
        self.cmd('')
        eq_(self.v.a, False)

    def test_10(self):
        self.add('a', action='store_true', type=bool)
        self.cmd('')
        eq_(self.v.a, False)
예제 #4
0
 def setup(self):
     self.p = ArgumentParser()
예제 #5
0
    logger.info("Generated: %s, Trajectories/", projectfn)
    
    return


if __name__ == "__main__":
    parser = ArgumentParser(description="""
Merges individual XTC files into continuous lossy HDF5 (.lh5) trajectories.

Can read data from a FAH project (PROJECT/RUN*/CLONE*/frame*.xtc) or from
a directory containing one directory for each trajectory, with all the
relevant XTCs inside that directory (PROJECT/TRAJ*/frame*.xtc).

Output:
  -- 'Trajectories' directory containing all the merged lh5 files
  -- 'ProjectInfo' file containing information MSMBuilder uses in subsequent
     calculations.

NOTE: There has been a change from previous versions of MSMBuilder with
regards to the way snapshots are discarded. In the 'FAH' style reader,
there is an automatic check to see if any two snapshots are the same at
the beginning/end of consecutive xtc/dcd files. If they are the same, one
gets discarded. Further, the FahProject object retains a little more discard
functionality.
""")
    
    parser.add_argument('project', type=str, help='''The ProjectInfo (.h5) to
        write to disk. Contains metadata associated with your project''')
    parser.add_argument('pdb')
    parser.add_argument('input_dir', help='''Path to the parent directory
        containing subdirectories with MD (.xtc/.dcd) data. See the description above
예제 #6
0
class tester():
    def setup(self):
        self.p = ArgumentParser()
    
    def cmd(self, value):
        sys.argv = [os.path.abspath(__file__)]
        for e in value.split():
            sys.argv.append(e)
    
    @property
    def v(self):
        return self.p.parse_args(print_banner=False)

    def add(self, *args, **kwargs):
        self.p.add_argument(*args, **kwargs)

    def test_0(self):
        self.add('a', nargs='+')
        self.cmd('-a 1 2')
        eq_(self.v.a, ['1', '2'])
 
    def test_1(self):
        self.add('a', nargs='+', type=int)
        self.cmd('-a 1 2')
        
        eq_(self.v.a, [1, 2])
        
    def test_2(self):
        self.add('a', type=int)
        self.cmd('-a 4')
        eq_(self.v.a, 4)
    
    def test_3(self):
        self.add('a', type=float)
        self.cmd('-a 5')
        eq_(self.v.a, 5.0)
    
    @raises(SystemExit)
    def test_4(self):
        sys.stderr = open('/dev/null', 'w')
        self.add('a', choices=[1,2], type=float)
        self.cmd('-a 5')
        eq_(self.v.a, 5.0)
        sys.stderr = sys.__stderr__
    
    def test_5(self):
        self.add('a', choices=['1', '2'], type=int)
        self.cmd('-a 1')
        eq_(self.v.a, 1.0)
    
    def test_6(self):
        self.add('a', choices=[1, 2], type=int)
        self.cmd('-a 1')
        eq_(self.v.a, 1)
        
    def test_7(self):
        self.add('a', action='store_true', type=bool)
        self.cmd('-a')
        eq_(self.v.a, True)
    
    def test_71(self):
        self.add('a', action='store_false', type=bool)
        self.cmd('-a')
        eq_(self.v.a, False)
    
    def test_8(self):
        self.add('a', action='store_true')
        self.cmd('-a')
        eq_(self.v.a, True)
    
    def test_81(self):
        self.add('b', action='store_false')
        self.cmd('-b')
        eq_(self.v.b, False)

    def test_9(self):
        self.add('a', default=False, action='store_true', type=bool)
        self.cmd('')
        eq_(self.v.a, False)    

    def test_10(self):
        self.add('a', action='store_true', type=bool)
        self.cmd('')
        eq_(self.v.a, False)
예제 #7
0
    logger.info("Generated: %s, Trajectories/", projectfn)
    
    return


if __name__ == "__main__":
    parser = ArgumentParser(description="""
Merges individual XTC files into continuous lossy HDF5 (.lh5) trajectories.

Can read data from a FAH project (PROJECT/RUN*/CLONE*/frame*.xtc) or from
a directory containing one directory for each trajectory, with all the
relevant XTCs inside that directory (PROJECT/TRAJ*/frame*.xtc).

Output:
  -- 'Trajectories' directory containing all the merged lh5 files
  -- 'ProjectInfo' file containing information MSMBuilder uses in subsequent
     calculations.

NOTE: There has been a change from previous versions of MSMBuilder with
regards to the way snapshots are discarded. In the 'FAH' style reader,
there is an automatic check to see if any two snapshots are the same at
the beginning/end of consecutive xtc/dcd files. If they are the same, one
gets discarded. Further, the FahProject object retains a little more discard
functionality.
""")
    
    parser.add_argument('project', type=str, help='''The ProjectInfo (.h5) to
        write to disk. Contains metadata associated with your project''')
    parser.add_argument('pdb')
    parser.add_argument('input_dir', help='''Path to the parent directory
        containing subdirectories with MD (.xtc/.dcd) data. See the description above
예제 #8
0
from mdtraj.utils import ensure_type

logger = logging.getLogger('msmbuilder.scripts.ConvertDataToHDF')


parser = ArgumentParser(description="""
Merges individual MD trajectory files into continuous HDF5 (.h5) trajectories.

Can read data from a FAH project (PROJECT/RUN*/CLONE*/frame*.xtc) or from
a directory containing one directory for each trajectory, with all the
relevant XTCs inside that directory (PROJECT/TRAJ*/frame*.xtc).

Can read any format compatible with mdtraj.

Output:
-- 'Trajectories' directory containing all the merged h5 files
-- 'ProjectInfo' file containing information MSMBuilder uses in subsequent
 calculations.

NOTE: There has been a change from previous versions of MSMBuilder with
regards to the way snapshots are discarded. In the 'FAH' style reader,
there is an automatic check to see if any two snapshots are the same at
the beginning/end of consecutive xtc/dcd files. If they are the same, one
gets discarded. Further, the FahProject object retains a little more discard
functionality.
""")
parser.add_argument('project', type=str, help='''The ProjectInfo (.h5) to
    write to disk. Contains metadata associated with your project''')
parser.add_argument('pdb')
parser.add_argument('input_dir', help='''Path to the parent directory
    containing subdirectories with MD data. See the description above
예제 #9
0
    logger.info("Generated: %s, Trajectories/", projectfn)
    
    return


if __name__ == "__main__":
    parser = ArgumentParser(description="""
Merges individual XTC files into continuous lossy HDF5 (.lh5) trajectories.

Can read data from a FAH project (PROJECT/RUN*/CLONE*/frame*.xtc) or from
a directory containing one directory for each trajectory, with all the
relevant XTCs inside that directory (PROJECT/TRAJ*/frame*.xtc).

Output:
  -- 'Trajectories' directory containing all the merged lh5 files
  -- 'ProjectInfo' file containing information MSMBuilder uses in subsequent
     calculations.

NOTE: There has been a change from previous versions of MSMBuilder with
regards to the way snapshots are discarded. In the 'FAH' style reader,
there is an automatic check to see if any two snapshots are the same at
the beginning/end of consecutive xtc/dcd files. If they are the same, one
gets discarded. Further, the FahProject object retains a little more discard
functionality.
""")
    
    parser.add_argument('project', type=str, help='''The ProjectInfo (.h5) file
        that contains a mapping of the previous work done. If you specify a file that
        exists on disk, conversion will pick up where it left off and simply add data
        to what has already been done. If you specify a file that doesn't exist, the
        conversion starts from the beginning and writes a ProjectInfo file with that name
from msmbuilder.arglib import ArgumentParser, die_if_path_exists
from mdtraj.utils import ensure_type

logger = logging.getLogger('msmbuilder.scripts.ConvertDataToHDF')

parser = ArgumentParser(description="""
Merges individual MD trajectory files into continuous HDF5 (.h5) trajectories.

Can read data from a FAH project (PROJECT/RUN*/CLONE*/frame*.xtc) or from
a directory containing one directory for each trajectory, with all the
relevant XTCs inside that directory (PROJECT/TRAJ*/frame*.xtc).

Can read any format compatible with mdtraj.

Output:
-- 'Trajectories' directory containing all the merged h5 files
-- 'ProjectInfo' file containing information MSMBuilder uses in subsequent
 calculations.

NOTE: There has been a change from previous versions of MSMBuilder with
regards to the way snapshots are discarded. In the 'FAH' style reader,
there is an automatic check to see if any two snapshots are the same at
the beginning/end of consecutive xtc/dcd files. If they are the same, one
gets discarded. Further, the FahProject object retains a little more discard
functionality.
""")
parser.add_argument('project',
                    type=str,
                    help='''The ProjectInfo (.h5) to
    write to disk. Contains metadata associated with your project''')
parser.add_argument('pdb')