Browse code

merge with collab

* collab:
Update DESCRIPTION
bug fixed for krlmm option, documentation changes

es

# 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/trunk/madman/Rpacks/crlmm@81002 bc3139a8-67e5-0310-9ffc-ced21a209358

Rob Scharp authored on 01/10/2013 12:03:56
Showing4 changed files

... ...
@@ -1,8 +1,8 @@
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.19.7
5
-Date: Mon Sep 30 10:06:41 EDT 2013
4
+Version: 1.19.8
5
+Date: Tue Oct 01 14:48:41 EDT 2013
6 6
 Author: Benilton S Carvalho, Robert Scharpf, Matt Ritchie, Ingo Ruczinski, Rafael A Irizarry
7 7
 Maintainer: Benilton S Carvalho <Benilton.Carvalho@cancer.org.uk>, Robert Scharpf <rscharpf@jhsph.edu>, Matt Ritchie <mritchie@wehi.EDU.AU>
8 8
 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
... ...
@@ -53,6 +53,3 @@ Collate: AllGenerics.R
53 53
 	 test_crlmm_package.R
54 54
 LazyLoad: yes
55 55
 biocViews: Microarray, Preprocessing, SNP, Bioinformatics,CopyNumberVariants
56
-## Local Variables:
57
-## time-stamp-pattern: "8/Date: %3a %3b %2d %02H:%02M:%02S %Z %:y\n"
58
-## End:
... ...
@@ -172,7 +172,7 @@ calculateKrlmmCoefficients <- function(trueCalls, params, numSample, samplenames
172 172
     xx = data.frame(params1)
173 173
     t = as.factor(as.numeric(truek1)) 
174 174
     xx = data.frame(xx, t)
175
-    fit = VGAM::vglm(t~., multinomial(refLevel=1), xx)
175
+    fit = suppressWarnings(VGAM::vglm(t~., multinomial(refLevel=1), xx))
176 176
     coe = VGAM::coefficients(fit)
177 177
     return(coe)    
178 178
 }
... ...
@@ -180,16 +180,15 @@ calculateKrlmmCoefficients <- function(trueCalls, params, numSample, samplenames
180 180
 getKrlmmVGLMCoefficients <- function(pkgname, trueCalls, params, verbose, numSample, samplenames){
181 181
     if (!is.null(trueCalls)) {
182 182
         coe = calculateKrlmmCoefficients(trueCalls, params, numSample, samplenames)
183
+        if (!is.null(coe)) {
184
+            if (verbose) message ("Done calculating platform-specific coefficients to predict number of clusters")
185
+            return(coe)
186
+        }
183 187
     }
184
-    if (!is.null(coe)) {
185
-        if (verbose) message ("Done calculating platform-specific coefficients to predict number of clusters")
186
-        return(coe)
187
-    } else {
188
-        if (!is.null(trueCalls)) message("Fall back to use defined platform-specific coefficients")
189
-        if (verbose) message ("Retrieving defined platform-specific coefficients to predict number of clusters")
190
-        loader("krlmmVGLMCoefficients.rda", .crlmmPkgEnv, pkgname)
191
-        return(getVarInEnv("krlmmCoefficients"))      
192
-    }
188
+    if (!is.null(trueCalls)) message("Fall back to use defined platform-specific coefficients")
189
+    if (verbose) message ("Retrieving defined platform-specific coefficients to predict number of clusters")
190
+    loader("krlmmVGLMCoefficients.rda", .crlmmPkgEnv, pkgname)
191
+    return(getVarInEnv("krlmmCoefficients"))      
193 192
 }
194 193
 
195 194
 
... ...
@@ -93,8 +93,16 @@ genotype.Illumina(sampleSheet=NULL, arrayNames=NULL, ids=NULL, path=".",
93 93
 	\code{CNSet} container with the appropriate dimensions.
94 94
 
95 95
         The new 'krlmm' option is available for certain chip types. Optional 
96
-	\code{trueCalls} matrix contains known Genotype calls (1 - AA, 2 - AB, 3 - BB)
97
-	for a subset of samples and features. 
96
+	argument \code{trueCalls} matrix contains known Genotype calls 
97
+	(1 - AA, 2 - AB, 3 - BB) for a subset of samples and features. This 
98
+	will used to compute KRLMM coefficients by calling \code{vglm} function 
99
+	from \code{VGAM} package.
100
+
101
+	The 'krlmm' method makes use of functions provided in \code{parallel} 
102
+	package to speed up the process. It by default initialises up to 
103
+	8 clusters. This is configurable by setting up an option named 
104
+	"krlmm.cores", e.g. options("krlmm.cores" = 16). 
105
+
98 106
       }
99 107
 
100 108
 \value{	A \code{SnpSuperSet} instance.}
... ...
@@ -114,7 +122,7 @@ genotype.Illumina(sampleSheet=NULL, arrayNames=NULL, ids=NULL, path=".",
114 122
 
115 123
 }
116 124
 
117
-\author{Matt Ritchie}
125
+\author{Matt Ritchie, Cynthia Liu, Zhiyin Dai}
118 126
 
119 127
   \note{For large datasets, load the 'ff' package prior to genotyping
120 128
 -- this will greatly reduce the RAM required for big jobs.  See
... ...
@@ -129,6 +137,7 @@ example below indicates.}
129 137
 }
130 138
 \examples{
131 139
 \dontrun{
140
+	# example for 'crlmm' option
132 141
 	library(ff)
133 142
 	library(crlmm)
134 143
 	## to enable paralellization, set to TRUE
... ...
@@ -151,6 +160,32 @@ example below indicates.}
151 160
 				   arrayInfoColNames=arrayInfo,
152 161
 				   cdfName="human370v1c",
153 162
 				   batch=rep("1", nrow(samplesheet)))
163
+
164
+}
165
+\dontrun{
166
+	# example for 'krlmm' option
167
+	library(crlmm)
168
+	library(ff)
169
+	# line below is an optional step for krlmm to initialise 16 workers 
170
+	# options("krlmm.cores" = 16)
171
+	# read in raw X and Y intensities output by GenomeStudio's GenCall genotyping module
172
+	XY = readGenCallOutput(c("HumanOmni2-5_4v1_FinalReport_83TUSCAN.csv","HumanOmni2-5_4v1_FinalReport_88CHB-JPT.csv"),
173
+				cdfName="humanomni25quadv1b",
174
+				verbose=TRUE)
175
+	krlmmResult = genotype.Illumina(XY=XY, 
176
+		      			cdfName=ThiscdfName, 
177
+					call.method="krlmm", 
178
+					verbose=TRUE)
179
+
180
+	# example for 'krlmm' option with known genotype call for some SNPs and samples
181
+	library(VGAM)
182
+	hapmapCalls = load("hapmapCalls.rda")
183
+	# hapmapCalls should have rownames and colnames corresponding to XY featureNames and sampleNames
184
+	krlmmResult = genotype.Illumina(XY=XY,
185
+					cdfName=ThiscdfName, 
186
+					call.method="krlmm", 
187
+					trueCalls=hapmapCalls, 
188
+					verbose=TRUE)		
154 189
 }
155 190
 }
156 191
 \keyword{classif}
... ...
@@ -41,7 +41,7 @@ The function crlmmillumina() can be run on the output of the \code{readGenCallOu
41 41
   genotyping BeadChips. Bioinformatics. 2009 Oct 1;25(19):2621-3.
42 42
 }
43 43
 
44
-\author{Cynthia Liu and Matt Ritchie}
44
+\author{Cynthia Liu, Matt Ritchie, Zhiyin Dai}
45 45
 
46 46
 \examples{
47 47
 #XY = readGenCallOutput(file="Hap650Yv3_Final_Report.txt", cdfName="human650v3a")