knitr::opts_chunk$set(echo = TRUE)
Gene_List = paste0('g', c(1:50)))
Gene_List = paste0('g', c(1:50))
sample(1:3, 1)
sample(1:3, 1)
sample(1:3, 1)
sample(1:3, 1)
gene_interaction$Gene <- data.frame(Gene = paste0('g', c(1:50)), stringsAsFactors = F)
gene_interaction <- data.frame(Gene = paste0('g', c(1:50)), stringsAsFactors = F)
gene_interaction$Rule <- paste0('( ', sample(gene_interaction$Gene, sample(1:3,1)), ' ) and not ( ', sample(gene_interaction$Gene, sample(1:2, 1)), ' )')
View(gene_interaction)
sample(gene_interaction$Gene, sample(1:3,1))
sample(gene_interaction$Gene, sample(1:3,1))
sample(gene_interaction$Gene, sample(1:3,1))
gene_interaction$Rule <- paste0('( ', sample(gene_interaction$Gene, sample(1:3,1)), ' ) and not ( ', sample(gene_interaction$Gene, sample(1:2, 1)), ' )')
gene_interaction$Rule <- paste0('( ', sample(gene_interaction$Gene, sample(1:3,1)), ' ) and not ( ', sample(gene_interaction$Gene, sample(1:2, 1)), ' )')
View(gene_interaction)
sample(gene_interaction$Gene, sample(1:3,1))
paste(sample(gene_interaction$Gene, sample(1:3,1)), ',')
paste(sample(gene_interaction$Gene, sample(1:3,1)), 'or')
paste0(sample(gene_interaction$Gene, sample(1:3,1)), 'or')
paste0('( ', sample(gene_interaction$Gene, sample(1:3,1)), ' ) and not ( ', sample(gene_interaction$Gene, sample(1:2, 1)), ' )')
paste0('( ', sample(gene_interaction$Gene, sample(1:3,1)), ' ) and not ( ', sample(gene_interaction$Gene, sample(1:2, 1)), ' )')
part_1 <- paste0(sample(gene_interaction$Gene, sample(1:3,1)), 'or')
part_1 <- sample(gene_interaction$Gene, sample(1:3,1))
part_1[1]
part_1 <- c(sample(gene_interaction$Gene, sample(1:3,1)))
part_1[1]
part_1 <- sample(gene_interaction$Gene, sample(1:3,1))
part_2 <- sample(gene_interaction$Gene, sample(1:2,1))
part_1 <- sample(gene_interaction$Gene, sample(1:3,1), 50)
part_2 <- sample(gene_interaction$Gene, sample(1:2,1), 50)
part_1 <- lapply(c(1:50), function(x) {x = x+1; sample(gene_interaction$Gene, sample(1:3,1))})
part_1
part_1 <- unlist(lapply(c(1:50), function(x) {x = x+1; sample(gene_interaction$Gene, sample(1:3,1))}))
part_1 <- lapply(c(1:50), function(x) {x = x+1; sample(gene_interaction$Gene, sample(1:3,1))})
part_2 <- lapply(c(1:50), function(x) {x = x+1; sample(gene_interaction$Gene, sample(1:2,1))})
gene_interaction$Rule <- lapply(c(1:50), function(x) {paste0('( ',part_1[x], ' ) and not ( ', part_2[x], ' )')})
View(gene_interaction)
gene_interaction$Rule <- lapply(c(1:50), function(x) {paste0('( ',unlist(part_1[x]), ' ) and not ( ', part_2[x], ' )')})
View(gene_interaction)
gene_interaction$Rule <- lapply(c(1:50), function(x) {paste0('( ',part_1[x], ' ) and not ( ', part_2[x], ' )')})
View(gene_interaction)
typeof(part_1[1])
unlist(part_1[1])
unlist(part_1[2])
c(unlist(part_1[2])_
c(unlist(part_1[2]))
write.table(gene_interaction, '~/MING_V9T/PhD_Pro/Test/Simulation/BoolODE_Data/G50_C200/Sim_Gene_Rules_G50.txt', sep = '\t', quote = F, row.names = F)
View(gene_interaction)
gene_interaction$Rule <- lapply(c(1:50), function(x) {paste0('( ',unlist(part_1[x]), ' ) and not ( ', part_2[x], ' )')})
paste0(unlist(part_1[3]), ' ')
paste0(unlist(part_1[3]))
part_1[3]
unlist(unlist(part_1[3]))
paste0(unlist(unlist(part_1[3])))
paste0(unlist(part_1[3]))
paste0(c(unlist(part_1[3])))
tmp = unlist(part_1[3])
paste0(tmp,'$')
tmp = as.character(unlist(part_1[3]))
tmp
tmp = toString(unlist(part_1[3]))
tmp = paste0(toString(unlist(part_1[3])), ' ')
tmp
toString(part_1[3])
gene_interaction$Rule <- lapply(c(1:50), function(x) {paste0('( ',toString(unlist(part_1[x])), ' ) and not ( ', toString(unlist(part_2[x])), ' )')})
View(gene_interaction)
write.table(gene_interaction, '~/MING_V9T/PhD_Pro/Test/Simulation/BoolODE_Data/G50_C200/Sim_Gene_Rules_G50.txt', sep = '\t', quote = F, row.names = F)
write.txt(gene_interaction, '~/MING_V9T/PhD_Pro/Test/Simulation/BoolODE_Data/G50_C200/Sim_Gene_Rules_G50.txt', sep = '\t', quote = F, row.names = F)
write(gene_interaction, '~/MING_V9T/PhD_Pro/Test/Simulation/BoolODE_Data/G50_C200/Sim_Gene_Rules_G50.txt', sep = '\t', quote = F, row.names = F)
write.csv(gene_interaction, '~/MING_V9T/PhD_Pro/Test/Simulation/BoolODE_Data/G50_C200/Sim_Gene_Rules_G50.txt', sep = '\t', quote = F, row.names = F)
write.table(gene_interaction, '~/MING_V9T/PhD_Pro/Test/Simulation/BoolODE_Data/G50_C200/Sim_Gene_Rules_G50.txt', sep = '|', quote = F, row.names = F)
gene_interaction$Rule
gene_interaction$Rule <- unlist(lapply(c(1:50), function(x) {paste0('( ',toString(unlist(part_1[x])), ' ) and not ( ', toString(unlist(part_2[x])), ' )')}))
View(gene_interaction)
write.table(gene_interaction, '~/MING_V9T/PhD_Pro/Test/Simulation/BoolODE_Data/G50_C200/Sim_Gene_Rules_G50.txt', sep = '\t', quote = F, row.names = F)
part_1 <- lapply(c(1:50), function(x) {x = x+1; sample(gene_interaction$Gene, sample(1:3,1))})
part_2 <- lapply(c(1:50), function(x) {x = x+1; sample(gene_interaction$Gene, sample(1,1))})
gene_interaction$Rule <- unlist(lapply(c(1:50), function(x) {paste0('( ',toString(unlist(part_1[x])), ' ) and not ( ', toString(unlist(part_2[x])), ' )')}))
write.table(gene_interaction, '~/MING_V9T/PhD_Pro/Test/Simulation/BoolODE_Data/G50_C200/Sim_Gene_Rules_G50.txt', sep = '\t', quote = F, row.names = F)
gene_interaction <- data.frame(Gene = paste0('g', c(1:500)), stringsAsFactors = F)
part_1 <- lapply(c(1:500), function(x) {x = x+1; sample(gene_interaction$Gene, sample(1:5,1))})
part_2 <- lapply(c(1:500), function(x) {x = x+1; sample(gene_interaction$Gene, sample(1:3,1))})
gene_interaction$Rule <- unlist(lapply(c(1:500), function(x) {paste0('( ',toString(unlist(part_1[x])), ' ) and not ( ', toString(unlist(part_2[x])), ' )')}))
write.table(gene_interaction, '~/MING_V9T/PhD_Pro/Test/Simulation/BoolODE_Data/G50_C200/Sim_Gene_Rules_G500.txt', sep = '\t', quote = F, row.names = F)
gene_interaction <- data.frame(Gene = paste0('g', c(1:1000)), stringsAsFactors = F)
part_1 <- lapply(c(1:1000), function(x) {x = x+1; sample(gene_interaction$Gene, sample(1:10,1))})
part_2 <- lapply(c(1:1000), function(x) {x = x+1; sample(gene_interaction$Gene, sample(1:5,1))})
gene_interaction$Rule <- unlist(lapply(c(1:1000), function(x) {paste0('( ',toString(unlist(part_1[x])), ' ) and not ( ', toString(unlist(part_2[x])), ' )')}))
write.table(gene_interaction, '~/MING_V9T/PhD_Pro/Test/Simulation/BoolODE_Data/G1000_C200/Sim_Gene_Rules_G1000.txt', sep = '\t', quote = F, row.names = F)
