Browse code

annotation packages

* collab_release:
Edits to getAvailableIlluminaGenomeBuild and getFeatureData for compatibility with annotation packages from the 2.10 release cycle

m the 2.10 release cycle

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/branches/RELEASE_2_11/madman/Rpacks/crlmm@70731 bc3139a8-67e5-0310-9ffc-ced21a209358

Rob Scharp authored on 23/10/2012 13:58:56
Showing3 changed files

... ...
@@ -1,7 +1,7 @@
1 1
 Package: crlmm
2 2
 Type: Package
3 3
 Title: Genotype Calling (CRLMM) and Copy Number Analysis tool for Affymetrix SNP 5.0 and 6.0 and Illumina arrays.
4
-Version: 1.16.1
4
+Version: 1.16.2
5 5
 Author: Benilton S Carvalho, Robert Scharpf, Matt Ritchie, Ingo Ruczinski, Rafael A Irizarry
6 6
 Maintainer: Benilton S Carvalho <Benilton.Carvalho@cancer.org.uk>, Robert Scharpf <rscharpf@jhsph.edu>, Matt Ritchie <mritchie@wehi.EDU.AU>
7 7
 Description: Faster implementation of CRLMM specific to SNP 5.0 and 6.0 arrays, as well as a copy number tool specific to 5.0, 6.0, and Illumina platforms
... ...
@@ -41,15 +41,31 @@ getFeatureData <- function(cdfName, copynumber=FALSE, genome){
41 41
 	}
42 42
 	path <- system.file("extdata", package=pkgname)
43 43
 	##multiple.builds <- length(grep("hg19", list.files(path)) > 0)
44
-	if(missing(genome)){
45
-		snp.file <- list.files(path, pattern="snpProbes_hg")
46
-		if(length(snp.file) > 1){
47
-			## use hg19
48
-			message("genome build not specified. Using build hg19 for annotation.")
49
-			snp.file <- snp.file[1]
50
-		}
51
-		genome <- gsub(".rda", "", strsplit(snp.file, "snpProbes_")[[1]][[2]])
52
-	} else snp.file <- paste("snpProbes_", genome, ".rda", sep="")
44
+##	if(missing(genome)){
45
+##		snp.file <- list.files(path, pattern="snpProbes_hg")
46
+##		if(length(snp.file) > 1){
47
+##			## use hg19
48
+##			message("genome build not specified. Using build hg19 for annotation.")
49
+##			snp.file <- snp.file[1]
50
+##		}
51
+##		genome <- gsub(".rda", "", strsplit(snp.file, "snpProbes_")[[1]][[2]])
52
+##	} else snp.file <- paste("snpProbes_", genome, ".rda", sep="")
53
+	snp.file <- list.files(path, pattern="snpProbes_hg")
54
+	if(length(snp.file)==0){
55
+		no.build <- TRUE
56
+		snp.file <- list.files(path, pattern="snpProbes.rda")
57
+	} else {
58
+		no.build <- FALSE
59
+		if(missing(genome)){
60
+			snp.file <- list.files(path, pattern="snpProbes_hg")
61
+			if(length(snp.file) > 1){
62
+				## use hg19
63
+				message("genome build not specified. Using build hg19 for annotation.")
64
+				snp.file <- snp.file[1]
65
+			}
66
+			genome <- gsub(".rda", "", strsplit(snp.file, "snpProbes_")[[1]][[2]])
67
+		} else snp.file <- paste("snpProbes_", genome, ".rda", sep="")
68
+	}
53 69
 ##	if(!multiple.builds){
54 70
 ##		load(file.path(path, "snpProbes.rda"))
55 71
 ##	} else load(file.path(path, paste("snpProbes_", genome, ".rda", sep="")))
... ...
@@ -58,7 +74,10 @@ getFeatureData <- function(cdfName, copynumber=FALSE, genome){
58 74
 	## if we use a different build we may throw out a number of snps...
59 75
 	snpProbes <- snpProbes[rownames(snpProbes) %in% gns, ]
60 76
 	if(copynumber){
61
-		cn.file <- paste("cnProbes_", genome, ".rda", sep="")
77
+##		cn.file <- paste("cnProbes_", genome, ".rda", sep="")
78
+		if(!no.build){
79
+			cn.file <- paste("cnProbes_", genome, ".rda", sep="")
80
+		} else cn.file <- "cnProbes.rda"
62 81
 		load(file.path(path, cn.file))
63 82
 		##		if(!multiple.builds){
64 83
 		##			load(file.path(path, "cnProbes.rda"))
... ...
@@ -1072,6 +1072,16 @@ getProtocolData.Illumina = function(filenames, sep="_", fileExt="Grn.idat", verb
1072 1072
        return(protocoldata)
1073 1073
 }
1074 1074
 
1075
+##getAvailableIlluminaGenomeBuild <- function(path){
1076
+##	snp.file <- list.files(path, pattern="snpProbes_hg")
1077
+##	if(length(snp.file) > 1){
1078
+##		## use hg19
1079
+##		message("genome build not specified. Using build hg19 for annotation.")
1080
+##		snp.file <- snp.file[1]
1081
+##	}
1082
+##	genome <- gsub(".rda", "", strsplit(snp.file, "snpProbes_")[[1]][[2]])
1083
+##}
1084
+
1075 1085
 getAvailableIlluminaGenomeBuild <- function(path){
1076 1086
 	snp.file <- list.files(path, pattern="snpProbes_hg")
1077 1087
 	if(length(snp.file) > 1){
... ...
@@ -1079,7 +1089,10 @@ getAvailableIlluminaGenomeBuild <- function(path){
1079 1089
 		message("genome build not specified. Using build hg19 for annotation.")
1080 1090
 		snp.file <- snp.file[1]
1081 1091
 	}
1082
-	genome <- gsub(".rda", "", strsplit(snp.file, "snpProbes_")[[1]][[2]])
1092
+	if(length(snp.file) == 1)
1093
+		genome <- gsub(".rda", "", strsplit(snp.file, "snpProbes_")[[1]][[2]])
1094
+	if(length(snp.file)==0) genome <- ""
1095
+	genome
1083 1096
 }
1084 1097
 
1085 1098