diff --git a/test.R b/test.R index b5daf5facb0fba44fbad430bd706d3ee162bbf39..6c04f08fc74b7f09f7117aabffb84fdd3532aea0 100644 --- a/test.R +++ b/test.R @@ -68,3 +68,44 @@ library("dplyr") example_2d_df <- as_tibble(example_3d_cube) #} #) + + + + #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_A <- rnbinom_generator(N_gene, 50, 5) + env1_B <- rnbinom_generator(N_gene, 50, 5) + + env2_A <- rnbinom_generator(N_gene, 100, 5) + env2_B <- rnbinom_generator(N_gene, 100, 5) + + + + ## export my lib count + names(env1_A) <- sprintf("gene%d", 1:N_gene) + names(env1_B) <- sprintf("gene%d", 1:N_gene) + + names(env2_A) <- sprintf("gene%d", 1:N_gene) + names(env2_B) <- sprintf("gene%d", 1:N_gene) + + env1_A %>% data.frame(.) %>% fwrite(., "~/mydatalocal/counts_simulation/results/env1_A.tsv", row.names = T, col.names = F, sep = "\t") + env2_A %>% data.frame(.) %>% fwrite(., "~/mydatalocal/counts_simulation/results/env2_A.tsv", row.names = T, col.names = F, sep = "\t") + env1_B %>% data.frame(.) %>% fwrite(., "~/mydatalocal/counts_simulation/results/env1_B.tsv", row.names = T, col.names = F, sep = "\t") + env2_B %>% data.frame(.) %>% fwrite(., "~/mydatalocal/counts_simulation/results/env2_B.tsv", row.names = T, col.names = F, sep = "\t") + + +