# HG changeset patch
# User sblanck
# Date 1529589983 14400
# Node ID 2d7595c8041d46e564ce8e8d695bbc6b0e317a27
# Parent 2c0df656094a6ad44ff0114652c8afe1c04ceb86
planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit d42088af604c5a01e1ccebba1d59f7a28a976f71
diff -r 2c0df656094a -r 2d7595c8041d MetaRNAseq.xml
--- a/MetaRNAseq.xml Thu Jun 21 08:25:36 2018 -0400
+++ b/MetaRNAseq.xml Thu Jun 21 10:06:23 2018 -0400
@@ -41,7 +41,7 @@
-
+
diff -r 2c0df656094a -r 2d7595c8041d Recount.R
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Recount.R Thu Jun 21 10:06:23 2018 -0400
@@ -0,0 +1,47 @@
+#!/usr/bin/env Rscript
+# setup R error handling to go to stderr
+options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
+
+# we need that to not crash galaxy with an UTF8 error on German LC settings.
+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
+
+library("optparse")
+
+##### Read options
+option_list=list(
+ make_option("--id",type="character",default=NULL,help="GSE ID from GEO databse (required)"),
+ make_option("--report",type="character",default=NULL,help="Text file summarizing conditions of the experiment")
+
+);
+
+opt_parser = OptionParser(option_list=option_list);
+opt = parse_args(opt_parser);
+
+if(is.null(opt$id)){
+ print_help(opt_parser)
+ stop("Recount id required.", call.=FALSE)
+}
+
+#loading libraries
+suppressPackageStartupMessages(require(GEOquery))
+
+studyID=opt$id
+reportFile=opt$report
+
+dir.create("./split", showWarnings = TRUE, recursive = FALSE)
+
+url <- download_study(studyID)
+load(file.path(studyID, 'rse_gene.Rdata'))
+rse <- scale_counts(rse_gene)
+counts=assay(rse)
+conditions=rse$title
+
+for (i in 1:ncol(counts))
+{
+ currentCount=as.data.frame(counts[,i])
+ sampleID=colnames(counts)[i]
+ colnames(currentCount)=sampleID
+ write.table(x=currentCount,file=paste0("./split/",sampleID,"_",conditions[i]),sep="\t",row.names = T, col.names = T)
+}
+
+write.table(as.data.frame(cbind(sampleID=colnames(counts),title=conditions)),quote = FALSE,col.names =TRUE, row.names=FALSE,file=reportFile,sep="\t")
\ No newline at end of file
diff -r 2c0df656094a -r 2d7595c8041d Recount.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Recount.xml Thu Jun 21 10:06:23 2018 -0400
@@ -0,0 +1,52 @@
+
+
+ Get rna-seq count data with R recount Package
+
+
+ bioconductor-recount
+ r-optparse
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+