Browse code

merge collab_release

* collab_release:
Add alias for "[" method for PredictionRegion class
bump version 1o 1.16.7
merge fixRegister branch with collab
replace AffymetrixCopynumber with AffyGW in copynumber.Rnw vignette
Adding RcppEigen: fastLmPure
Fixed arguments for Cdqrls
Forgot to add weights... fixed now
Fixing warnings: calling Cdqrls / registering needed C functions from preprocessCore
edit getFeatureData so that variable no.build is defined, regardless of whether genome is specified from constructAffyCNSet
bump version
updates to illumina for handling old annotation packages without build info
only close file connection to callsGt when callsGt was passed to crlmmGT2
Fixed the following bug:
for fit.lm2 (autosomal, nonpolymorphic) sample the number of snps without flags or 5000, whichever is smaller
bug fix in genotype(). Use ok <- snprmaAffy not cnSet <- snprmaAffy.
bump package versions after creating 2.11 branch

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

Rob Scharp authored on 21/11/2012 14:32:51
Showing6 changed files

... ...
@@ -1,12 +1,13 @@
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.8
4
+Version: 1.16.9
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
8 8
 License: Artistic-2.0
9
-Depends: R (>= 2.14.0), oligoClasses (>= 1.19.39)
9
+Depends: R (>= 2.14.0), oligoClasses (>= 1.19.39), preprocessCore (>= 1.17.7)
10
+LinkingTo: preprocessCore (>= 1.17.7)
10 11
 Imports: methods,
11 12
          Biobase (>= 2.15.4),
12 13
          BiocGenerics,
... ...
@@ -14,14 +15,14 @@ Imports: methods,
14 15
          ellipse,
15 16
          genefilter (>= 1.37.1),
16 17
          mvtnorm,
17
-         preprocessCore (>= 1.17.7),
18 18
          splines,
19 19
          stats,
20 20
          SNPchip,
21 21
          utils,
22 22
 	 lattice,
23 23
 	 ff,
24
-	 foreach
24
+	 foreach,
25
+         RcppEigen
25 26
 Suggests: hapmapsnp6,
26 27
           genomewidesnp6Crlmm (>= 1.0.4),
27 28
           GGdata,
... ...
@@ -5,7 +5,7 @@ importClassesFrom(Biobase, AssayData, eSet)
5 5
 importClassesFrom(methods, ANY, character, formula, integer, list,
6 6
                   matrix, oldClass)
7 7
 importFrom(methods, setOldClass)
8
-
8
+importFrom(RcppEigen, fastLmPure)
9 9
 ## importClassesFrom(oligoClasses, CNSet, CNSetLM, ff_matrix,
10 10
 ##                   ff_or_matrix, oligoSnpSet)
11 11
 importClassesFrom(oligoClasses, CNSet, oligoSnpSet, ff_or_matrix)
... ...
@@ -56,7 +56,7 @@ importFrom(oligoClasses, celfileDate, chromosome2integer, i2p,
56 56
            splitIndicesByLength, splitIndicesByNode, AssayDataList)
57 57
 
58 58
 importFrom(preprocessCore, normalize.quantiles,
59
-           normalize.quantiles.use.target)
59
+           normalize.quantiles.use.target, subColSummarizeMedian)
60 60
 
61 61
 importFrom(stats, coef, cov, dnorm, kmeans, lm, mad, median, quantile,
62 62
            sd)
... ...
@@ -443,18 +443,19 @@ rowCors <- function(x, y, ...){
443 443
 	return(covar/(sd.x*sd.y))
444 444
 }
445 445
 
446
-dqrlsWrapper <- function(x, y, wts, tol=1e-7){
447
-	n <- NROW(y)
448
-	p <- ncol(x)
449
-	ny <- NCOL(y)
450
-	## perhaps use .Call("C_Cdqrls", x, y, tolerance)  instead -- see lsfit, for example
451
-	.Fortran("dqrls", qr=x*wts, n=n, p=p, y=y * wts, ny=ny,
452
-		 tol=as.double(tol), coefficients=mat.or.vec(p, ny),
453
-		 residuals=y, effects=mat.or.vec(n, ny),
454
-		 rank=integer(1L), pivot=1L:p, qraux=double(p),
455
-		 work=double(2 * p), PACKAGE="base")[["coefficients"]]
456
-}
457
-
446
+## dqrlsWrapper <- function(x, y, wts, tol=1e-7){
447
+## 	n <- NROW(y)
448
+## 	p <- ncol(x)
449
+## 	ny <- NCOL(y)
450
+## 	.Fortran("dqrls", qr=x*wts, n=n, p=p, y=y * wts, ny=ny,
451
+## 		 tol=as.double(tol), coefficients=mat.or.vec(p, ny),
452
+## 		 residuals=y, effects=mat.or.vec(n, ny),
453
+## 		 rank=integer(1L), pivot=1L:p, qraux=double(p),
454
+## 		 work=double(2 * p), PACKAGE="base")[["coefficients"]]
455
+## }
456
+
457
+dqrlsWrapper <- function(x, y, wts, ...)
458
+    fastLmPure(X=x*wts, y=y*wts, method=3)[['coefficients']]
458 459
 
459 460
 fit.wls <- function(NN, sigma, allele, Y, autosome, X){
460 461
 	Np <- NN
... ...
@@ -14,8 +14,11 @@ getCrlmmAnnotationName <- function(x){
14 14
 	paste(tolower(gsub("_", "", x)), "Crlmm", sep="")
15 15
 }
16 16
 
17
+## medianSummaries <- function(mat, grps)
18
+##   .Call("R_subColSummarize_median", mat, grps, PACKAGE = "preprocessCore")
19
+
17 20
 medianSummaries <- function(mat, grps)
18
-  .Call("R_subColSummarize_median", mat, grps, PACKAGE = "preprocessCore")
21
+.Call("subColSummarizeMedianPP", mat, grps)
19 22
 
20 23
 intMedianSummaries <- function(mat, grps)
21 24
   as.integer(medianSummaries(mat, grps))
... ...
@@ -3,6 +3,7 @@
3 3
 \docType{class}
4 4
 \alias{PredictionRegion-class}
5 5
 \alias{[,PredictionRegion-method}
6
+\alias{[,PredictionRegion,ANY,ANY,ANY-method}
6 7
 
7 8
 \title{Class \code{"PredictionRegion"}}
8 9
 \description{
... ...
@@ -1,6 +1,8 @@
1 1
 #include <R.h>
2 2
 #include <R_ext/Rdynload.h>
3 3
 #include "crlmm.h"
4
+#include <Rinternals.h>
5
+#include <R_ext/Rdynload.h>
4 6
 
5 7
 static const R_CallMethodDef CallEntries[] = {
6 8
     {"gtypeCallerPart1", (DL_FUNC)&gtypeCallerPart1, 17},
... ...
@@ -12,3 +14,11 @@ static const R_CallMethodDef CallEntries[] = {
12 14
 void R_init_crlmm(DllInfo *dll){
13 15
     R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
14 16
 }
17
+
18
+
19
+SEXP subColSummarizeMedianPP(SEXP RMatrix, SEXP R_rowIndexList){
20
+  static SEXP(*fun)(SEXP, SEXP) = NULL;
21
+  if (fun == NULL)
22
+    fun =  (SEXP(*)(SEXP, SEXP))R_GetCCallable("preprocessCore","R_subColSummarize_median");
23
+  return fun(RMatrix, R_rowIndexList);
24
+}