From 535fb42cd7d06d4393aa37ce0ce2de14da21dc6b Mon Sep 17 00:00:00 2001 From: Yuuki Galaxy Date: Wed, 21 Oct 2020 17:50:53 +0800 Subject: [PATCH] new file: dodseq.r --- R/deseq2/dodseq.r | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 R/deseq2/dodseq.r diff --git a/R/deseq2/dodseq.r b/R/deseq2/dodseq.r new file mode 100755 index 000000000..6ea076045 --- /dev/null +++ b/R/deseq2/dodseq.r @@ -0,0 +1,32 @@ +#!/usr/bin/env littler + +if (length(argv)<2) { + cat("Usage ./dodseq.r [prefix]\n") + quit() +} +inFile <- argv[1] +ExpCnt <- as.numeric(unlist(strsplit(argv[2],',',fixed=T))) +outP <- argv[3] +if (length(argv)==2) { + outP <- unlist(strsplit(inFile,'.',fixed=T))[1] +} +cat(sep='',"[!]From [",inFile,"],Design [",ExpCnt[1],':',ExpCnt[2],"],Prefix [",outP,"].\n") + +countdata <- read.table(inFile, header=TRUE, row.names=1) +countdata <- countdata[ ,6:ncol(countdata)] +colnames(countdata) <- gsub("^alnSTAT\\.", "", colnames(countdata)) +colnames(countdata) <- gsub("Aligned\\.sortedByCoord\\.out\\.[sb]am$", "", colnames(countdata)) +countdata <- as.matrix(countdata) + +tFileDim <- dim(countdata) +tExpSize <- ExpCnt[1]+ExpCnt[2] +if ( tFileDim[2] != tExpSize ) { + cat("[x]Design size",tExpSize,"not matching with file column size",tFileDim[2],"!\n[!]File columns:[") + cat(sep=',',colnames(countdata)) + cat("].\n") + quit() +} + +print(head(countdata)) +cat(colnames(countdata),"\n") +cat(dim(countdata),"\n") -- 2.11.4.GIT