Skip to content
Snippets Groups Projects
Commit 5fff23d3 authored by nfontrod's avatar nfontrod
Browse files

src/03_ERCC_analysis_code.R: cosmetic changes

parent c8ecd465
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,10 @@ ercc_count_matrix <- get_count_matrix( ...@@ -17,7 +17,10 @@ ercc_count_matrix <- get_count_matrix(
0 0
)[, colnames(data_count_matrix)] )[, colnames(data_count_matrix)]
data_count_matrix <- data.frame(gene = rownames(data_count_matrix), data_count_matrix) data_count_matrix <- data.frame(
gene = rownames(data_count_matrix),
data_count_matrix
)
dir.create("./results/matrice_count/") dir.create("./results/matrice_count/")
write.table(data_count_matrix, write.table(data_count_matrix,
file = "./results/matrice_count/coding_gene_matrices.txt", file = "./results/matrice_count/coding_gene_matrices.txt",
...@@ -26,7 +29,10 @@ write.table(data_count_matrix, ...@@ -26,7 +29,10 @@ write.table(data_count_matrix,
row.names = F row.names = F
) )
ercc_count_matrix_new <- data.frame(gene = rownames(ercc_count_matrix), ercc_count_matrix) ercc_count_matrix_new <- data.frame(
gene = rownames(ercc_count_matrix),
ercc_count_matrix
)
write.table(ercc_count_matrix_new, write.table(ercc_count_matrix_new,
file = "./results/matrice_count/ercc_matrices.txt", file = "./results/matrice_count/ercc_matrices.txt",
quote = F, quote = F,
...@@ -38,7 +44,10 @@ write.table(ercc_count_matrix_new, ...@@ -38,7 +44,10 @@ write.table(ercc_count_matrix_new,
ercc_real_concentration <- read_tsv("./data/ercc_concentration.txt") %>% ercc_real_concentration <- read_tsv("./data/ercc_concentration.txt") %>%
select(`ERCC ID`, `concentration in Mix 1 (attomoles/ul)`) %>% select(`ERCC ID`, `concentration in Mix 1 (attomoles/ul)`) %>%
rename(`ERCC ID` = "gene", `concentration in Mix 1 (attomoles/ul)` = "concentration") rename(
`ERCC ID` = "gene",
`concentration in Mix 1 (attomoles/ul)` = "concentration"
)
c_sup0 <- create_correlation_figures(ercc_count_matrix, 0) c_sup0 <- create_correlation_figures(ercc_count_matrix, 0)
c_sup2 <- create_correlation_figures(ercc_count_matrix, 2) c_sup2 <- create_correlation_figures(ercc_count_matrix, 2)
...@@ -89,7 +98,8 @@ ercc_sample <- get_sample_count(ercc_count_matrix) ...@@ -89,7 +98,8 @@ ercc_sample <- get_sample_count(ercc_count_matrix)
relative_counts <- get_relative_count(data_sample, ercc_sample) relative_counts <- get_relative_count(data_sample, ercc_sample)
relative_counts <- relative_counts %>% arrange(name) relative_counts <- relative_counts %>% arrange(name)
pdf("./results/ERCC_analysis/ratio_ercc_on_genecount.pdf", pdf("./results/ERCC_analysis/ratio_ercc_on_genecount.pdf",
width = 12, height = 8) width = 12, height = 8
)
ggplot(relative_counts, mapping = aes(x = name, y = relative_count)) + ggplot(relative_counts, mapping = aes(x = name, y = relative_count)) +
geom_boxplot() + geom_boxplot() +
theme(axis.text.x = element_text(angle = 90)) theme(axis.text.x = element_text(angle = 90))
...@@ -97,7 +107,9 @@ dev.off() ...@@ -97,7 +107,9 @@ dev.off()
# Normalisation # Normalisation
full_matrix <- rbind(data_count_matrix, ercc_count_matrix) full_matrix <- rbind(data_count_matrix, ercc_count_matrix)
coldata <- data.frame(condition = relevel(as.factor(str_extract(colnames(data_count_matrix), "BRAF|DMSO")), "DMSO")) coldata <- data.frame(condition = relevel(
as.factor(str_extract(colnames(data_count_matrix), "BRAF|DMSO")), "DMSO"
))
rownames(coldata) <- colnames(data_count_matrix) rownames(coldata) <- colnames(data_count_matrix)
dds <- DESeqDataSetFromMatrix( dds <- DESeqDataSetFromMatrix(
countData = full_matrix, colData = coldata, countData = full_matrix, colData = coldata,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment