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")
def test_pred_rna_kall_gene_bagging_tpm(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.BS = 5 args.LOG = True args.N_DRAW = 10 args.N_BAGGING = 10 args.TPM = 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[1].split("\t") self.assertEqual( selected_line[1], "2.320041910153135", "Test fail: test_pred_rna_kall_gene_bagging_tpm -> L2FC TPM")
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")