Browse code

add a function and testing script to select transcript models by # of exons and transcript length

Peng Liu authored on 11/02/2018 22:18:36
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,18 @@
1
+main <- function() {
2
+    context('selModel')
3
+
4
+    fin_gtf  = system.file('extdata/gtf/selModel_in.gtf',  package='pram')
5
+    fcmp_gtf = system.file('extdata/gtf/selModel_out.gtf', package='pram')
6
+    fout_gtf = paste0(tempdir(), '/pram_selModel_out.gtf')
7
+
8
+    selModel(fin_gtf, fout_gtf, min_n_exon=2, min_tr_len=200,
9
+             info_keys=c('transcript_id', 'gene_id'))
10
+
11
+    cmp_lines = readLines(fcmp_gtf)
12
+    out_lines = readLines(fout_gtf)
13
+
14
+    test_that(paste0(fout_gtf, ' vs ', fcmp_gtf),
15
+              expect_identical(cmp_lines, out_lines))
16
+}
17
+
18
+main()