Browse code

support character which to getSeq,GmapGenome

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

Michael Lawrence authored on 17/05/2017 19:50:56
Showing1 changed files

... ...
@@ -178,7 +178,10 @@ setReplaceMethod("spliceSites", c("GmapGenome", "TxDb"),
178 178
 
179 179
 setMethod("getSeq", "GmapGenome", function(x, which = seqinfo(x)) {
180 180
   if (!.gmapGenomeCreated(x))
181
-    stop("Genome index does not exist")
181
+      stop("Genome index does not exist")
182
+  if (is.character(which)) {
183
+      which <- seqinfo(x)[which]
184
+  }
182 185
   which <- as(which, "GRanges")
183 186
   merge(seqinfo(x), seqinfo(which)) # for the checks
184 187
   ans <- .Call(R_Genome_getSeq, path(directory(x)), genome(x),