Browse code

Fixing registration of C functions

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

Benilton Carvalho authored on 16/01/2009 12:52:10
Showing4 changed files

... ...
@@ -1,7 +1,7 @@
1 1
 Package: crlmm
2 2
 Type: Package
3 3
 Title: Genotype Calling via CRLMM Algorithm
4
-Version: 1.0.30
4
+Version: 1.0.31
5 5
 Date: 2008-12-28
6 6
 Author: Rafael A Irizarry
7 7
 Maintainer: Benilton S Carvalho <bcarvalh@jhsph.edu>
... ...
@@ -104,11 +104,14 @@ crlmmGT <- function(A, B, SNR, mixtureParams, cdfName, row.names=NULL,
104 104
       noMoveIndex <- union(setdiff(which(rowSums(is.na(newparams[["centers"]]))>0), YIndex), 
105 105
                            YIndex[rowSums(is.na(newparams[["centers"]][YIndex, ])>1)])
106 106
     }
107
+    snps2ignore <- which(rowSums(is.na(newparams[["centers"]])) > 0)
108
+    snps2keep <- setdiff(autosomeIndex, snps2ignore)
109
+    rm(snps2ignore)
107 110
     newparams[["centers"]][is.na(newparams[["centers"]])] <- params[["centers"]][is.na(newparams[["centers"]])]
108 111
     if(verbose) cat("\n")
109 112
   
110 113
     if(verbose) message("Calculating and standardizing size of shift.")
111
-    DD <- newparams[["centers"]] - params[["centers"]]
114
+    GG <- DD <- newparams[["centers"]] - params[["centers"]]
112 115
     DD <- sweep(DD, 2, colMeans(DD[autosomeIndex, ]))
113 116
     SS <- cov(DD[autosomeIndex, ])
114 117
     SSI <- solve(SS)
... ...
@@ -150,9 +153,12 @@ crlmmGT <- function(A, B, SNR, mixtureParams, cdfName, row.names=NULL,
150 153
   if(!is.null(col.names)){ colnames(A) <- colnames(B) <- col.names}
151 154
 
152 155
   if(length(Index) >= recallRegMin){
153
-    tmp4batchQC <- DD[autosomeIndex,]/(params[["N"]][autosomeIndex,]+1)
154
-    tmpSnpQc <- dev[autosomeIndex]
155
-    SS <- cov(tmp4batchQC[tmpSnpQc < badSNP,])
156
+##     tmp4batchQC <- DD[autosomeIndex,]/(params[["N"]][autosomeIndex,]+1)
157
+##     tmpSnpQc <- dev[autosomeIndex]
158
+##     SS <- cov(tmp4batchQC[tmpSnpQc < badSNP,])
159
+    DD <- sweep(GG[snps2keep, ], 2, colMeans(DD[snps2keep, ]))
160
+    tmpSnpQc <- dev[snps2keep]
161
+    SS <- cov(DD[tmpSnpQc < badSNP, ])
156 162
     batchQC <- mean(diag(SS))
157 163
   }else{
158 164
     batchQC <- Inf
... ...
@@ -6,6 +6,11 @@ SEXP gtypeCallerPart1nm(SEXP *, SEXP *, SEXP *, SEXP *, SEXP *,SEXP *, SEXP *,
6 6
 		        SEXP *, SEXP *, SEXP *, SEXP *, SEXP *,SEXP *, SEXP *,
7 7
                         SEXP *, SEXP *, SEXP *);
8 8
 
9
+SEXP gtypeCallerPart2nm(SEXP *, SEXP *, SEXP *, SEXP *,
10
+		      SEXP *, SEXP *, SEXP *, SEXP *,
11
+                      SEXP *, SEXP *, SEXP *, SEXP *,
12
+		      SEXP *, SEXP *, SEXP *, SEXP *,
13
+                      SEXP *, SEXP *, SEXP *);
9 14
 
10 15
 SEXP test (SEXP *);
11 16
 
... ...
@@ -13,6 +18,17 @@ SEXP gtypeCallerPart1NormalNoN(SEXP *, SEXP *, SEXP *, SEXP *,SEXP *, SEXP *,
13 18
                                SEXP *, SEXP *, SEXP *, SEXP *,SEXP *, SEXP *,
14 19
 		               SEXP *, SEXP *, SEXP *, SEXP *,SEXP *);
15 20
 
21
+SEXP gtypeCallerPart2NormalNoN(SEXP *, SEXP *, SEXP *, SEXP *,
22
+		      SEXP *, SEXP *, SEXP *, SEXP *,
23
+                      SEXP *, SEXP *, SEXP *, SEXP *,
24
+		      SEXP *, SEXP *, SEXP *, SEXP *,
25
+                      SEXP *, SEXP *, SEXP *);
26
+
27
+
28
+SEXP gtypeCallerPart1(SEXP *, SEXP *, SEXP *, SEXP *,SEXP *, SEXP *,
29
+		      SEXP *, SEXP *, SEXP *, SEXP *,SEXP *, SEXP *,
30
+		      SEXP *, SEXP *, SEXP *, SEXP *,SEXP *);
31
+
16 32
 SEXP gtypeCallerPart2(SEXP *, SEXP *, SEXP *, SEXP *,
17 33
 		      SEXP *, SEXP *, SEXP *, SEXP *,
18 34
                       SEXP *, SEXP *, SEXP *, SEXP *,
... ...
@@ -23,11 +39,11 @@ SEXP gtypeCallerPart1TNoN(SEXP *, SEXP *, SEXP *, SEXP *,
23 39
 		          SEXP *, SEXP *, SEXP *, SEXP *,
24 40
                           SEXP *, SEXP *, SEXP *, SEXP *,
25 41
 		          SEXP *, SEXP *, SEXP *,
26
-		      SEXP *, SEXP *)
42
+			  SEXP *, SEXP *);
27 43
 
28 44
 
29 45
 SEXP gtypeCallerPart2TNoN(SEXP *, SEXP *, SEXP *, SEXP *,
30 46
 			  SEXP *, SEXP *, SEXP *, SEXP *, 
31 47
 			  SEXP *, SEXP *, SEXP *, SEXP *,
32 48
 			  SEXP *, SEXP *, SEXP *, SEXP *,
33
-			  SEXP *, SEXP *, SEXP *)
34 49
\ No newline at end of file
50
+			  SEXP *, SEXP *, SEXP *);
... ...
@@ -14,8 +14,7 @@ static const R_CallMethodDef CallEntries[] = {
14 14
     {NULL, NULL, 0}
15 15
 };
16 16
 
17
-void R_init_crlmm(DllInfo *dll)
18
-{
17
+void R_init_crlmm(DllInfo *dll){
19 18
     R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);    
20 19
 }
21 20