Skip to content

Commit

Permalink
Added 64 bit word compiler flag
Browse files Browse the repository at this point in the history
Working on writeRecords
  • Loading branch information
GAYNOR Chris committed Apr 14, 2017
1 parent a883cb5 commit 18b4571
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 7 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Package: AlphaSimR
Type: Package
Title: Breeding Program Simulation Tools
Version: 0.1
Title: Breeding Program Simulations
Version: 0.1.1
Author: Chris Gaynor
Maintainer: Chris Gaynor <[email protected]>
Description: This package contains classes and functions for simulating plant and animal breeding programs.
License: GPL (>= 2)
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Depends: MASS
Imports: Rcpp (>= 0.12.7), RcppArmadillo (>= 0.7.500.0.0), methods
LinkingTo: Rcpp, RcppArmadillo
RoxygenNote: 5.0.1
Suggests: knitr, rmarkdown
Suggests: knitr, rmarkdown, testthat
VignetteBuilder: knitr
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2017
COPYRIGHT HOLDER: R Chris Gaynor
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export(setPhenoGCA)
export(varAD)
export(varG)
export(varP)
export(writeRecords)
exportClasses(HybridPop)
exportClasses(LociMap)
exportClasses(MapPop)
Expand Down
2 changes: 1 addition & 1 deletion R/AlphaSimR.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @importFrom stats aggregate rnorm
#' @importFrom utils combn

#' @title AlphaSimR: A package for simulating breeding programs.
#' @title AlphaSimR: Breeding Program Simulations
#'
#' @description
#' This package is currently under development and is not yet ready for release.
Expand Down
37 changes: 37 additions & 0 deletions R/GS.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#' @title Write data records
#'
#' @description
#' Saves a population's phenotypic and marker data to a directory.
#'
#' @param pop an object of \code{\link{Pop-class}}
#' @param dir directory for saving output
#' @param snpChip which SNP chip genotype to save. If useQtl=TRUE, this
#' value will indicate which trait's QTL genotype to save.
#' @param useQtl should QTL genotype be written instead of SNP chip
#' genotypes.
#' @param simParam an object of \code{\link{SimParam-class}}
#'
#' @export
writeRecords = function(pop,dir,snpChip,useQtl=FALSE,simParam=SIMPARAM){
stopifnot(dir.exists(dir))
if(useQtl){
nMarkers = simParam@traits[[snpChip]]@nLoci
markerType = paste0("QTL_",snpChip)
}else{
nMarkers = simParam@snpChips[[snpChip]]@nLoci
markerType = paste0("SNP_",snpChip)
}
#Check that the marker set isn't being changed
markerInfo = data.frame(markerType=markerType,
nMarkers=nMarkers,
stringsAsFactors=FALSE)
markerInfoPath = file.path(dir,"markerInfo.txt")
if(file.exists(markerInfoPath)){
tmp = read.table(markerInfoPath,stringsAsFactors=FALSE)
stopifnot(identical(tmp,markerInfo))
}else{
write.table(markerInfo,markerInfoPath)
}


}
14 changes: 14 additions & 0 deletions R/SavedData.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#' @title Example MapPop
#'
#' @description An object of \code{\link{MapPop-class}} containing
#' two individuals with one chromosome with one Morgan length. Both
#' individuals are fully inbred and have 1001 segregating sites on
#' 1 chromosome. The first individual has all '1' alleles and the
#' second individual has all '0' alleles.
#'
#' @docType data
#'
#' @usage data(PopTwo)
#'
#' @format An object of \code{\link{MapPop-class}}
"PopTwo"
Binary file added data/PopTwo.RData
Binary file not shown.
2 changes: 1 addition & 1 deletion inst/doc/examples.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AlphaSimR Examples
# Works with version 0.1
# Works with version 0.1.X

# *Requires MaCS
# Which can be taken from AlphaSim on the AlphaGenes website
Expand Down
2 changes: 1 addition & 1 deletion man/AlphaSimR.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions man/PopTwo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions man/writeRecords.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Makevars
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CPPFLAGS = -DARMA_64BIT_WORD=1
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
1 change: 1 addition & 0 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

CPPFLAGS = -DARMA_64BIT_WORD=1
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
4 changes: 4 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
library(testthat)
library(AlphaSimR)

test_check("AlphaSimR")

0 comments on commit 18b4571

Please sign in to comment.