From a1d1375ba47673062142ab5d343aeffe64a91481 Mon Sep 17 00:00:00 2001 From: aduvermy <arnaud.duvermy@ens-lyon.fr> Date: Wed, 9 Feb 2022 16:10:18 +0000 Subject: [PATCH] usess file --- test.R | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/test.R b/test.R index b5daf5f..6c04f08 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") + + + -- GitLab