Browse code

Update version 1.9.1

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/seqTools@128664 bc3139a8-67e5-0310-9ffc-ced21a209358

Wolfgang Kaisers authored on 13/04/2017 16:00:27
Showing1 changed files
... ...
@@ -1,8 +1,24 @@
1 1
 
2
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
3
+## Load prerequisites
4
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
5
+
2 6
 library(seqTools)
3 7
 
4
-filename <- "test_seqTools.r"
8
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
9
+## Initialize example data
10
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
11
+
12
+basedir<-system.file("extdata",package="seqTools")
13
+
14
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
15
+## Run tests
16
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
17
+
18
+filename <- "test_seqTools.R"
5 19
 basedir <- system.file("extdata", package = "seqTools")
20
+load(file.path(basedir,"test_res.RData"))
21
+
6 22
 
7 23
 ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
8 24
 ## countDnaKmers
... ...
@@ -10,7 +26,7 @@ basedir <- system.file("extdata", package = "seqTools")
10 26
 
11 27
 if(!identical(countDnaKmers("ACGT", k = 1, start = 3:1, width = 1), cdk_ACGT))
12 28
     stop("[countDnaKmers] Test 1 '", filename, "' FAILED!")
13
-   
29
+
14 30
 if(!identical(countDnaKmers("ACGT", k = 1, start = 3, width = 1), cdk_ACGT_one))
15 31
     stop("[countDnaKmers] Test 2 '", filename, "' FAILED!")
16 32
 
... ...
@@ -27,49 +43,6 @@ if(!identical(
27 43
     stop("[revCountDnaKmers] Test 1 '", filename, "' FAILED!")
28 44
 
29 45
 
30
-## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
31
-## kmerCount.fastqq
32
-## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
33
-
34
-fq <- fastqq(file.path(basedir, "test_l5_N.fq"), k = 2)
35
-if(!identical(kmerCount(fq), kmer_l5_N))
36
-    stop("[kmerCount.fastqq] Test 1 '", filename, "' FAILED!")
37
-
38
-fq<-fastqq(file.path(basedir, "test_l6.fq"), k = 2)
39
-if(!identical(kmerCount(fq), kmer_l6))
40
-    stop("[kmerCount.fastqq] Test 2 '", filename, "' FAILED!")
41
-
42
-fq<-fastqq(file.path(basedir, "test_l6_multi_line.fq"), k = 2)
43
-if(!identical(kmerCount(fq), kmer_l6_ml))
44
-    stop("[kmerCount.fastqq] Test 3 '", filename, "' FAILED!")
45
-
46
-fq<-fastqq(file.path(basedir, "test_l10_20_40.fq"),k = 2)
47
-if(!identical(kmerCount(fq), kmer_l10_20))
48
-    stop("[kmerCount.fastqq] Test 4 '", filename, "' FAILED!")
49
-
50
-fq<-fastqq(file.path(basedir, "test_l10_atcg.fq"), k = 2)
51
-if(!identical(kmerCount(fq), kmer_l10_atcg))
52
-    stop("[kmerCount.fastqq] Test 5 '", filename, "' FAILED!")
53
-
54
-fq<-fastqq(file.path(basedir, "test_l10_ATCGN.fq"), k = 2)
55
-if(!identical(kmerCount(fq), kmer_l10_ATCGN))
56
-    stop("[kmerCount.fastqq] Test 6 '", filename, "' FAILED!")
57
-
58
-## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
59
-## ascii2char, char2ascii
60
-## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
61
-
62
-if(!identical(ascii2char(97:101, multiple = FALSE), "abcde"))
63
-    stop("[ascii2char] Test 1 '", filename, "' FAILED!")
64
-
65
-if(!identical(ascii2char(97:101, multiple = TRUE), letters[1:5]))
66
-    stop("[ascii2char] Test 2 '", filename, "' FAILED!")
67
-
68
-if(!identical(ascii2char(char2ascii("abcde")), "abcde"))
69
-    stop("[ascii2char] Test 3 '", filename, "' FAILED!")
70
-
71
-if(!identical(char2ascii("abcde"), 97:101))
72
-    stop("[char2ascii] Test 1 '", filename, "' FAILED!")
73 46
 
74 47
 ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
75 48
 ## END OF FILE
Browse code

add seqTools package

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/seqTools@95415 bc3139a8-67e5-0310-9ffc-ced21a209358

Herve Pages authored on 13/10/2014 19:02:34
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,76 @@
1
+
2
+library(seqTools)
3
+
4
+filename <- "test_seqTools.r"
5
+basedir <- system.file("extdata", package = "seqTools")
6
+
7
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
8
+## countDnaKmers
9
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
10
+
11
+if(!identical(countDnaKmers("ACGT", k = 1, start = 3:1, width = 1), cdk_ACGT))
12
+    stop("[countDnaKmers] Test 1 '", filename, "' FAILED!")
13
+   
14
+if(!identical(countDnaKmers("ACGT", k = 1, start = 3, width = 1), cdk_ACGT_one))
15
+    stop("[countDnaKmers] Test 2 '", filename, "' FAILED!")
16
+
17
+if(!identical(
18
+        countDnaKmers("ATTNAC", k = 2, start = 1:3, width = 1), cdk_ATTNAC))
19
+    stop("[countDnaKmers] Test 3 '", filename, "' FAILED!")
20
+
21
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
22
+## revCountDnaKmers
23
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
24
+
25
+if(!identical(
26
+        revCountDnaKmers("ACGTACGT", k = 2, start = 6:4, width = 2), rck_ACGT))
27
+    stop("[revCountDnaKmers] Test 1 '", filename, "' FAILED!")
28
+
29
+
30
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
31
+## kmerCount.fastqq
32
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
33
+
34
+fq <- fastqq(file.path(basedir, "test_l5_N.fq"), k = 2)
35
+if(!identical(kmerCount(fq), kmer_l5_N))
36
+    stop("[kmerCount.fastqq] Test 1 '", filename, "' FAILED!")
37
+
38
+fq<-fastqq(file.path(basedir, "test_l6.fq"), k = 2)
39
+if(!identical(kmerCount(fq), kmer_l6))
40
+    stop("[kmerCount.fastqq] Test 2 '", filename, "' FAILED!")
41
+
42
+fq<-fastqq(file.path(basedir, "test_l6_multi_line.fq"), k = 2)
43
+if(!identical(kmerCount(fq), kmer_l6_ml))
44
+    stop("[kmerCount.fastqq] Test 3 '", filename, "' FAILED!")
45
+
46
+fq<-fastqq(file.path(basedir, "test_l10_20_40.fq"),k = 2)
47
+if(!identical(kmerCount(fq), kmer_l10_20))
48
+    stop("[kmerCount.fastqq] Test 4 '", filename, "' FAILED!")
49
+
50
+fq<-fastqq(file.path(basedir, "test_l10_atcg.fq"), k = 2)
51
+if(!identical(kmerCount(fq), kmer_l10_atcg))
52
+    stop("[kmerCount.fastqq] Test 5 '", filename, "' FAILED!")
53
+
54
+fq<-fastqq(file.path(basedir, "test_l10_ATCGN.fq"), k = 2)
55
+if(!identical(kmerCount(fq), kmer_l10_ATCGN))
56
+    stop("[kmerCount.fastqq] Test 6 '", filename, "' FAILED!")
57
+
58
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
59
+## ascii2char, char2ascii
60
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
61
+
62
+if(!identical(ascii2char(97:101, multiple = FALSE), "abcde"))
63
+    stop("[ascii2char] Test 1 '", filename, "' FAILED!")
64
+
65
+if(!identical(ascii2char(97:101, multiple = TRUE), letters[1:5]))
66
+    stop("[ascii2char] Test 2 '", filename, "' FAILED!")
67
+
68
+if(!identical(ascii2char(char2ascii("abcde")), "abcde"))
69
+    stop("[ascii2char] Test 3 '", filename, "' FAILED!")
70
+
71
+if(!identical(char2ascii("abcde"), 97:101))
72
+    stop("[char2ascii] Test 1 '", filename, "' FAILED!")
73
+
74
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##
75
+## END OF FILE
76
+## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ##