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

add src repo

parent 98315cf1
No related branches found
No related tags found
No related merge requests found
#seed
library(tidyverse)
library(data.table)
# fix seed
set.seed(123)
#params
N_gene = 6000
## function generator
rnbinom_generator <- function(n_gene, mu_simul, alpha){
my_counts <- rnbinom(n = n_gene, mu = mu_simul, size = alpha)
return(my_counts)
}
## build my lib counts
env1 <- rnbinom_generator(N_gene, 50, 5)
env2 <- rnbinom_generator(N_gene, 100, 5)
## export my lib count
names(env1) <- sprintf("gene%d", 1:N_gene)
names(env2) <- sprintf("gene%d", 1:N_gene)
env1 %>% data.frame(.) %>% fwrite(., "~/mydatalocal/counts_simulation/env1.csv", row.names = T, col.names = F, sep = "\t")
env2 %>% data.frame(.) %>% fwrite(., "~/mydatalocal/counts_simulation/env2.csv", row.names = T, col.names = F, sep = "\t")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment