Browse code

add untested support for FaFile=>GmapGenome

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

Michael Lawrence authored on 19/11/2015 18:51:30
Showing3 changed files

... ...
@@ -9,7 +9,7 @@ Description: GSNAP and GMAP are a pair of tools to align short-read
9 9
         methods to work with GMAP and GSNAP from within R. In addition,
10 10
         it provides methods to tally alignment results on a
11 11
         per-nucleotide basis using the bam_tally tool.
12
-Version: 1.13.2
12
+Version: 1.13.3
13 13
 Depends: R (>= 2.15.0), methods, GenomeInfoDb (>= 1.1.3),
14 14
         GenomicRanges (>= 1.17.12)
15 15
 Imports: S4Vectors, IRanges, Rsamtools (>= 1.17.8), rtracklayer (>= 1.25.5),
... ...
@@ -50,8 +50,8 @@ setGeneric("genomeName", function(x) standardGeneric("genomeName"))
50 50
 
51 51
 setMethod("genomeName", "character", function(x) x)
52 52
 setMethod("genomeName", "BSgenome", function(x) providerVersion(x))
53
-setMethod("genomeName", "RTLFile",
54
-          function(x) file_path_sans_ext(basename(path(x)), TRUE))
53
+setMethods("genomeName", list("RTLFile", "RsamtoolsFile"),
54
+           function(x) file_path_sans_ext(basename(path(x)), TRUE))
55 55
 
56 56
 file_path_is_absolute <- function(x) {
57 57
   ## hack that is unlikely to work on e.g. Windows
... ...
@@ -30,6 +30,10 @@ setMethod("gmap_build", c("RTLFile", "GmapGenome"), function(x, genome, ...) {
30 30
   gmap_build(import(x), genome, ...)
31 31
 })
32 32
 
33
+setMethod("gmap_build", c("FaFile", "GmapGenome"), function(x, genome, ...) {
34
+  gmap_build(getSeq(x), genome, ...)
35
+})
36
+
33 37
 setMethod("gmap_build", c("DNAStringSet", "GmapGenome"),
34 38
           function(x, genome, ...) {
35 39
             tmpfile <- tempfile()