Ejemplo n.º 1
0
 def test_resampling_adaptive(self):
     args = [
         ctrl_data_txt, exp_data_txt, annotation, output, "-s", "1000", "-a"
     ]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
Ejemplo n.º 2
0
 def test_resampling_ZINFNB(self):
     args = [
         ctrl_rep1, ctrl_rep2, small_annotation, output, "-s", "1000", "-n",
         "zinfnb"
     ]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
Ejemplo n.º 3
0
 def test_resampling_multistrain(self):
     args = [ctrl_data_txt, exp_data_txt, ','.join([small_annotation, small_annotation]), output, "-h"]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
     self.assertTrue(
             os.path.isdir(hist_path),
             "histpath expected: %s" % (hist_path))
Ejemplo n.º 4
0
 def test_resampling_histogram(self):
     args = [ctrl_data_txt, exp_data_txt, small_annotation, output, "-s", "1000", "-h"]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
     self.assertTrue(
             os.path.isdir(hist_path),
             "histpath expected: %s" % (hist_path))
Ejemplo n.º 5
0
 def test_resampling_TotReads(self):
     args = [ctrl_rep1, ctrl_rep2, small_annotation, output, "-s", "1000", "-n", "totreads"]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
     pvals, qvals = significant_pvals_qvals(output)
     self.assertLessEqual(len(pvals), 5)
     self.assertLessEqual(len(qvals), 1)
Ejemplo n.º 6
0
 def test_resampling_TTR(self):
     args = [
         ctrl_rep1, ctrl_rep2, annotation, output, "-s", "1000", "-n", "TTR"
     ]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
     hits = count_hits(output)
     self.assertLessEqual(hits, 10)
Ejemplo n.º 7
0
 def test_resampling_multistrain(self):
     args = [
         ctrl_data_txt, exp_data_txt,
         ','.join([small_annotation, small_annotation]), output, "-h"
     ]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
     self.assertTrue(os.path.isdir(hist_path),
                     "histpath expected: %s" % (hist_path))
Ejemplo n.º 8
0
 def test_resampling_histogram(self):
     args = [
         ctrl_data_txt, exp_data_txt, small_annotation, output, "-s",
         "1000", "-h"
     ]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
     self.assertTrue(os.path.isdir(hist_path),
                     "histpath expected: %s" % (hist_path))
Ejemplo n.º 9
0
 def test_resampling_NZMean(self):
     args = [
         ctrl_rep1, ctrl_rep2, small_annotation, output, "-s", "1000", "-n",
         "nzmean"
     ]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
     pvals, qvals = significant_pvals_qvals(output)
     self.assertLessEqual(len(pvals), 5)
     self.assertLessEqual(len(qvals), 1)
Ejemplo n.º 10
0
 def test_resampling(self):
     args = [ctrl_data_txt, exp_data_txt, small_annotation, output, "-l"]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     (sig_pvals, sig_qvals) = (significant_pvals_qvals(output, pcol=-2, qcol=-1))
     self.assertLessEqual(
             abs(len(sig_pvals) - 37),
             2,
             "sig_pvals expected in range: %s, actual: %d" % ("[35, 39]", len(sig_qvals)))
     self.assertLessEqual(
             abs(len(sig_qvals) - 35),
             2,
             "sig_qvals expected in range: %s, actual: %d" % ("[33, 37]", len(sig_qvals)))
Ejemplo n.º 11
0
 def test_resampling_adaptive(self):
     args = [ctrl_data_txt, exp_data_txt, small_annotation, output, "-a"]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
     (sig_pvals, sig_qvals) = (significant_pvals_qvals(output, pcol=-2, qcol=-1))
     self.assertLessEqual(
             abs(len(sig_pvals) - 37),
             2,
             "sig_pvals expected in range: %s, actual: %d" % ("[35, 39]", len(sig_qvals)))
     self.assertLessEqual(
             abs(len(sig_qvals) - 35),
             1,
             "sig_qvals expected in range: %s, actual: %d" % ("[34, 36]", len(sig_qvals)))
Ejemplo n.º 12
0
 def test_resampling(self):
     args = [ctrl_data_txt, exp_data_txt, small_annotation, output, "-l"]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     (sig_pvals, sig_qvals) = (significant_pvals_qvals(output,
                                                       pcol=-2,
                                                       qcol=-1))
     self.assertLessEqual(
         abs(len(sig_pvals) - 37), 2,
         "sig_pvals expected in range: %s, actual: %d" %
         ("[35, 39]", len(sig_qvals)))
     self.assertLessEqual(
         abs(len(sig_qvals) - 35), 2,
         "sig_qvals expected in range: %s, actual: %d" %
         ("[33, 37]", len(sig_qvals)))
Ejemplo n.º 13
0
 def test_resampling_combined_wig(self):
     # The conditions in the args should be matched case-insensitively.
     args = ["-c", combined_wig, samples_metadata, "Glycerol", "cholesterol", small_annotation, output, "-a"]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
     (sig_pvals, sig_qvals) = (significant_pvals_qvals(output, pcol=-2, qcol=-1))
     print(len(sig_pvals))
     print(len(sig_qvals))
     self.assertLessEqual(
             abs(len(sig_pvals) - 37),
             2,
             "sig_pvals expected in range: %s, actual: %d" % ("[35, 39]", len(sig_qvals)))
     self.assertLessEqual(
             abs(len(sig_qvals) - 35),
             1,
             "sig_qvals expected in range: %s, actual: %d" % ("[34, 36]", len(sig_qvals)))
Ejemplo n.º 14
0
 def test_resampling_adaptive(self):
     args = [
         ctrl_data_txt, exp_data_txt, small_annotation, output, "-a",
         "--ctrl_lib", "AA", "--exp_lib", "AAA"
     ]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
     (sig_pvals, sig_qvals) = (significant_pvals_qvals(output,
                                                       pcol=-2,
                                                       qcol=-1))
     self.assertLessEqual(
         abs(len(sig_pvals) - 37), 2,
         "sig_pvals expected in range: %s, actual: %d" %
         ("[35, 39]", len(sig_qvals)))
     self.assertLessEqual(
         abs(len(sig_qvals) - 35), 2,
         "sig_qvals expected in range: %s, actual: %d" %
         ("[34, 36]", len(sig_qvals)))
Ejemplo n.º 15
0
 def test_resampling_combined_wig(self):
     # The conditions in the args should be matched case-insensitively.
     args = [
         "-c", combined_wig, samples_metadata, "Glycerol", "cholesterol",
         small_annotation, output, "-a"
     ]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))
     (sig_pvals, sig_qvals) = (significant_pvals_qvals(output,
                                                       pcol=-2,
                                                       qcol=-1))
     print(len(sig_pvals))
     print(len(sig_qvals))
     self.assertLessEqual(
         abs(len(sig_pvals) - 37), 2,
         "sig_pvals expected in range: %s, actual: %d" %
         ("[35, 39]", len(sig_qvals)))
     self.assertLessEqual(
         abs(len(sig_qvals) - 35), 1,
         "sig_qvals expected in range: %s, actual: %d" %
         ("[34, 36]", len(sig_qvals)))
Ejemplo n.º 16
0
 def test_resampling_ZINFNB(self):
     args = [ctrl_rep1, ctrl_rep2, small_annotation, output, "-s", "1000", "-n", "zinfnb"]
     G = ResamplingMethod.fromargs(args)
     G.Run()
     self.assertTrue(os.path.exists(output))