[Genabel-commits] r2064 - in pkg/MultiABEL: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jan 25 07:34:39 CET 2017
Author: sharapovsodbo
Date: 2017-01-25 07:34:38 +0100 (Wed, 25 Jan 2017)
New Revision: 2064
Modified:
pkg/MultiABEL/DESCRIPTION
pkg/MultiABEL/NAMESPACE
pkg/MultiABEL/R/MultiLoad.R
pkg/MultiABEL/R/load.summary.R
pkg/MultiABEL/R/misc.R
pkg/MultiABEL/man/MultiLoad.Rd
pkg/MultiABEL/man/load.summary.Rd
Log:
Minor refactoring of MultiABEL package. Fixed issues with R CMD check. Minor changes in R code. Updated documentation of load.summary function
Modified: pkg/MultiABEL/DESCRIPTION
===================================================================
--- pkg/MultiABEL/DESCRIPTION 2017-01-24 11:25:17 UTC (rev 2063)
+++ pkg/MultiABEL/DESCRIPTION 2017-01-25 06:34:38 UTC (rev 2064)
@@ -1,8 +1,8 @@
Package: MultiABEL
Type: Package
Title: Multi-Trait Genome-Wide Association Analyses
-Version: 1.1-5
-Date: 2016-05-07
+Version: 1.1-6
+Date: 2017-01-25
Author: Xia Shen
Maintainer: Xia Shen <xia.shen at ki.se>
Description: Multivariate genome-wide association analyses. The analysis can be
@@ -10,7 +10,8 @@
statistics.
Depends:
R (>= 2.10),
- svMisc
+ svMisc,
+ data.table
Suggests:
GenABEL,
DatABEL
Modified: pkg/MultiABEL/NAMESPACE
===================================================================
--- pkg/MultiABEL/NAMESPACE 2017-01-24 11:25:17 UTC (rev 2063)
+++ pkg/MultiABEL/NAMESPACE 2017-01-25 06:34:38 UTC (rev 2064)
@@ -1,4 +1,6 @@
useDynLib(MultiABEL)
import("svMisc")
+import("stats")
+import("utils")
export("Multivariate", "MultiRep", "MultiMeta", "MultiLoad","load.summary", "MultiSummary")
exportClasses("multi.summary", "multi.loaded")
\ No newline at end of file
Modified: pkg/MultiABEL/R/MultiLoad.R
===================================================================
--- pkg/MultiABEL/R/MultiLoad.R 2017-01-24 11:25:17 UTC (rev 2063)
+++ pkg/MultiABEL/R/MultiLoad.R 2017-01-25 06:34:38 UTC (rev 2064)
@@ -12,6 +12,7 @@
#' The value can be set depending on the memory size. The smaller the value is, potentially the faster
#' the analysis will be.
#' @param impute An (optional) logical argument telling whether missing genotypes should be imputed.
+#' @param gaussianize logical argument gaussianize telling whether traits should be gaussianized
#' @param ... not used.
#'
#' @note Either \code{gwaa.data} (for GenABEL data format) or the combination of
@@ -68,7 +69,7 @@
}
if (!is.null(phenofile) & !is.null(genofile)) {
pheno <- read.table(phenofile, header = TRUE)
- geno <- databel(genofile)
+ geno <- DatABEL::databel(genofile)
if (nrow(pheno) != nrow(geno)) {
stop('sizes of phenofile and genofile do not match!')
}
@@ -78,7 +79,7 @@
if (!is.null(phenofile)) {
pheno <- read.table(phenofile, header = TRUE)
} else {
- pheno <- phdata(gwaa.data)
+ pheno <- GenABEL::phdata(gwaa.data)
}
GenABEL <- TRUE
cat(' OK\n')
@@ -122,7 +123,7 @@
for (k in 1:cuts) {
idx <- starts[k]:ends[k]
if (!GenABEL) {
- g <- databel2matrix(geno[,idx])[okidx,]
+ g <- DatABEL::databel2matrix(geno[,idx])[okidx,]
} else {
g <- as.double(gwaa.data at gtdata[,idx])[okidx,]
}
Modified: pkg/MultiABEL/R/load.summary.R
===================================================================
--- pkg/MultiABEL/R/load.summary.R 2017-01-24 11:25:17 UTC (rev 2063)
+++ pkg/MultiABEL/R/load.summary.R 2017-01-25 06:34:38 UTC (rev 2064)
@@ -67,13 +67,14 @@
#' @aliases load.summary
#' @keywords multivariate, meta-analysis
#'
-`load.summary` <- function(files, cor.pheno = NULL, indep.snps = NULL, est.var = FALSE,
+`load.summary` <- function(files, cor.pheno = NULL, indep.snps = NULL,
+ est.var = FALSE,
columnNames = c('snp', 'a1', 'a2', 'freq', 'beta', 'se', 'n'),
fixedN = NULL) {
### I. Sanity checks ###
- require(data.table)
+ # require(data.table)
if (!all(is.character(files))) {
stop('files should be given as strings!')
@@ -134,9 +135,11 @@
vys <- rep(1, m)
for (i in m:1) {
- #dd <- read.table(fn[i], header = TRUE, stringsAsFactors = FALSE)
- dd <- data.frame(fread(fn[i], header = TRUE, stringsAsFactors = FALSE,verbose=FALSE,showProgress=FALSE))
+ # Reserved for possible problems with data.table package
+ # dd <- read.table(fn[i], header = TRUE, stringsAsFactors = FALSE)
+ dd <- data.table::fread(fn[i], header = TRUE, stringsAsFactors = FALSE,verbose=FALSE,showProgress=FALSE,data.table=FALSE)
+
colnames(dd) <- tolower(colnames(dd))
currentColNames <- colnames(dd)
if (any(!(columnNames %in% currentColNames))) {
Modified: pkg/MultiABEL/R/misc.R
===================================================================
--- pkg/MultiABEL/R/misc.R 2017-01-24 11:25:17 UTC (rev 2063)
+++ pkg/MultiABEL/R/misc.R 2017-01-25 06:34:38 UTC (rev 2064)
@@ -2,7 +2,7 @@
.onAttach <-
function(lib, pkg, ...)
{
- pkgDescription <- packageDescription(pkg)
+ pkgDescription <- utils::packageDescription(pkg)
pkgVersion <- pkgDescription$Version
pkgDate <- pkgDescription$Date
pkgName <- pkgDescription$Package
Modified: pkg/MultiABEL/man/MultiLoad.Rd
===================================================================
--- pkg/MultiABEL/man/MultiLoad.Rd 2017-01-24 11:25:17 UTC (rev 2063)
+++ pkg/MultiABEL/man/MultiLoad.Rd 2017-01-25 06:34:38 UTC (rev 2064)
@@ -27,6 +27,8 @@
\item{impute}{An (optional) logical argument telling whether missing genotypes should be imputed.}
+\item{gaussianize}{logical argument gaussianize telling whether traits should be gaussianized}
+
\item{...}{not used.}
}
\value{
Modified: pkg/MultiABEL/man/load.summary.Rd
===================================================================
--- pkg/MultiABEL/man/load.summary.Rd 2017-01-24 11:25:17 UTC (rev 2063)
+++ pkg/MultiABEL/man/load.summary.Rd 2017-01-25 06:34:38 UTC (rev 2064)
@@ -5,12 +5,14 @@
\title{Loading multiple summary statistics from genome-wide association studies}
\usage{
load.summary(files, cor.pheno = NULL, indep.snps = NULL, est.var = FALSE,
- columnNames = c("snp", "a1", "freq", "beta", "se", "n"), fixedN = NULL)
+ columnNames = c("snp", "a1", "a2", "freq", "beta", "se", "n"),
+ fixedN = NULL)
}
\arguments{
\item{files}{A vector of file names as strings. Each file name should contain summary statistics of
one trait to be included in the multi-trait analysis. The columns of the summary statistics have to
-contain (uppercase or lowercase does not matter) \code{'snp'} (marker ID), \code{'a1'} (the first allele), \code{'freq'}
+contain (uppercase or lowercase does not matter) \code{'snp'} (marker ID), \code{'a1'} (the first allele),
+\code{'a2'} (the second allele), \code{'freq'},
(frequency of the first allele), \code{'beta'} (effect size), \code{'se'} (standard error), and
\code{'n'} (sample size).}
@@ -30,7 +32,7 @@
the corresponding phenoypic variance is 1.}
\item{columnNames}{A vector with names of columns containing necessary information in the input file;
-default values are c('snp','a1','freq','beta','se','n'). The values are case-insensitive. Note: check
+default values are c('snp','a1','a2','freq','beta','se','n'). The values are case-insensitive. Note: check
your allele definitions for different traits are based on the same strand!}
\item{fixedN}{sample size to assume across all analyses, when provided, this number will be used
More information about the Genabel-commits
mailing list