Skip to content
Snippets Groups Projects
Commit f7f43b06 authored by Arnaud Duvermy's avatar Arnaud Duvermy
Browse files

Delete main.R

parent 76f39f6f
Branches
Tags
No related merge requests found
############################# PCKGE REQUIRED ##############################
library(DESeq2)
library(ggplot2)
library(tydiverse)
### maybe others ###
########################## change your home path ##########################
setwd("mydatalocal/counts_simulation/src")
# fix seed
set.seed(123)
########################## IMPORT FUN ################################
## simulation functions
source("simulators.R")
#visualization function
source("visualization_fun.R")
########################## INPUT PARAMS #####################################
N_cond = 2
N_gene = 6000
n_rep_sim = seq(2, 5, by = 1) ### number of replicate to assessed
############################ MU effect #######################################
mu_simul_dtf_res <- data.frame()
for (N_rep in n_rep_sim){
mu_simul = seq(2500, 12000, by = 200)
#mu_simul
#mu_simul <- rep.int(1500, 8)
res_simul <- mu_effect(alpha = 2, mu_simul)
res_simul$N_rep <- N_rep
tmp_reshape_res_simul <- res_simul %>% reshape2::melt(.,id = c("vec_of_mu", "N_rep"))
mu_simul_dtf_res <- rbind(mu_simul_dtf_res, tmp_reshape_res_simul)
}
###### LOG transform #######
# -> SEE linearity of var observed & mu
#mu_simul_dtf_res$value[mu_simul_dtf_res$variable=="var_observ"]<-log(mu_simul_dtf_res$value[mu_simul_dtf_res$variable=="var_observ"])
#mu_simul_dtf_res$vec_of_mu <- log(mu_simul_dtf_res$vec_of_mu)
###### Visualization ######
figure_mu_effect <- mu_effect_visualization(mu_simul_dtf_res)
figure_mu_effect
########################### ALPHA effect ####################################
n_rep_sim = seq(2, 5, by = 1)
alpha_simul_dtf_res <- data.frame()
for (N_rep in n_rep_sim){
alpha_simul = seq(0.2, 7, by = 0.2)
alpha_simul
res_simul <- size_effect(mu = 10000, alpha_simul)
res_simul$N_rep <- N_rep
tmp_reshape_res_simul <- res_simul %>% reshape2::melt(.,id = c("vec_of_alpha", "N_rep"))
alpha_simul_dtf_res <- rbind(alpha_simul_dtf_res, tmp_reshape_res_simul)
}
###### Visualization ######
alpha_simul_dtf_res
figure_alpha_effect <- size_effect_visualization(alpha_simul_dtf_res)
figure_alpha_effect
########################### EXPORT RESULTS #################################
svg("mydatalocal/counts_simulation/img/fig_mu_effect.svg")
figure_mu_effect
dev.off()
svg("mydatalocal/counts_simulation/img/fig_size_effect.svg")
figure_alpha_effect
dev.off()
########################### bETA TEST #####################################
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment