Last active
December 17, 2015 03:28
-
-
Save brwnj/5543321 to your computer and use it in GitHub Desktop.
Return a normalized counts table from DESeq by calling Rscript. Assumes DESeq library is installed and file is tab delimited.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# Rscript norm_count_table.R file_in.tab file_out.tab | |
# source("http://bioconductor.org/biocLite.R") | |
# biocLite("DESeq") | |
library(DESeq) | |
args <- commandArgs(TRUE) | |
filein <- args[1] | |
fileout <- args[2] | |
ct <- read.table(filein, header=TRUE, row.names=1, sep="\t") | |
cds <- newCountDataSet(ct, condition=c(rep("t", ncol(ct)))) | |
cds <- estimateSizeFactors(cds) | |
write.table(counts(cds, normalized=TRUE), file=fileout, sep="\t", col.names=NA) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment