Ejemplo n.º 1
0
 def test_filter_single_subset_exclude(self):
     exps = [(None, ['sample2']), ("Study='A'", ['sample2']),
             ("Study='A' OR Study='B'", ['sample2'])]
     for (where, exp) in exps:
         dir_fmt = filter_samples(self.sample_single, self.md_single_subset,
                                  where, True)
         self._assert_single_contains(dir_fmt, exp)
Ejemplo n.º 2
0
 def test_filter_paired_subset(self):
     exps = [(None, ['sample1R1', 'sample1R2']),
             ("Study='A'", ['sample1R1', 'sample1R2']),
             ("Study='A' OR Study='B'", ['sample1R1', 'sample1R2'])]
     for (where, exp) in exps:
         dir_fmt = filter_samples(self.sample_paired,
                                  self.md_paired_subset, where, False)
         self._assert_paired_contains(dir_fmt, exp)
Ejemplo n.º 3
0
 def test_filter_single_all(self):
     exps = [(None, ['sample1', 'sample2']), ("Study='A'", ['sample1']),
             ("Study='B'", ['sample2']),
             ("Study='A' OR Study='B'", ['sample1', 'sample2'])]
     for (where, exp) in exps:
         dir_fmt = filter_samples(self.sample_single, self.md_single_all,
                                  where, False)
         self._assert_single_contains(dir_fmt, exp)
Ejemplo n.º 4
0
 def test_filter_paired_all_exclude(self):
     exps = [(None, []), ("Study='A'", ['sample2R1', 'sample2R2']),
             ("Study='B'", ['sample1R1', 'sample1R2']),
             ("Study='A' OR Study='B'", [])]
     for (where, exp) in exps:
         dir_fmt = filter_samples(self.sample_paired, self.md_paired_all,
                                  where, True)
         self._assert_paired_contains(dir_fmt, exp)
Ejemplo n.º 5
0
 def test_filter_single_subset_no_filter(self):
     wheres = ["Study='B'", "Study='A' AND Study='B'"]
     for where in wheres:
         with self.assertRaisesRegex(ValueError, 'No'):
             filter_samples(self.sample_single, self.md_single_subset,
                            where, False)
Ejemplo n.º 6
0
 def test_filter_paired_none_exclude_no_filter(self):
     wheres = ["Study='B'", "Study='A' AND Study='B'"]
     for where in wheres:
         with self.assertRaisesRegex(ValueError, 'No'):
             filter_samples(self.sample_paired, self.md_paired_none, where,
                            True)
Ejemplo n.º 7
0
 def test_filter_paired_id_not_present(self):
     wheres = [None, "Study='A'", "Study='A' OR Study='B'"]
     for where in wheres:
         with self.assertRaisesRegex(ValueError, '1'):
             filter_samples(self.sample_paired, self.md_paired_none, where,
                            False)