in_f <- "count.txt" out_f1 <- "non_vs_snf_iDEGESedgeR_DE.txt" out_f2 <- "non_vs_snf_iDEGESedgeR_DE_FDR.png" param_G1 <- 3 param_G2 <- 3 param_DEmethod <- "edger" param_FDR <- 0.001 param_fig <- c(400, 380) library(TCC) data <- read.table(in_f, header=TRUE, row.names=1, sep="\t", quote="") data.cl <- c(rep(1, param_G1), rep(2, param_G2)) tcc <- new("TCC", data, data.cl) tcc <- calcNormFactors(tcc, norm.method="tmm", test.method="edger", iteration=3, FDR=0.1, floorPDEG=0.05) tcc <- estimateDE(tcc, test.method=param_DEmethod, FDR=param_FDR) result <- getResult(tcc, sort=FALSE) tmp <- cbind(rownames(tcc$count), tcc$count, result) write.table(tmp, out_f1, sep="\t", append=F, quote=F, row.names=F) png(out_f2, pointsize=13, width=param_fig[1], height=param_fig[2]) plot(tcc, FDR=param_FDR, xlim=c(-3, 13), ylim=c(-10, 10)) legend("bottomright", c(paste("DEG(FDR<", param_FDR, ")", sep=""), "non-DEG"), col=c("magenta", "black"), pch=20) dev.off() |
in_f <- "count.txt" out_f1 <- "non_vs_snf_iDEGES_DE.txt" out_f2 <- "non_vs_snf_iDEGES_DE_FDR.png" param_G1 <- 1 param_G2 <- 1 library(TCC) data <- read.table(in_f, header=TRUE, row.names=1, sep="\t", quote="") data.cl <- c(rep(1, param_G1), rep(2, param_G2)) tcc <- new("TCC", data, data.cl) tcc <- calcNormFactors(tcc, iteration=3) normalized <- getNormalizedData(tcc) tmp <- cbind(rownames(normalized), normalized) write.table(tmp, out_f1, sep="\t", append=F, quote=F, row.names=F) png(out_f2, pointsize=13, width=param_fig[1], height=param_fig[2]) plot(tcc, FDR=param_FDR, xlim=c(-3, 13), ylim=c(-10, 10)) legend("bottomright", c(paste("DEG(FDR<", param_FDR, ")", sep=""), "non-DEG"), col=c("magenta", "black"), pch=20) dev.off() |
in_f <- "count.txt" out_f <- "hoge1.txt" param_G1 <- 3 param_G2 <- 3 param_G3 <- 3 library(TCC) data <- read.table(in_f, header=TRUE, row.names=1, sep="\t", quote="") data.cl <- c(rep(1, param_G1), rep(2, param_G2), rep(3, param_G3)) tcc <- new("TCC", data, data.cl) tcc <- calcNormFactors(tcc, norm.method="tmm", test.method="edger", iteration=3, FDR=0.1, floorPDEG=0.05) normalized <- getNormalizedData(tcc) tmp <- cbind(rownames(data), normalized) write.table(tmp, out_f, sep="\t", append=F, quote=F, row.names=F) |