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

« back to all changes in this revision

Viewing changes to R/mach2databel.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:
11
11
#' @param outfile output file name
12
12
#' @param isprobfile whether imputedgenofile is a prob-file 
13
13
#' (default is FALSE, that is dose-file assumed) 
 
14
#' @param dataOutType the output data type, either "FLOAT" or "DOUBLE" (or
 
15
#'        other DatABEL/filevector type) 
14
16
#' 
15
17
#' @return databel-class object
16
18
#' 
21
23
#' 
22
24
 
23
25
 
24
 
mach2databel <- function(imputedgenofile,mlinfofile,outfile,isprobfile=FALSE) 
 
26
mach2databel <- function(imputedgenofile,mlinfofile,outfile,
 
27
                         isprobfile=FALSE, dataOutType = "FLOAT") 
25
28
{
26
29
        if (!require(DatABEL))
27
30
                stop("this function requires DatABEL package to be installed")
28
31
        if (missing(imputedgenofile))
29
32
                stop("mldose file must be specified")
30
33
        if (missing(outfile)) outfile <- imputedgenofile
 
34
    if (dataOutType != "FLOAT") 
 
35
        warning("The non-float dataOutType os not fully supported; your outputs may be in 'FLOAT'...",
 
36
                immediate. = TRUE);
31
37
# extract snp names (varnames)
32
38
        tmpname <- ""
33
39
        if (!missing(mlinfofile))
52
58
                                colnames=tmpname,
53
59
                                rownames=1,skipcols=2,
54
60
                                #skiprows,
55
 
                                transpose=FALSE,R_matrix=FALSE,type="FLOAT",readonly=FALSE)
 
61
                                transpose=FALSE,R_matrix=FALSE,
 
62
                                       type = dataOutType, readonly = FALSE)
56
63
        else 
57
64
                dfaobj <- text2databel(infile=imputedgenofile,outfile=outfile,
58
65
                                rownames=1,skipcols=2,
59
66
                                #skiprows,
60
 
                                transpose=FALSE,R_matrix=FALSE,type="FLOAT",readonly=FALSE)
 
67
                                transpose=FALSE,R_matrix=FALSE,
 
68
                                       type = dataOutType, readonly = FALSE)
61
69
 
62
70
        dnames <- get_dimnames(dfaobj)
63
71
        subjs <- dnames[[1]]
76
84
        #disconnect(dfaobj)
77
85
        #connect(dfaobj)
78
86
        return(dfaobj)
79
 
}
 
 
b'\\ No newline at end of file'
 
87
}