def test_pred_rna_kall_gene(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.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[0].split("\t") self.assertEqual(selected_line[2], "kernel_mcc", "Test fail: test_pred_rna_kall_gene -> header") selected_line = all_lines[1].split("\t") self.assertEqual(selected_line[2], "1.0", "Test fail: test_pred_rna_kall_gene -> 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")