Example #1
0
 def test_newick_default_values(self):
     parser = cli.get_msp_parser()
     cmd = "newick"
     history_file = "test3.hdf5"
     args = parser.parse_args([cmd, history_file])
     self.assertEqual(args.history_file, history_file)
     self.assertEqual(args.precision, 3)
Example #2
0
 def test_mutations_default_values(self):
     parser = cli.get_msp_parser()
     cmd = "mutations"
     history_file = "test.hdf5"
     args = parser.parse_args([cmd, history_file])
     self.assertEqual(args.history_file, history_file)
     self.assertEqual(args.header, False)
Example #3
0
 def test_newick_long_args(self):
     parser = cli.get_msp_parser()
     cmd = "newick"
     history_file = "test.hdf5"
     args = parser.parse_args([
         cmd, history_file, "--precision=5"])
     self.assertEqual(args.history_file, history_file)
     self.assertEqual(args.precision, 5)
Example #4
0
 def test_newick_short_args(self):
     parser = cli.get_msp_parser()
     cmd = "newick"
     history_file = "test.hdf5"
     args = parser.parse_args([
         cmd, history_file, "-p", "10"])
     self.assertEqual(args.history_file, history_file)
     self.assertEqual(args.precision, 10)
Example #5
0
 def test_mutations_long_args(self):
     parser = cli.get_msp_parser()
     cmd = "mutations"
     history_file = "test.hdf5"
     args = parser.parse_args([
         cmd, history_file, "--header"])
     self.assertEqual(args.history_file, history_file)
     self.assertEqual(args.header, True)
Example #6
0
 def test_records_short_args(self):
     parser = cli.get_msp_parser()
     cmd = "records"
     history_file = "test.hdf5"
     args = parser.parse_args([
         cmd, history_file, "-H"])
     self.assertEqual(args.history_file, history_file)
     self.assertEqual(args.header, True)
Example #7
0
 def test_simulate_default_values(self):
     parser = cli.get_msp_parser()
     cmd = "simulate"
     args = parser.parse_args([cmd, "10", "out.hdf5"])
     self.assertEqual(args.sample_size, 10)
     self.assertEqual(args.history_file, "out.hdf5")
     self.assertEqual(args.recombination_rate, 0.0)
     self.assertEqual(args.mutation_rate, 0.0)
     self.assertEqual(args.num_loci, 1)
     self.assertEqual(args.random_seed, None)
     self.assertEqual(args.max_memory, "1G")
     self.assertEqual(args.compress, False)
Example #8
0
 def test_simulate_short_args(self):
     parser = cli.get_msp_parser()
     cmd = "simulate"
     args = parser.parse_args([
         cmd, "100", "out2.hdf5", "-m", "1e3", "-r", "5", "-u", "2",
         "-s", "1234", "-M", "2G", "-z"])
     self.assertEqual(args.sample_size, 100)
     self.assertEqual(args.history_file, "out2.hdf5")
     self.assertEqual(args.recombination_rate, 5)
     self.assertEqual(args.num_loci, 1000)
     self.assertEqual(args.random_seed, 1234)
     self.assertEqual(args.max_memory, "2G")
     self.assertEqual(args.compress, True)
Example #9
0
 def test_simulate_long_args(self):
     parser = cli.get_msp_parser()
     cmd = "simulate"
     args = parser.parse_args([
         cmd, "1000", "out3.hdf5",
         "--num-loci", "1e4",
         "--recombination-rate", "6",
         "--mutation-rate", "1",
         "--random-seed", "123",
         "--max-memory", "20M",
         "--compress"])
     self.assertEqual(args.sample_size, 1000)
     self.assertEqual(args.history_file, "out3.hdf5")
     self.assertEqual(args.recombination_rate, 6)
     self.assertEqual(args.num_loci, 10000)
     self.assertEqual(args.random_seed, 123)
     self.assertEqual(args.max_memory, "20M")
     self.assertEqual(args.compress, True)
Example #10
0
 def test_macs_default_values(self):
     parser = cli.get_msp_parser()
     cmd = "macs"
     history_file = "test2.hdf5"
     args = parser.parse_args([cmd, history_file])
     self.assertEqual(args.history_file, history_file)