Example #1
0
    def test_pred_rna_kall_trans(self):
        design = "./data/small_leucegene/5_inv16_vs_5/design.tsv"
        anno = "./data/small_genome/Homo_sapiens.GRCh38.84.reduce.gff3"

        args = Namespace(**vars(default_args))
        args.DESIGN = design
        args.N_DRAW = 10
        args.LOG = True
        args.CPM = True
        args.ANNO = anno
        args.KAL = True

        with captured_output() as (out, err):
            tpr.main_pred_rna(args, None)

        output = out.getvalue()
        all_lines = output.split("\n")

        selected_line = all_lines[0].split("\t")
        self.assertEqual(selected_line[2], "kernel_mcc",
                         "Test fail: test_pred_rna_kall_trans -> header")

        selected_line = all_lines[1].split("\t")
        self.assertEqual(selected_line[2], "0.5827131783528432",
                         "Test fail: test_pred_rna_kall_trans -> MCC")
Example #2
0
    def test_pred_rna_kall_miss_anno(self):
        design = "./data/small_leucegene/5_inv16_vs_5/design.tsv"
        anno = "./data/small_genome/Homo_sapiens.GRCh38.84.reduce2.gff3"

        args = Namespace(**vars(default_args))
        args.DESIGN = design
        args.N_DRAW = 10
        args.LOG = True
        args.CPM = True
        args.ANNO = anno
        args.GENE = True
        args.KAL = True

        with captured_output() as (out, err):
            tpr.main_pred_rna(args, None)

        output = out.getvalue()
        all_lines = output.split("\n")
        selected_line = all_lines[len(all_lines) - 2].split("\t")

        self.assertEqual(selected_line[0], "ENST00000411957",
                         "Test fail: test_pred_rna_kall_miss_anno -> ENST")
Example #3
0
    def test_pred_rna_cpm(self):
        design = "./data/small_for_test/design.tsv"
        mat = "./data/small_for_test/matrix.tsv"

        args = Namespace(**vars(default_args))
        args.DESIGN = design
        args.MATRIX = mat
        args.LOG = True
        args.L2FC = 0.3
        args.CPM = True

        with captured_output() as (out, err):
            tpr.main_pred_rna(args, None)

        output = out.getvalue()
        all_lines = output.split("\n")

        selected_line = all_lines[0].split("\t")

        selected_line = all_lines[1].split("\t")
        self.assertEqual(selected_line[1], "2.764979565971643",
                         "Test fail: test_pred_rna_cpm -> L2FC with CPM")