Commit 5eae0706 authored by Lena Hersemann's avatar Lena Hersemann

updated report of exported data

parent cbeb6c34
......@@ -618,7 +618,7 @@ deResults %>%
########################################################################################################################
#' ## Count Table Exports
# Count Table Exports
## optionally install bioconducor package
......@@ -648,7 +648,7 @@ geneDescs = transmute(geneInfo, ensembl_gene_id, gene_name = external_gene_name,
write_tsv(geneInfo, path = paste0(resultsBase, "geneInfo.txt"))
#' Export counts per replicate as double-normalized FPKMs=(read_count * 10^9)/(gene_length * library_size)
# Export counts per replicate as double-normalized FPKMs=(read_count * 10^9)/(gene_length * library_size)
fpkms = countMatrix %>%
as.data.frame %>%
rownames_to_column("ensembl_gene_id") %>%
......@@ -669,7 +669,7 @@ fpkms %>%
push_left(c("gene_name", "gene_description")) %>%
write_tsv(paste0(resultsBase, "fpkms_by_replicate.txt"))
#' Aggregate FPKMs by condition and export into tabele
# Aggregate FPKMs by condition and export into tabele
fpkms %>%
inner_join(exDesign, by = "replicate") %>%
# group_by_(.dots = c(contrastAttribute, "ensembl_gene_id")) %>%
......@@ -682,10 +682,10 @@ fpkms %>%
push_left(c("gene_name", "gene_description")) %>%
write_tsv(paste0(resultsBase, "fpkms_by_condition.txt"))
#' [FPKMs as Matrix](`r paste0(resultsBase, "fpkms_by_condition.txt")`)
# [FPKMs as Matrix](`r paste0(resultsBase, "fpkms_by_condition.txt")`)
#' Export counts per replicate as TPMs (transcript per million)
# Export counts per replicate as TPMs (transcript per million)
# calculation of tpms and generation of a wide table including gene description and the external gene name
tpms = countMatrix %>%
......@@ -706,7 +706,7 @@ tpms %>%
push_left(c("gene_name", "gene_description")) %>%
write_tsv(paste0(resultsBase, "tpms_by_replicate.txt"))
#' Also average TPMs per condition and export
# Also average TPMs per condition and export
tpms %>%
inner_join(exDesign, by = "replicate") %>%
group_by(condition, ensembl_gene_id) %>%
......@@ -733,7 +733,7 @@ deAnnot = deResults %>% left_join(geneInfo)
write_tsv(deAnnot, path = paste0(resultsBase, "de_results.txt"))
#deAnnot = read_tsv(paste0(resultsBase, "de_results.txt"))
#' [deAnnot](`r paste0(resultsBase, "de_results.txt")`)
# [de_results.txt](`r paste0(resultsBase, "de_results.txt")`)
## also export results which we'll always need for pathways overlays
deAnnot %>%
......@@ -840,19 +840,19 @@ degs %>%
write_tsv(paste0(resultsBase, "degs_by_contrast_directed.txt"))
## also export gsea inputs
deAnnot %>%
mutate(contrast = paste(condition_1, "vs", condition_2)) %>%
filter(! is.na(pvalue)) %>%
transmute(contrast, ensembl_gene_id, rank_score = - log10(pvalue)) %>% #count(is.na(rank_score))
# arrange(contrast, rank_score) %>%
write_tsv(paste0(resultsBase, "gsea__genes_by_contrast__undirected.txt"))
#deAnnot %>%
# mutate(contrast = paste(condition_1, "vs", condition_2)) %>%
# filter(! is.na(pvalue)) %>%
# transmute(contrast, ensembl_gene_id, rank_score = - log10(pvalue)) %>% #count(is.na(rank_score))
## arrange(contrast, rank_score) %>%
# write_tsv(paste0(resultsBase, "gsea__genes_by_contrast__undirected.txt"))
deAnnot %>%
mutate(contrast = paste(condition_1, "vs", condition_2)) %>%
filter(! is.na(pvalue)) %>%
transmute(contrast, ensembl_gene_id, rank_score = - log10(pvalue) * ifelse(s1_overex, 1, - 1)) %>%
# arrange(contrast, rank_score) %>%
write_tsv(paste0(resultsBase, "gsea__genes_by_contrast__directed.txt"))
#deAnnot %>%
# mutate(contrast = paste(condition_1, "vs", condition_2)) %>%
# filter(! is.na(pvalue)) %>%
# transmute(contrast, ensembl_gene_id, rank_score = - log10(pvalue) * ifelse(s1_overex, 1, - 1)) %>%
## arrange(contrast, rank_score) %>%
# write_tsv(paste0(resultsBase, "gsea__genes_by_contrast__directed.txt"))
# ## render interactive hit browser
......@@ -949,6 +949,23 @@ mat <- assay(rld) %>%
mat <- mat - rowMeans(mat)
pheatmap(mat, annotation_col = column2rownames(exDesign, "replicate") %>% select(- col_index))
session::save.session(".featcounts_deseq_mf.dat");
########################################################################################################################
#' ## Exported Data
#'
#' | File | Description |
#' |------|------|
#' | [diffex_genes.txt](diffex_genes.txt) | list of all differentially expressed genes from the DESeq analysis - That's the file you are most likely looking for! |
#' | [de_results.txt](de_results.txt) | list of all genes from the DESeq analysis |
#' | [fpkms_by_condition.txt](fpkms_by_condition.txt) | fpkm values of the different conditions |
#' | [fpkms_by_replicate.txt](fpkms_by_replicate.txt) | fpkm values of individual replicates |
#' | [tpms_by_conditon.txt](tpms_by_conditon.txt) | tpm values of the different conditions |
#' | [tpms_by_replicate.txt](tpms_by_replicate.txt) | tpm values of individual replicates |
#' | [geneInfo.txt](geneInfo.txt) | general gene information |
#'
#' Further informtion on [FPKM and TPM](http://www.rna-seqblog.com/rpkm-fpkm-and-tpm-clearly-explained/)
session::save.session(".featcounts_deseq_mf.dat");
# session::restore.session(".featcounts_deseq_mf.dat");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment