git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MotifDb@107857 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -1,6 +1,6 @@ |
1 | 1 |
library (MotifDb) |
2 | 2 |
library (RUnit) |
3 |
-library (MotIV) |
|
3 |
+#library (MotIV) |
|
4 | 4 |
library (seqLogo) |
5 | 5 |
#------------------------------------------------------------------------------------------------------------------------ |
6 | 6 |
run.tests = function () |
... | ... |
@@ -33,8 +33,8 @@ run.tests = function () |
33 | 33 |
test.export_memeFormatToFile () |
34 | 34 |
test.export_memeFormatToFileDuplication () |
35 | 35 |
test.export_memeFormatToFile_run_tomtom () |
36 |
- test.run_MotIV () |
|
37 |
- test.MotIV.toTable () |
|
36 |
+ #test.run_MotIV () |
|
37 |
+ #test.MotIV.toTable () |
|
38 | 38 |
test.flyFactorGeneSymbols() |
39 | 39 |
|
40 | 40 |
} # run.tests |
... | ... |
@@ -123,7 +123,7 @@ test.allMatricesAreNormalized = function () |
123 | 123 |
matrices = mdb@listData |
124 | 124 |
# a lenient test required by "Cparvum-UniPROBE-Cgd2_3490.UP00395" and "Hsapiens-UniPROBE-Sox4.UP00401" |
125 | 125 |
# for reasons not yet explored. 10e-8 should be be possible |
126 |
- checkTrue (all (sapply (matrices, function (m) all (abs (colSums (m) - 1.0) < 0.02)))) |
|
126 |
+ checkTrue(all(sapply(matrices, function (m) all (abs (colSums (m) - 1.0) < 0.02)))) |
|
127 | 127 |
|
128 | 128 |
} # test.allMatricesAreNormalized |
129 | 129 |
#------------------------------------------------------------------------------------------------------------------------ |
... | ... |
@@ -160,9 +160,8 @@ test.geneIdsAndTypes = function () |
160 | 160 |
checkTrue(typeCounts$ENTREZ == 2347) |
161 | 161 |
checkTrue(typeCounts$FLYBASE >= 47) |
162 | 162 |
checkTrue(typeCounts$SGD >= 629) |
163 |
- checkEquals(nrow(subset(tbl, is.na(geneIdType))), 1181) |
|
163 |
+ checkEquals(nrow(subset(tbl, is.na(geneIdType))), 2055) |
|
164 | 164 |
|
165 |
- |
|
166 | 165 |
empty.count = length (which (geneIds == '')) |
167 | 166 |
checkEquals (empty.count, 0) |
168 | 167 |
|
... | ... |
@@ -219,7 +218,7 @@ test.longNames = function () |
219 | 218 |
longNames = strsplit (names (mdb), '-') |
220 | 219 |
organisms = unique (sapply (longNames, '[', 1)) |
221 | 220 |
|
222 |
- dataSources = unique (sapply (longNames, '[', 2)) |
|
221 |
+ dataSources = unique (lapply (longNames, '[', 2)) |
|
223 | 222 |
|
224 | 223 |
recognized.dataSources = unique (mcols(mdb)$dataSource) |
225 | 224 |
recognized.organisms = unique (mcols(mdb)$organism) |
... | ... |
@@ -227,7 +226,7 @@ test.longNames = function () |
227 | 226 |
# so that it can be matched up against the 'NA' extracted from longNames just above |
228 | 227 |
na.indices = which (is.na (recognized.organisms)) |
229 | 228 |
if (length (na.indices) > 0) |
230 |
- recognized.organisms [na.indices] = 'NA' |
|
229 |
+ recognized.organisms [na.indices] = 'NA' |
|
231 | 230 |
|
232 | 231 |
checkTrue (all (organisms %in% recognized.organisms)) |
233 | 232 |
checkTrue (all (dataSources %in% recognized.dataSources)) |
... | ... |
@@ -271,7 +270,7 @@ test.flyBindingDomains = function () |
271 | 270 |
checkEquals (tmp$Homeobox, 212) |
272 | 271 |
checkEquals (tmp[['zf-C2H2']], 160) |
273 | 272 |
checkEquals (tmp[["Helix-Turn-Helix"]], 182) |
274 |
- checkEquals (length (which (is.na (subset (x, organism=='Dmelanogaster')$bindingDomain))), 24) |
|
273 |
+ checkEquals (length (which (is.na (subset (x, organism=='Dmelanogaster')$bindingDomain))), 162) # lots of cisbp |
|
275 | 274 |
|
276 | 275 |
} # test.flyBindingDomains |
277 | 276 |
#------------------------------------------------------------------------------------------------------------------------ |
... | ... |
@@ -537,7 +536,7 @@ test.export_memeFormatToFileDuplication = function () |
537 | 536 |
print ('--- test.export_memeFormatToFileDuplication') |
538 | 537 |
mdb = MotifDb # () |
539 | 538 |
mdb.mouse = subset (mdb, organism=='Mmusculus') |
540 |
- checkEquals (length (mdb.mouse), 528) |
|
539 |
+ checkEquals (length (mdb.mouse), 660) |
|
541 | 540 |
output.file = 'mouse.txt' # tempfile () |
542 | 541 |
max = 3 |
543 | 542 |
meme.text = export (mdb.mouse [1:max], output.file, 'meme') |
... | ... |
@@ -564,11 +563,13 @@ test.export_memeFormatToFile_run_tomtom = function (max=50) |
564 | 563 |
|
565 | 564 |
# find similarity of motif #1 to all the motifs in mdbMany |
566 | 565 |
|
567 |
- cmd = sprintf ('tomtom -no-ssc -oc %s -verbosity 3 -min-overlap 5 -mi 1 -dist pearson -evalue -thresh 10 %s %s', |
|
568 |
- tomtom.tmp.dir, sox4.file.path, all.human.file.path) |
|
569 |
- system (cmd) |
|
570 |
- cmd = sprintf ('open %s/tomtom.html', tomtom.tmp.dir) |
|
571 |
- system (cmd) |
|
566 |
+ # cannot rely upon tomtom being present |
|
567 |
+ |
|
568 |
+ #cmd = sprintf ('tomtom -no-ssc -oc %s -verbosity 3 -min-overlap 5 -mi 1 -dist pearson -evalue -thresh 10 %s %s', |
|
569 |
+ # tomtom.tmp.dir, sox4.file.path, all.human.file.path) |
|
570 |
+ #system (cmd) |
|
571 |
+ #cmd = sprintf ('open %s/tomtom.html', tomtom.tmp.dir) |
|
572 |
+ #system (cmd) |
|
572 | 573 |
} # if interactive |
573 | 574 |
|
574 | 575 |
} # test.export_memeFormatToFile_run_tomtom |