~ubuntu-branches/ubuntu/utopic/r-cran-genabel/utopic

« back to all changes in this revision

Viewing changes to R/minimac2databel.R

  • Committer: Package Import Robot
  • Author(s): Andreas Tille, Charles Plessy, Andreas Tille
  • Date: 2014-08-07 17:30:04 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140807173004-24c20tmrw61yl5dz
Tags: 1.8-0-1
[ Charles Plessy ]
* debian/control: removed myself from Uploaders.

[ Andreas Tille ]
* New upstream version
* Moved debian/upstream to debian/upstream/metadata
* cme fix dpkg-control
* More detailed copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#' @param outfile output file name
15
15
#' @param cachesizeMb cache size for the resulting 'databel-class'
16
16
#' object (gets passed directly to the \code{text2databel()} function)
 
17
#' @param dataOutType the output data type, either "FLOAT" or "DOUBLE" (or
 
18
#'        other DatABEL/filevector type) 
17
19
#'
18
20
#' @return databel-class object
19
21
#'
24
26
#'
25
27
 
26
28
 
27
 
minimac2databel <- function(imputedgenofile, infofile, outfile, cachesizeMb=64)
 
29
minimac2databel <- function(imputedgenofile, infofile, outfile,
 
30
                            cachesizeMb=64, dataOutType = "FLOAT")
28
31
{
29
32
  if (!require(DatABEL))
30
33
    stop("This function requires DatABEL package to be installed")
31
34
  if (missing(imputedgenofile))
32
35
    stop("A dose file must be specified")
33
36
  if (missing(outfile)) outfile <- imputedgenofile
34
 
  ## extract snp names (varnames)
 
37
  if (dataOutType != "FLOAT") 
 
38
      warning("The non-float dataOutType os not fully supported; your outputs may be in 'FLOAT'...",
 
39
              immediate. = TRUE);
 
40
## extract snp names (varnames)
35
41
  tmpname <- ""
36
42
  if (!missing(infofile))
37
43
    {
52
58
                           skipcols=2,
53
59
                           transpose=FALSE,
54
60
                           R_matrix=FALSE,
55
 
                           type="FLOAT",
 
61
                           type = dataOutType,
56
62
                           readonly=FALSE,
57
63
                           cachesizeMb=cachesizeMb)
58
64
  else
62
68
                           skipcols=2,
63
69
                           transpose=FALSE,
64
70
                           R_matrix=FALSE,
65
 
                           type="FLOAT",
 
71
                           type = dataOutType,
66
72
                           readonly=FALSE,
67
73
                           cachesizeMb=cachesizeMb)
68
74