Browse code

Improved NAMESPACE / added conditional for progress bar

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

Benilton Carvalho authored on 17/01/2009 01:18:15
Showing5 changed files

... ...
@@ -1,13 +1,12 @@
1 1
 Package: crlmm
2 2
 Type: Package
3 3
 Title: Genotype Calling via CRLMM Algorithm
4
-Version: 1.0.32
4
+Version: 1.0.33
5 5
 Date: 2008-12-28
6 6
 Author: Rafael A Irizarry
7 7
 Maintainer: Benilton S Carvalho <bcarvalh@jhsph.edu>
8 8
 Description: Faster implementation of CRLMM specific to SNP 5.0 and 6.0 arrays.
9
-Depends: 
10
-Imports: affyio, preprocessCore, utils,stats
9
+Imports: affyio, preprocessCore, utils, stats
11 10
 License: Artistic-2.0
12 11
 Suggests: hapmapsnp5, genomewidesnp5Crlmm, methods
13 12
 Collate: crlmmGT.R
... ...
@@ -1,15 +1,6 @@
1
-useDynLib("crlmm",.registration=TRUE)
2
-
3
-export("crlmm",
4
-       "list.celfiles")
5
-
1
+useDynLib("crlmm", .registration=TRUE)
2
+export("crlmm", "list.celfiles")
6 3
 importFrom(affyio, read.celfile.header, read.celfile)
7
-
8 4
 importFrom(preprocessCore, normalize.quantiles.use.target)
9
-importFrom(utils,
10
-           data,
11
-           packageDescription,
12
-           setTxtProgressBar,
13
-           txtProgressBar)
14
-importFrom(stats, coef, cov, dnorm, kmeans, lm, mad, median, quantile,
15
-           sd)
16 5
\ No newline at end of file
6
+importFrom(utils, data, packageDescription, setTxtProgressBar, txtProgressBar)
7
+importFrom(stats, coef, cov, dnorm, kmeans, lm, mad, median, quantile, sd)
... ...
@@ -48,7 +48,7 @@ snprma <- function(filenames, mixtureSampleSize=10^5, fitMixture=FALSE, eps=0.1,
48 48
   
49 49
   if(verbose){
50 50
     message("Processing ", length(filenames), " files.")
51
-    pb <- txtProgressBar(min=0, max=length(filenames), style=3)
51
+    if (getRversion() > '2.7.0') pb <- txtProgressBar(min=0, max=length(filenames), style=3)
52 52
   }
53 53
   ##We start looping throug cel files
54 54
   idx2 <- sample(length(fid), 10^5) ##for skewness. no need to do everything
... ...
@@ -72,9 +72,13 @@ snprma <- function(filenames, mixtureSampleSize=10^5, fitMixture=FALSE, eps=0.1,
72 72
       mixtureParams[, i] <- tmp[["coef"]]
73 73
       SNR[i] <- tmp[["medF1"]]^2/(tmp[["sigma1"]]^2+tmp[["sigma2"]]^2)
74 74
     }
75
-    if (verbose) setTxtProgressBar(pb, i)
75
+    if (verbose)
76
+      if (getRversion() > '2.7.0') setTxtProgressBar(pb, i)
77
+      else cat(".")
76 78
   }
77
-  if (verbose) close(pb)
79
+  if (verbose)
80
+    if (getRversion() > '2.7.0') close(pb)
81
+    else cat("\n")
78 82
   if (!fitMixture) SNR <- mixtureParams <- NA
79 83
   ## gns comes from preprocStuff.rda
80 84
   list(A=A, B=B, sns=sns, gns=gns, SNR=SNR, SKW=SKW, mixtureParams=mixtureParams, cdfName=cdfName)
81 85
Binary files a/inst/doc/crlmm.pdf and b/inst/doc/crlmm.pdf differ
... ...
@@ -9,12 +9,12 @@
9 9
 }
10 10
 \usage{
11 11
 
12
-crlmm(filenames, row.names = TRUE, col.names = TRUE, probs = c(1/3, 1/3,
13
-1/3), DF = 6, SNRMin = 5, gender = NULL, save.it = FALSE, load.it =
14
-FALSE, intensityFile, mixtureSampleSize =
15
-10^5, eps = 0.1, verbose = TRUE, cdfName, sns, recallMin = 10,
16
-recallRegMin = 1000, returnParams = FALSE, badSNP = 0.7)
17
-
12
+crlmm(filenames, row.names=TRUE, col.names=TRUE,
13
+      probs=c(1/3, 1/3, 1/3), DF=6, SNRMin=5,
14
+      gender=NULL, save.it=FALSE, load.it=FALSE,
15
+      intensityFile, mixtureSampleSize=10^5,
16
+      eps=0.1, verbose=TRUE, cdfName, sns, recallMin=10,
17
+      recallRegMin=1000, returnParams=FALSE, badSNP=0.7)
18 18
 }
19 19
 %- maybe also 'usage' for other objects documented here.
20 20
 \arguments{
... ...
@@ -26,7 +26,7 @@ recallRegMin = 1000, returnParams = FALSE, badSNP = 0.7)
26 26
   \item{SNRMin}{'numeric' scalar defining the minimum SNR used to filter
27 27
   out samples.}
28 28
   \item{gender}{'integer' vector, with same length as 'filenames',
29
-    defining gender. (1 - male; 2 - female)}
29
+    defining sex. (1 - male; 2 - female)}
30 30
   \item{save.it}{'logical'. Save preprocessed data?}
31 31
   \item{load.it}{'logical'. Load preprocessed data to speed up analysis?}
32 32
   \item{intensityFile}{'character' with filename to be saved/loaded -