Compare commits

...

2 Commits

Author SHA1 Message Date
b15ad49b2c Removing csv from commit 2022-12-03 18:38:21 -06:00
13c101ca11 Adding artificial gwas generation 2022-12-03 18:37:36 -06:00
5 changed files with 43 additions and 0 deletions

36
Code/Data/gen_gwas.R Normal file
View File

@ -0,0 +1,36 @@
# npdro::createSimulation2() example for gwas simulation
if (!require("devtools")) install.packages("devtools")
library(devtools)
install_github("insilico/npdro")
library(npdro)
## Set Working Directory to file directory - RStudio approach
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
gen.gwas = function(samples, vars, batch_size=1000){
for (x in 1:ceiling(samples/batch_size)){
curr_batch <- samples - (batch_size*(x-1))
batch_gen <- ifelse(curr_batch > batch_size, batch_size, curr_batch)
data <- createSimulation2(data.type = "discrete", avg.maf = 0.2,
sim.type = "mainEffect",
pct.train = 1.0,
pct.imbalance=round(runif(n = 1, min = 0.1, max = 0.9),2),
main.bias = 0.4, pct.signals = 0.2,
num.samples = batch_gen,
num.variables = vars)
rownames(data$train) <- as.integer(rownames(data$train))+
(batch_size*(x-1))
if (x == 1){
write.table(data$train, "artif_gwas.csv", row.names = TRUE)
} else{
write.table(data$train, "artif_gwas.csv", row.names = TRUE,
append = TRUE, col.names = FALSE)
}
}
return(data$train)
}
gen.gwas(1000000, 10000)

View File

@ -0,0 +1,5 @@
#include <boost/mpi.hpp>
#include <boost/mpi/environment.hpp>
#include <plinkio/plinkio.h>
#include <Rcpp.h>

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@
,noah,NovaArchSys,03.12.2022 18:36,file:///home/noah/.config/libreoffice/4;