Browse code

issuing informative error when snpindex is called but destination dir does not exist

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

Cory Barr authored on 21/08/2012 23:50:27
Showing 1 changed files
... ...
@@ -21,5 +21,9 @@ snpindex <- function(name, genome, destdir = NULL,
21 21
 .snpindex <- function(sourcedir = NULL, db, destdir = NULL, snpsdb,
22 22
                       .iitfile = NULL)
23 23
 {
24
+  if (is.null(destdir) && !file.exists(destdir)) {
25
+    stop("The destination directory for the SNPs has not been created.",
26
+         " Perhaps run GmapSnpDirectory with the \"create\" arg set to TRUE.")
27
+  }
24 28
   .system(commandLine("snpindex"))
25 29
 }
Browse code

renaming gmapR2 to gmapR: it lives again

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

Michael Lawrence authored on 02/08/2012 22:24:24
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,25 @@
1
+### =========================================================================
2
+### snpindex command
3
+### -------------------------------------------------------------------------
4
+###
5
+
6
+### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
7
+### High-level wrapper
8
+###
9
+
10
+snpindex <- function(name, genome, destdir = NULL,
11
+                     iitfile = paste(name, "iit", sep = "."))
12
+{
13
+  .snpindex(sourcedir = path(directory(genome)), db = genome(genome),
14
+            destdir = destdir, snpsdb = name, .iitfile = iitfile)
15
+}
16
+
17
+### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
18
+### Low-level wrapper
19
+###
20
+
21
+.snpindex <- function(sourcedir = NULL, db, destdir = NULL, snpsdb,
22
+                      .iitfile = NULL)
23
+{
24
+  .system(commandLine("snpindex"))
25
+}