Skip to content

Commit

Permalink
v 0.2.3, CRAN release
Browse files Browse the repository at this point in the history
  • Loading branch information
variani committed May 10, 2015
1 parent cb8ab97 commit dabf672
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 30 deletions.
11 changes: 6 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: solarius
Type: Package
Title: An R interface to SOLAR program
Version: 0.2.2
Date: 2015-05-06
Title: An R Interface to SOLAR
Version: 0.2.3
Date: 2015-05-08
Authors@R: c(
person("Andrey", "Ziyatdinov", email = "[email protected]", role = c("cre", "aut")),
person("Helena", "Brunel", role = "aut"),
Expand All @@ -14,11 +14,12 @@ Maintainer: Andrey Ziyatdinov <[email protected]>
Description:
SOLAR is the standard software program to perform linkage and association mappings
of the quantitative trait loci (QTLs) in pedigrees of arbitrary size and complexity.
solarius allows the user to exploit the variance component methods implemented in SOLAR.
This package allows the user to exploit the variance component methods implemented in SOLAR.
It automates such routine operations as formatting pedigree and phenotype data.
It also parses the model output and contains summary and plotting functions for exploration of the results.
In addition, solarius enables parallel computing of the linkage and association analyses,
that makes the calculation of genome-wide scans more efficient.
See <http://solar.txbiomedgenetics.org/> for more information about SOLAR.
License: GPL (>= 3)
URL: https://github.com/ugcd/solarius
LazyData: false
Expand All @@ -32,7 +33,7 @@ Suggests:
scales,
Matrix,
gdata,
doMC,
doParallel,
iterators,
parallel,
qqman
Expand Down
2 changes: 1 addition & 1 deletion R/classSolarAssoc.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ plot.solarAssoc.old <- function(x,
#if(!ret) {
# stop("`ggplot2` package is required for plotting")
#}
ret <- require(scales)
ret <- requireNamespace("scales", quietly = TRUE)
if(!ret) {
stop("`scales` package is required for plotting")
}
Expand Down
22 changes: 15 additions & 7 deletions R/plot.lib.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,17 @@ plotPed <- function(data, ped)
stopifnot(!missing(data))
stopifnot(class(data) == "data.frame")
stopifnot(!missing(ped))

stopifnot(require(kinship2))


# load required R package kinship2
stopifnot(requireNamespace("kinship2", quietly = TRUE))

ret <- NULL # R CMD check: no visible binding
cmd <- "ret <- require(kinship2)"
eval(parse(text = cmd))
if(!ret) {
stop("`kinship2` package is required for plotting pedigrees.")
}

renames <- matchIdNames(names(data))
data <- rename(data, renames)
stopifnot(all(c("ID", "FA", "MO", "SEX", "FAMID") %in% names(data)))
Expand Down Expand Up @@ -60,7 +68,7 @@ plotPed <- function(data, ped)

# make `pedigree` object
ped <- with(df,
pedigree(id = ID, dadid = FA, momid = MO, sex = SEX, famid = FAMID, missid = ""))
kinship2::pedigree(id = ID, dadid = FA, momid = MO, sex = SEX, famid = FAMID, missid = ""))

plot(ped[1])
}
Expand Down Expand Up @@ -111,7 +119,7 @@ plotPed <- function(data, ped)
#' @export
plotManh <- function(A, alpha = 0.05, main, ...)
{
stopifnot(require(qqman))
stopifnot(requireNamespace("qqman", quietly = TRUE))

stopifnot(all(c("chr", "pSNP", "pos") %in% names(A$snpf)))

Expand Down Expand Up @@ -153,7 +161,7 @@ plotManh <- function(A, alpha = 0.05, main, ...)
#' @export
plotQQ <- function(A, df = 1, main, ...)
{
stopifnot(require(qqman))
stopifnot(requireNamespace("qqman", quietly = TRUE))

# get p-values
stopifnot("pSNP" %in% names(A$snpf))
Expand Down Expand Up @@ -234,7 +242,7 @@ plotKinship2 <- function(x, y = c("image", "hist"))
#' @export imageKinship2
imageKinship2 <- function(x)
{
stopifnot(require(Matrix))
stopifnot(requireNamespace("Matrix", quietly = TRUE))

Matrix::image(Matrix::Matrix(x))
}
Expand Down
9 changes: 4 additions & 5 deletions R/solarAssoc.R
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,10 @@ run_assoc <- function(out, dir)
trun_assoc$solar <- proc.time()
parallel <- (cores > 1)
if(parallel) {
ret <- require(doMC)
if(!ret) {
stop("`doMC` package is required for parallel calculations")
}
doMC::registerDoMC(cores)
# load required R package doParallel
stopifnot(requireNamespace("doParallel", quietly = TRUE))

doParallel::registerDoParallel(cores = cores)
}

### case 1
Expand Down
9 changes: 4 additions & 5 deletions R/solarMultipoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,10 @@ run_multipoint <- function(out, dir)
trun_multipoint$solar <- proc.time()
parallel <- (cores > 1)
if(parallel) {
ret <- require(doMC)
if(!ret) {
stop("`doMC` package is required for parallel calculations")
}
doMC::registerDoMC(cores)
# load required R package doParallel
stopifnot(requireNamespace("doParallel", quietly = TRUE))

doParallel::registerDoParallel(cores = cores)
}

if(cores == 1) {
Expand Down
11 changes: 5 additions & 6 deletions R/support.lib.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,10 @@ read_map_files <- function(files, cores = 1)
{
parallel <- (cores > 1)
if(parallel) {
ret <- require(doMC)
if(!ret) {
stop("Error in `read_map_files`: `doMC` package is required for parallel calculations")
}
doMC::registerDoMC(cores)
# load required R package doParallel
stopifnot(requireNamespace("doParallel", quietly = TRUE))

doParallel::registerDoParallel(cores = cores)
}

map.list <- llply(files, function(f) try({
Expand Down Expand Up @@ -217,7 +216,7 @@ kmat2phi2 <- function(kmat, dir, kin2.gz = "kin2.gz")

kf2phi2 <- function(kf, dir, kin2.gz = "kin2.gz")
{
stopifnot(require(gdata))
#stopifnot(requireNamespace("gdata", quietly = TRUE))

pedindex.out <- file.path(dir, "pedindex.out")
pf <- read_pedindex(pedindex.out)
Expand Down
2 changes: 1 addition & 1 deletion R/transforms.lib.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ transform_trait_inormal <- function(x, mean = 0, sd = 1)
of <- of[with(of, order(sample)), ]

### duplicated values
y <- NULL # due to R CMD check: no visible binding for global variable ‘y’
y <- NULL # due to R CMD check: no visible binding
of <- ddply(of, .(x), mutate,
y = median(y, na.rm = TRUE))

Expand Down

0 comments on commit dabf672

Please sign in to comment.