degall: Differential Expression analysis using all combination In shkonishi/rskoseq: This is my personal package of R functions for NGS data

Description

split count data with index and Differential expression analysis of all comination groups.

Usage

 `1` ```degall(dat, idx, normalized, meth_norm, param_fdr) ```

Arguments

 `dat` dataframe: RNA-seq count table. row: samples, column: genes `idx` factor: group of data. E.g. factor(c(1,1,2,2)); factor(c('A','A','B','B')) `normalized` logical: The 'dat' is a normalized count data or not. `meth_norm` integer: Choose from the six pipe line numbers below 1:'DEGES/TbT', 2:'DEGES/edgeR', 3:'iDEGES/edgeR', 4: 'DEGES/DESeq', 5: iDEGES/DESeq, 6: iDEGES/DESeq2. The default value is 2 `param_fdr` numeric: fdr value.

Value

ggplot object which containing result of 'TCC::estimateDE', without normalized count data.

Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46``` ```# # sample data of rna-seq # fpkm_rep3 <- rskodat::fpkm # fpkm_rep2 <- rskodat::fpkm[c(1,2,4,5)] # fpkm_norep <- rskodat::fpkm[c(1,4)] # # # aruguments # gp <- sapply(strsplit(names(fpkm_rep3), "_"), function(x) paste(x[1:2], collapse = "_")) # index0 <- factor(rep(1:4, each = 3)) # index1 <- factor(gp, levels=unique(gp)) # index2 <-factor(rep(1:2, each=2)) # index3 <- factor(c(1, 2)) # ## multi-group with replicate # res1a <- rskoseq::degall(dat = fpkm_rep3, idx = index0, meth_norm = 2) # res1b <- rskoseq::degall(dat = fpkm_rep3, idx = index1, meth_norm = 4) # # #' # two-group with replicate # res2a <- rskoseq::degall(dat = fpkm_rep2, idx = index2, meth_norm = 1) # res2b <- rskoseq::degall(dat = fpkm_rep2, idx = index2, meth_norm = 2) # res2c <- rskoseq::degall(dat = fpkm_rep2, idx = index2, meth_norm = 3) # res2d <- rskoseq::degall(dat = fpkm_rep2, idx = index2, meth_norm = 4) # res2e <- rskoseq::degall(dat = fpkm_rep2, idx = index2, meth_norm = 5) # res2f <- rskoseq::degall(dat = fpkm_rep2, idx = index2, meth_norm = 6) # # # two samples without replicate # res3a <- rskoseq::degall(dat = fpkm_norep, idx = index3, meth_norm = 3) # res3b <- rskoseq::degall(dat = fpkm_norep, idx = index3, meth_norm = 4) # ## get result of estimateDE # head(res1a\$deg) # ## redraw MA-plot # tmp <- res1a\$deg %>% filter(comp %in% levels(.\$comp)[1:3]) # add_de <- res1a\$num_deg %>% filter(comp %in% levels(.\$comp)[1:3]) # # ggplot2::ggplot(tmp, ggplot2::aes(x = a.value, y = m.value, colour = fct)) + # ggplot2::geom_point(size = 0.3) + # ggplot2::scale_color_manual(values = # c("non-DEG"="#BEBEBE80", "up"="#FF000080", "down" ="#0000FF80")) + # ggplot2::theme_minimal(base_size = 15) + # ggplot2::labs(x = "A=(log2(G2)+log2(G1))/2", y = "M=log2(G2)-log2(G1)", colour = "") + # ggplot2::theme(legend.position = "top") + # ggplot2::guides(colour = ggplot2::guide_legend(override.aes = list(alpha=1, size = 5))) + # ggplot2::geom_text(data = add_de, ggplot2::aes(x = x, y = y, label = value, colour = key), # size = 5, show.legend = F) + # ggplot2::facet_wrap(~comp, ncol = 3) ```

shkonishi/rskoseq documentation built on Dec. 24, 2018, 3:14 a.m.