Repository 'r_goseq_1_22_0'
hg clone https://eddie.galaxyproject.org/repos/mvdbeek/r_goseq_1_22_0

Changeset 6:0e9424413ab0 (2016-03-03)
Previous changeset 5:b79c65c90744 (2016-02-28) Next changeset 7:9ffae7bc23c2 (2016-03-07)
Commit message:
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/goseq_1_22_0 commit f95b47ed1a09ce14d3b565e8ea56d8bf12c35814-dirty
modified:
get_length_and_gc_content.r
get_length_and_gc_content.xml
getgo.r
getgo.xml
goseq.r
goseq.xml
test-data/dge_list.tab
added:
go_macros.xml
test-data/category.tab
test-data/gc.tab
test-data/gene_length.tab
test-data/go_terms.tab
test-data/in.fasta
test-data/in.gtf
test-data/length.tab
test-data/wal.tab
removed:
test-data/wall.tab
b
diff -r b79c65c90744 -r 0e9424413ab0 get_length_and_gc_content.r
--- a/get_length_and_gc_content.r Sun Feb 28 11:52:10 2016 -0500
+++ b/get_length_and_gc_content.r Thu Mar 03 09:56:51 2016 -0500
[
@@ -1,16 +1,23 @@
 # originally by Devon Ryan, https://www.biostars.org/p/84467/
-sink(stdout(), type = "message")
+
+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(GenomicRanges)
-library(rtracklayer)
-library(Rsamtools)
-library(optparse)
-library(data.table)
+suppressPackageStartupMessages({
+    library("GenomicRanges")
+    library("rtracklayer")
+    library("Rsamtools")
+    library("optparse")
+    library("data.table")
+})
 
 option_list <- list(
     make_option(c("-g","--gtf"), type="character", help="Input GTF file with gene / exon information."),
     make_option(c("-f","--fasta"), type="character", default=FALSE, help="Fasta file that corresponds to the supplied GTF."),
-    make_option(c("-o","--output"), type="character", default=FALSE, help="Output file with gene name, length and GC content.")
+    make_option(c("-l","--length"), type="character", default=FALSE, help="Output file with gene name and length."),
+    make_option(c("-gc","--gc_content"), type="character", default=FALSE, help="Output file with gene name and GC content.")
   )
 
 parser <- OptionParser(usage = "%prog [options] file", option_list=option_list)
@@ -18,7 +25,8 @@
 
 GTFfile = args$gtf
 FASTAfile = args$fasta
-output_file = args$output
+length = args$length
+gc_content = args$gc_content
 
 #Load the annotation and reduce it
 GTF <- import.gff(GTFfile, format="gtf", genome=NA, feature.type="exon")
@@ -41,9 +49,11 @@
     c(width, nGCs/width)
 }
 output <- t(sapply(split(reducedGTF, elementMetadata(reducedGTF)$gene_id), calc_GC_length))
-output <- setDT(data.frame(output), keep.rownames = TRUE)[]
-colnames(output) <- c("#gene_id", "length", "GC")
+output <- data.frame(setDT(data.frame(output), keep.rownames = TRUE)[])
+
 
-write.table(output, file=output_file, row.names=FALSE, quote=FALSE, sep="\t")
+write.table(output[,c(1,2)], file=length, col.names=FALSE, row.names=FALSE, quote=FALSE, sep="\t")
+write.table(output[,c(1,3)], file=gc_content, col.names=FALSE, row.names=FALSE, quote=FALSE, sep="\t")
+
 
 sessionInfo()
\ No newline at end of file
b
diff -r b79c65c90744 -r 0e9424413ab0 get_length_and_gc_content.xml
--- a/get_length_and_gc_content.xml Sun Feb 28 11:52:10 2016 -0500
+++ b/get_length_and_gc_content.xml Thu Mar 03 09:56:51 2016 -0500
b
@@ -1,9 +1,10 @@
-<tool id="length_and_gc_content" name="gene length and gc content from gtf file" version="0.1.0">
-    <description />
-    <requirements>
-        <requirement type="package" version="3.2.1">R</requirement>
-        <requirement type="package" version="1.22.0">goseq</requirement>
-    </requirements>
+<tool id="length_and_gc_content" name="gene length and gc content" version="0.1.0">
+    <description>from GTF file</description>
+    <macros>
+        <import>go_macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <expand macro="stdio" />
     <command interpreter="Rscript">
         get_length_and_gc_content.r --gtf "$gtf"
         #if $fastaSource.genomeSource == "indexed":
@@ -11,10 +12,11 @@
         #else:
             --fasta "$fastaSource.fasta_history"
         #end if
-        --output "$output"
+        --length "$length"
+        --gc_content "$gc_content"
     </command>
     <inputs>
-        <param help="The GTF must match the FASTA file" label="GTF file for length and GC calculation" name="gtf" type="data" />
+        <param help="The GTF must match the FASTA file" label="GTF file for length and GC calculation" name="gtf" type="data" format="gtf" />
         <conditional name="fastaSource">
             <param help="choose history if you don't see the correct genome fasta" label="Select a reference fasta from your history or use a built-in fasta?" name="genomeSource" type="select">
                 <option value="indexed">Use a built-in fasta</option>
@@ -26,19 +28,40 @@
             </param>
         </when>
         <when value="history">
-            <param format="fasta" label="Select a fasta file, to serve as index reference" name="fasta_history" type="data" />
+            <param format="fasta" label="Select a fasta file that matches the supplied GTF file" name="fasta_history" type="data" />
         </when>
         </conditional>
     </inputs>
     <outputs>
-        <data format="tabular" label="length and gc content" name="output" />
+        <data format="tabular" label="gene length" name="length">
+            <!-- future: set this when 16.04 has been released
+            <actions>
+                <action name="column_names" type="metadata" default="gene,length" />
+            </actions>
+            -->
+        </data>
+        <data format="tabular" label="gene gc content" name="gc_content">
+            <!-- future: set this when 16.04 has been released
+             <actions>
+                <action name="column_names" type="metadata" default="gene,gc_content" />
+            </actions>
+            -->
+        </data>
     </outputs>
-    <tests></tests>
+    <tests>
+        <test>
+            <param name="gtf" value="in.gtf" ftype="gtf"></param>
+            <param name="fastaSource|genomeSource" value="history"></param>
+            <param name="fastaSource|fasta_history" value="in.fasta" ftype="fasta"></param>
+            <output name="length" file="length.tab"></output>
+            <output name="gc_content" file="gc.tab"></output>
+        </test>
+    </tests>
     <help>
 
         **What it does**
 
-        Returns a tabular file with gene name, length and GC content, based on a supplied GTF and a FASTA file.
+        Returns a tabular file with gene id and length and a tabular file with gene id and GC content, based on a supplied GTF and a FASTA file.
 
 
         </help>
b
diff -r b79c65c90744 -r 0e9424413ab0 getgo.r
--- a/getgo.r Sun Feb 28 11:52:10 2016 -0500
+++ b/getgo.r Thu Mar 03 09:56:51 2016 -0500
[
@@ -1,7 +1,15 @@
-suppressWarnings(suppressMessages(library(goseq)))
-suppressWarnings(suppressMessages(library(optparse)))
-suppressWarnings(suppressMessages(library(rtracklayer)))
-suppressWarnings(suppressMessages(library(reshape2)))
+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")
+
+suppressPackageStartupMessages({
+    library("goseq")
+    library("optparse")
+    library("rtracklayer")
+    library("reshape2")
+})
+
 sink(stdout(), type = "message")
 
 option_list <- list(
@@ -15,21 +23,19 @@
 parser <- OptionParser(usage = "%prog [options] file", option_list=option_list)
 args = parse_args(parser)
 
-# Vars:
+# vars
 
 gtf = args$gtf
 genome = args$genome
 gene_id = args$gene_id
 output = args$output
 cats = unlist(strsplit(args$cats, ','))
+
+# retrieve and transform data
 genes = unique(import.gff(gtf)$gene_id)
-go_categories = getgo(genes, genome, id, fetch.cats=cats)
-
-# transform go category list to sth. more manipulatable in galaxy
-go_categories <- lapply(go_categories, unlist)
+go_categories = getgo(genes, genome, gene_id, fetch.cats=cats)
 go_categories = goseq:::reversemapping(go_categories)
 go_categories = melt(go_categories)
-colnames(go_categories) = c("#gene_id", "go_category")
 
-write.table(go_categories, output, sep="\t", row.names = FALSE, quote = FALSE)
+write.table(go_categories, output, sep="\t", col.names = FALSE, row.names = FALSE, quote = FALSE)
 sessionInfo()
\ No newline at end of file
b
diff -r b79c65c90744 -r 0e9424413ab0 getgo.xml
--- a/getgo.xml Sun Feb 28 11:52:10 2016 -0500
+++ b/getgo.xml Thu Mar 03 09:56:51 2016 -0500
b
@@ -1,9 +1,10 @@
-<tool id="getgo" name="Retrieve GO ontologies" version="0.1.0">
-    <description />
-    <requirements>
-        <requirement type="package" version="3.2.1">R</requirement>
-        <requirement type="package" version="1.22.0">goseq</requirement>
-    </requirements>
+<tool id="getgo" name="getgo" version="0.1.0">
+    <description>downloads gene ontologies for model organisms</description>
+    <macros>
+        <import>go_macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <expand macro="stdio" />
     <command interpreter="Rscript">
         getgo.r --genome "$genome"
         --gtf "$gtf"
@@ -29,15 +30,24 @@
     <outputs>
         <data format="tabular" label="GO category mapping" name="output" />
     </outputs>
-    <tests></tests>
+    <tests>
+        <test>
+            <param name="gtf" value="in.gtf" ftype="gtf"></param>
+            <param name="genome" value="hg38"></param>
+            <param name="gene_id" value="ensGene"></param>
+            <param name="cats" value="GO:CC,GO:BP,GO:MF"></param>
+            <output name="output" file="go_terms.tab"></output>
+        </test>
+    </tests>
     <help>
 
         **What it does**
 
-        Returns a tabular file with GO gene categories.
+        Returns a tabular file with GO gene categories for all genes present in the input GTF file.
 
 
         </help>
     <citations>
+        <citation type="doi">10.1186/gb-2010-11-2-r14</citation>
     </citations>
 </tool>
b
diff -r b79c65c90744 -r 0e9424413ab0 go_macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/go_macros.xml Thu Mar 03 09:56:51 2016 -0500
b
@@ -0,0 +1,24 @@
+<macros>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="3.2.1">R</requirement>
+            <requirement type="package" version="1.22.0">goseq</requirement>
+        </requirements>
+    </xml>
+    <xml name="stdio">
+        <stdio>
+            <regex match="Execution halted"
+                   source="both"
+                   level="fatal"
+                   description="Execution halted." />
+            <regex match="Error in"
+                   source="both"
+                   level="fatal"
+                   description="An undefined error occured, please check your input carefully and contact your administrator." />
+            <regex match="Fatal error"
+                   source="both"
+                   level="fatal"
+                   description="An undefined error occured, please check your input carefully and contact your administrator." />
+        </stdio>
+    </xml>
+</macros>
\ No newline at end of file
b
diff -r b79c65c90744 -r 0e9424413ab0 goseq.r
--- a/goseq.r Sun Feb 28 11:52:10 2016 -0500
+++ b/goseq.r Thu Mar 03 09:56:51 2016 -0500
[
@@ -1,6 +1,12 @@
-sink(stdout(), type = "message")
-suppressWarnings(suppressMessages(library(goseq)))
-suppressWarnings(suppressMessages(library(optparse)))
+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")
+
+suppressPackageStartupMessages({
+    library("goseq")
+    library("optparse")
+})
 
 option_list <- list(
     make_option(c("-d", "--dge_file"), type="character", help="Path to file with differential gene expression result"),
@@ -14,16 +20,20 @@
                 help="Genes with p.adjust below cutoff are considered not differentially expressed and serve as control genes"),
     make_option(c("-r", "--repcnt"), type="integer", default=100, help="Number of repeats for sampling"),
     make_option(c("-lf", "--length_file"), type="character", default="FALSE", help = "Path to tabular file mapping gene id to length"),
-    make_option(c("-g", "--genome"), type="character", help = "Genome [used for looking up correct gene length]"),
-    make_option(c("-i", "--gene_id"), type="character", help="Gene ID of gene column in DGE file"),
-    make_option(c("-cat", "--use_genes_without_cat"), default=FALSE, type="logical", help="A boolean to indicate whether genes without a categorie should still be used. For example, a large number of gene may have no GO term annotated.  If thisoption is set to FALSE, those genes will be ignored in the calculation of p-values(default behaviour).  If this option is set to TRUE, then these genes will count towards  the  total  number  of  genes  outside  the  category  being  tested  (default behaviour prior to version 1.15.2)."
-)
-  )
+    make_option(c("-cat_file", "--category_file"), default="FALSE", type="character", help = "Path to tabular file with gene_id <-> category mapping."),
+    make_option(c("-g", "--genome"), default=NULL, type="character", help = "Genome [used for looking up correct gene length]"),
+    make_option(c("-i", "--gene_id"), default=NULL, type="character", help = "Gene ID format of genes in DGE file"),
+    make_option(c("-cat", "--use_genes_without_cat"), default=FALSE, type="logical",
+                help="A large number of gene may have no GO term annotated. If this option is set to FALSE, genes without category will be ignored in the calculation of p-values(default behaviour). If TRUE these genes will count towards the total number of genes outside the tested category (default behaviour prior to version 1.15.2)."),
+    make_option(c("-plots", "--make_plots"), default=FALSE, type="logical", help="produce diagnostic plots?")
+    )
+
 parser <- OptionParser(usage = "%prog [options] file", option_list=option_list)
 args = parse_args(parser)
 
 # Vars:
 dge_file = args$dge_file
+category_file = args$category_file
 p_adj_column = args$p_adj_colum
 p_adj_cutoff = args$p_adj_cutoff
 length_file = args$length_file
@@ -36,45 +46,72 @@
 sample_vs_wallenius_plot = args$sample_vs_wallenius_plot
 repcnt = args$repcnt
 use_genes_without_cat = args$use_genes_without_cat
+make_plots = args$make_plots
 
-# format DE genes into vector suitable for use with goseq
-dge_table = read.delim(dge_file, header = TRUE, sep="\t", check.names = FALSE)
+# format DE genes into named vector suitable for goseq
+first_line = read.delim(dge_file, header = FALSE, nrow=1)
+# check if header [character where numeric is expected]
+if (is.numeric(first_line[,p_adj_column])) {
+  dge_table = read.delim(dge_file, header = FALSE, sep="\t")
+  } else {
+  dge_table = read.delim(dge_file, header = TRUE, sep="\t")
+  }
+
 genes = as.integer(dge_table[,p_adj_column]<p_adj_cutoff)
 names(genes) = dge_table[,1] # Assuming first row contains gene names
 
-# Get gene lengths
+# gene lengths, assuming last column
 if (length_file != "FALSE" ) {
-  length_table = read.delim(length_file, header=TRUE, sep="\t", check.names=FALSE)
+  first_line = read.delim(dge_file, header = FALSE, nrow=1)
+  if (is.numeric(first_line[, ncol(first_line)])) {
+    length_table = read.delim(length_file, header=FALSE, sep="\t", check.names=FALSE)
+    } else {
+    length_table = read.delim(length_file, header=TRUE, sep="\t", check.names=FALSE)
+    }
   row.names(length_table) = length_table[,1]
-  gene_lengths = length_table[names(genes),]$length
+  gene_lengths = length_table[names(genes),][,ncol(length_table)]
   } else {
   gene_lengths = getlength(names(genes), genome, gene_id)
   }
 
 # Estimate PWF
 
-pdf(length_bias_plot)
-pwf=nullp(genes, genome, gene_id, gene_lengths)
-message = dev.off()
+if (make_plots == TRUE) {
+  pdf(length_bias_plot)
+}
+pwf=nullp(genes, genome = genome, id = gene_id, bias.data = gene_lengths, plot.fit=make_plots)
+graphics.off()
 
-# Fetch GO annotations:
-go_map=getgo(names(genes), genome, gene_id, fetch.cats=c("GO:CC", "GO:BP", "GO:MF", "KEGG"))
+# Fetch GO annotations if category_file hasn't been supplied:
+if (category_file == "FALSE") {
+  go_map=getgo(genes = names(genes), genome = genome, id = gene_id, fetch.cats=c("GO:CC", "GO:BP", "GO:MF", "KEGG"))
+  } else {
+  # check for header: first entry in first column must be present in genes, else it's a header
+  first_line = read.delim(category_file, header = FALSE, nrow=1)
+  if (first_line[,1] %in% names(genes)) {
+     go_map = read.delim(category_file, header = FALSE)
+     } else {
+     go_map = read.delim(category_file, header= TRUE)
+    }
+}
 
 # wallenius approximation of p-values
-GO.wall=goseq(pwf, genome, gene_id, use_genes_without_cat = use_genes_without_cat, gene2cat=go_map)
+GO.wall=goseq(pwf, genome = genome, id = gene_id, use_genes_without_cat = use_genes_without_cat, gene2cat=go_map)
 
-GO.nobias=goseq(pwf, genome, gene_id, method="Hypergeometric", use_genes_without_cat = use_genes_without_cat, gene2cat=go_map)
+GO.nobias=goseq(pwf, genome = genome, id = gene_id, method="Hypergeometric", use_genes_without_cat = use_genes_without_cat, gene2cat=go_map)
 
 # Sampling distribution
 if (repcnt > 0) {
-  GO.samp=goseq(pwf,genome, gene_id, method="Sampling", repcnt=repcnt, use_genes_without_cat = use_genes_without_cat, gene2cat=go_map)
+  GO.samp=goseq(pwf, genome = genome, id = gene_id, method="Sampling", repcnt=repcnt, use_genes_without_cat = use_genes_without_cat, gene2cat=go_map)
   # Compare sampling with wallenius
+  if (make_plots == TRUE) {
   pdf(sample_vs_wallenius_plot)
   plot(log10(GO.wall[,2]), log10(GO.samp[match(GO.samp[,1],GO.wall[,1]),2]),
      xlab="log10(Wallenius p-values)",ylab="log10(Sampling p-values)",
      xlim=c(-3,0))
      abline(0,1,col=3,lty=2)
-  message = dev.off()
+  graphics.off()
+  }
   write.table(GO.samp, sampling_tab, sep="\t", row.names = FALSE, quote = FALSE)
 }
 
b
diff -r b79c65c90744 -r 0e9424413ab0 goseq.xml
--- a/goseq.xml Sun Feb 28 11:52:10 2016 -0500
+++ b/goseq.xml Thu Mar 03 09:56:51 2016 -0500
b
@@ -1,18 +1,16 @@
-<tool id="goseq" name="goseq gene ontology analyser" version="0.1.5">
-    <description />
-    <requirements>
-        <requirement type="package" version="3.2.1">R</requirement>
-        <requirement type="package" version="1.22.0">goseq</requirement>
-    </requirements>
+<tool id="goseq" name="goseq" version="0.2.0">
+    <description>tests for overrepresented gene categories</description>
+    <macros>
+        <import>go_macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <expand macro="stdio" />
     <command interpreter="Rscript">
         goseq.r --dge_file "$dge_file"
         --p_adj_column "$p_adj_column"
         --cutoff "$p_adj_cutoff"
-        #if $source.use_length_file == "yes":
         --length_file "$length_file"
-        #end if
-        --genome "$genome"
-        --gene_id "$gene_id"
+        --category_file "$category_file"
         --wallenius_tab "$wallenius_tab"
         --sampling_tab "$sampling_tab"
         --nobias_tab "$nobias_tab"
@@ -20,36 +18,26 @@
         --sample_vs_wallenius_plot "$sample_vs_wallenius_plot"
         --repcnt "$repcnt"
         --use_genes_without_cat "$use_genes_without_cat"
+        --make_plots "$make_plots"
     </command>
     <inputs>
         <param help="deseq2/edger/limma differential gene expression list" label="DGE list" name="dge_file" type="data" format="tabular" />
         <param help="Select the column that contains the multiple-testing corrected p-value" label="p adjust column" name="p_adj_column" type="data_column" numeric="true" data_ref="dge_file"/>
-        <param help="A boolean to indicate whether genes without a categorie should still be used. For example, a large number of gene may have no GO term annotated.  If this option is set to FALSE, those genes will be ignored in the calculation of p-values. If this option is set to TRUE, then these genes will count towards the total number of genes outside the category being tested"
-               name="use_genes_without_cat" label="Count genes without any category" type="boolean"/>
+        <param label="Gene length file for length bias correction" help="You can calculate the gene length using the get length and gc content tool" name="length_file" type="data" format="tabular" required="true" />
+        <param label="Gene category file" help="You can obtain a mapping of gene id to gene ontology using the getgo tool" name="category_file" type="data" format="tabular" required="true" />
+        <param help="For example, a large number of gene may have no GO term annotated. If this option is set to FALSE, those genes will be ignored in the calculation of p-values. If this option is set to TRUE, then these genes will count towards the total number of genes outside the category being tested"
+               name="use_genes_without_cat" label="Count genes without any category?" type="boolean"/>
         <param help="Typically 0.05 after multiple testing correction" max="1" label="Minimum p adjust value to consider genes as differentially expressed" name="p_adj_cutoff" type="float" value="0.05" />
-        <conditional name="source">
-            <param help="This is needed if the gene length is not available in goseq. e.g. hg38 and mm10." label="Use gene length file?" name="use_length_file" type="select">
-                <option value="no">no</option>
-                <option value="yes">yes</option>
-            </param>
-            <when value="yes">
-                <param label="Gene length file" name="length_file" type="data" format="tabular" required="false" />
-            </when>
-            <when value="no">
-            </when>
-        </conditional>
-        <param help="Needed to retrieve gene length for length correction" label="Select the genome source" name="genome" size="3" type="select">
-            <options from_data_table="go_genomes"></options>
-        </param>
-        <param help="Needed for GO analysis" label="Select gene identifier" name="gene_id" type="select">
-            <options from_data_table="go_gene_ids"></options>
-        </param>
+        <param help="These plots may help you compare the different p-value estimation methods that goseq can use." label="Produce diagnostic plots?" name="make_plots" type="boolean"></param>
         <param help="Draw this many random control gene sets. Set to 0 to not do sampling. Larger values take a long time" label="sampling depth" name="repcnt" size="3" type="integer" min="0" max="10000" value="0" />
     </inputs>
     <outputs>
-        <data format="pdf" label="length bias plot" name="length_bias_plot" />
+        <data format="pdf" label="length bias plot" name="length_bias_plot">
+            <filter>make_plots</filter>
+        </data>
         <data format="pdf" label="Plot P-value from sampling against wallenius distribution" name="sample_vs_wallenius_plot">
             <filter>repcnt != 0</filter>
+            <filter>make_plots</filter>
         </data>
         <data format="tabular" label="Ranked category list - no length bias correction" name="nobias_tab" />
         <data format="tabular" label="Ranked category list - sampling" name="sampling_tab">
@@ -60,21 +48,32 @@
     <tests>
         <test>
             <param name="dge_file" value="dge_list.tab" ftype="tabular"/>
-            <param name="use_length_file" value="no" />
+            <param name="length_file" value="gene_length.tab" ftype="tabular"/>
+            <param name="category_file" value="category.tab" ftype="tabular"/>
+            <param name="use_genes_without_cat" value="true" />
             <param name="p_adj_column" value="2" />
-            <param name="genome" value="hg19" />
-            <param name="gene_id" value="ensGene" />
-            <output name="wallenius_tab" file="wall.tab" compare="contains"/>/>
+            <output name="wallenius_tab" file="wal.tab" compare="contains"/>/>
         </test>
     </tests>
     <help>
 
         **What it does**
 
-        Detects Gene Ontology and/or other user defined categories which are over/under represented in RNA-seq data.
+        Detects Gene Ontology and/or other user defined categories which are over/under-represented in RNA-seq data.
 
         Options map closely to the excellent manual_
 
+
+        **Input files**
+
+        goseq needs information about the length of a gene to correct for potential length bias in differentially expressed genes.
+        The format of this file is tabular, with gene_id in the first column and length in the second column.
+        The "get length and gc content" tool can produce such a file.
+
+        You will also need a file describing the membership of genes in categories. The format of this file is gene_id in the first column,
+        category name in the second column. If you are interested in gene ontology categories you can use the getgo file to retrive
+        gene ontologies for model organisms, or you can construct your own file.
+
         .. _manual: https://bioconductor.org/packages/release/bioc/vignettes/goseq/inst/doc/goseq.pdf
 
 
b
diff -r b79c65c90744 -r 0e9424413ab0 test-data/category.tab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/category.tab Thu Mar 03 09:56:51 2016 -0500
b
@@ -0,0 +1,6 @@
+ENSG00000162526 GO:0000003
+ENSG00000198648 GO:0000278
+ENSG00000112312 GO:0000278
+ENSG00000174442 GO:0000278
+ENSG00000108953 GO:0000278
+ENSG00000167842 GO:0000278
b
diff -r b79c65c90744 -r 0e9424413ab0 test-data/dge_list.tab
--- a/test-data/dge_list.tab Sun Feb 28 11:52:10 2016 -0500
+++ b/test-data/dge_list.tab Thu Mar 03 09:56:51 2016 -0500
b
@@ -1,4 +1,3 @@
-Name adj.p.value
 ENSG00000140459 0.72654265501997
 ENSG00000236824 0.621241793648661
 ENSG00000162526 0.104072112354657
b
diff -r b79c65c90744 -r 0e9424413ab0 test-data/gc.tab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/gc.tab Thu Mar 03 09:56:51 2016 -0500
b
@@ -0,0 +1,1 @@
+ENSG00000162526 0.388349514563107
b
diff -r b79c65c90744 -r 0e9424413ab0 test-data/gene_length.tab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/gene_length.tab Thu Mar 03 09:56:51 2016 -0500
b
b'@@ -0,0 +1,948 @@\n+ENSG00000003096\t6983\n+ENSG00000004534\t7302\n+ENSG00000006327\t1848\n+ENSG00000006831\t5878\n+ENSG00000006837\t3057\n+ENSG00000007392\t6176\n+ENSG00000008735\t5901\n+ENSG00000009844\t7262\n+ENSG00000010322\t9161\n+ENSG00000010932\t3602\n+ENSG00000011638\t2558\n+ENSG00000012983\t7620\n+ENSG00000013275\t2387\n+ENSG00000014216\t7553\n+ENSG00000018408\t8413\n+ENSG00000018607\t1774\n+ENSG00000018699\t3185\n+ENSG00000022556\t6313\n+ENSG00000023041\t3748\n+ENSG00000023330\t2536\n+ENSG00000023697\t2844\n+ENSG00000023892\t2545\n+ENSG00000027697\t2571\n+ENSG00000029363\t9297\n+ENSG00000032389\t5775\n+ENSG00000033050\t4448\n+ENSG00000035403\t9992\n+ENSG00000042445\t4005\n+ENSG00000049541\t2211\n+ENSG00000057608\t4033\n+ENSG00000057935\t10580\n+ENSG00000059122\t8419\n+ENSG00000059588\t7743\n+ENSG00000063015\t5115\n+ENSG00000063322\t3835\n+ENSG00000064545\t3281\n+ENSG00000065000\t8601\n+ENSG00000065060\t9908\n+ENSG00000066739\t14778\n+ENSG00000066923\t8583\n+ENSG00000068028\t3683\n+ENSG00000068650\t13733\n+ENSG00000069712\t4556\n+ENSG00000070495\t5969\n+ENSG00000070610\t4803\n+ENSG00000070961\t9493\n+ENSG00000071889\t5098\n+ENSG00000072071\t8487\n+ENSG00000072121\t15706\n+ENSG00000072134\t8517\n+ENSG00000072864\t5525\n+ENSG00000072958\t14371\n+ENSG00000073614\t12106\n+ENSG00000074054\t11052\n+ENSG00000074071\t1097\n+ENSG00000074211\t9198\n+ENSG00000074319\t3839\n+ENSG00000074621\t9084\n+ENSG00000075399\t3428\n+ENSG00000076356\t13781\n+ENSG00000079215\t6265\n+ENSG00000079246\t5463\n+ENSG00000079785\t3833\n+ENSG00000079974\t5870\n+ENSG00000080603\t13674\n+ENSG00000080815\t9947\n+ENSG00000081087\t5325\n+ENSG00000082068\t7039\n+ENSG00000083535\t4253\n+ENSG00000083544\t6814\n+ENSG00000083720\t4194\n+ENSG00000084073\t3572\n+ENSG00000085365\t5106\n+ENSG00000085377\t3762\n+ENSG00000085982\t9352\n+ENSG00000085999\t3212\n+ENSG00000086205\t3824\n+ENSG00000086289\t2864\n+ENSG00000087586\t2928\n+ENSG00000088340\t9067\n+ENSG00000088448\t4563\n+ENSG00000089009\t4447\n+ENSG00000090020\t5974\n+ENSG00000090273\t2856\n+ENSG00000090402\t6138\n+ENSG00000091140\t5299\n+ENSG00000092068\t5991\n+ENSG00000092098\t4982\n+ENSG00000092208\t2532\n+ENSG00000092445\t10945\n+ENSG00000099139\t12705\n+ENSG00000099910\t4646\n+ENSG00000100014\t7324\n+ENSG00000100027\t4713\n+ENSG00000100038\t6641\n+ENSG00000100106\t12238\n+ENSG00000100191\t2030\n+ENSG00000100292\t2405\n+ENSG00000100336\t4377\n+ENSG00000100354\t19998\n+ENSG00000100441\t8015\n+ENSG00000100478\t7223\n+ENSG00000100526\t1836\n+ENSG00000100577\t8477\n+ENSG00000100852\t10888\n+ENSG00000101247\t7217\n+ENSG00000101294\t10000\n+ENSG00000101473\t4213\n+ENSG00000102030\t4742\n+ENSG00000102349\t9022\n+ENSG00000102606\t11768\n+ENSG00000102804\t8586\n+ENSG00000102901\t5539\n+ENSG00000103035\t2740\n+ENSG00000103121\t12781\n+ENSG00000103932\t7046\n+ENSG00000104325\t3507\n+ENSG00000104331\t7594\n+ENSG00000104368\t6618\n+ENSG00000104450\t5055\n+ENSG00000105173\t2550\n+ENSG00000105220\t9112\n+ENSG00000105223\t5184\n+ENSG00000105325\t5802\n+ENSG00000105355\t2813\n+ENSG00000105438\t2251\n+ENSG00000105519\t4428\n+ENSG00000105568\t7437\n+ENSG00000105879\t5481\n+ENSG00000106012\t9240\n+ENSG00000106305\t1838\n+ENSG00000106683\t6902\n+ENSG00000106771\t9484\n+ENSG00000106789\t5717\n+ENSG00000106803\t1190\n+ENSG00000106868\t4183\n+ENSG00000106948\t10601\n+ENSG00000107295\t2682\n+ENSG00000107833\t928\n+ENSG00000108055\t4275\n+ENSG00000108091\t7345\n+ENSG00000108306\t11038\n+ENSG00000108591\t7411\n+ENSG00000108666\t5740\n+ENSG00000108848\t8151\n+ENSG00000108947\t3222\n+ENSG00000108953\t3847\n+ENSG00000108960\t3177\n+ENSG00000109079\t3889\n+ENSG00000109171\t6524\n+ENSG00000109610\t2128\n+ENSG00000109680\t3434\n+ENSG00000109771\t7360\n+ENSG00000109787\t6297\n+ENSG00000109920\t7596\n+ENSG00000109929\t5566\n+ENSG00000110002\t6403\n+ENSG00000110092\t4830\n+ENSG00000110906\t9865\n+ENSG00000111247\t2558\n+ENSG00000111249\t7648\n+ENSG00000111331\t8251\n+ENSG00000111652\t3113\n+ENSG00000111707\t5731\n+ENSG00000111860\t9462\n+ENSG00000111877\t12496\n+ENSG00000112062\t6860\n+ENSG00000112306\t767\n+ENSG00000112312\t2476\n+ENSG00000112365\t5519\n+ENSG00000112406\t5614\n+ENSG00000112531\t17368\n+ENSG00000112874\t4304\n+ENSG00000113048\t6511\n+ENSG00000113328\t3096\n+ENSG00000113621\t5265\n+ENSG00000113649\t8714\n+ENSG00000113812\t4066\n+ENSG00000113916\t5938\n+ENSG00000114026\t8733\n+E'..b'213148\t464\n+ENSG00000213174\t414\n+ENSG00000213197\t694\n+ENSG00000213318\t783\n+ENSG00000213339\t3430\n+ENSG00000213493\t1451\n+ENSG00000213588\t3014\n+ENSG00000213711\t814\n+ENSG00000213742\t5308\n+ENSG00000213760\t2147\n+ENSG00000213793\t551\n+ENSG00000213864\t676\n+ENSG00000213880\t797\n+ENSG00000213904\t4208\n+ENSG00000213906\t3233\n+ENSG00000213917\t815\n+ENSG00000213971\t5091\n+ENSG00000214029\t15455\n+ENSG00000214174\t3858\n+ENSG00000214389\t784\n+ENSG00000214617\t4479\n+ENSG00000214694\t5490\n+ENSG00000214810\t311\n+ENSG00000214961\t1372\n+ENSG00000214975\t499\n+ENSG00000215286\t754\n+ENSG00000215333\t1283\n+ENSG00000216854\t553\n+ENSG00000216915\t1495\n+ENSG00000217716\t494\n+ENSG00000217801\t2171\n+ENSG00000218965\t609\n+ENSG00000219553\t723\n+ENSG00000220131\t354\n+ENSG00000220157\t961\n+ENSG00000220483\t871\n+ENSG00000221843\t6199\n+ENSG00000221909\t2717\n+ENSG00000222046\t1869\n+ENSG00000223382\t1326\n+ENSG00000223620\t1102\n+ENSG00000223877\t622\n+ENSG00000224016\t291\n+ENSG00000224520\t1447\n+ENSG00000224578\t1377\n+ENSG00000224628\t1519\n+ENSG00000224664\t316\n+ENSG00000224892\t997\n+ENSG00000225405\t390\n+ENSG00000225544\t392\n+ENSG00000225787\t306\n+ENSG00000225806\t1521\n+ENSG00000226067\t2075\n+ENSG00000226086\t822\n+ENSG00000226114\t361\n+ENSG00000226144\t454\n+ENSG00000226232\t1728\n+ENSG00000226268\t959\n+ENSG00000226478\t1126\n+ENSG00000226703\t812\n+ENSG00000226752\t7181\n+ENSG00000226790\t1139\n+ENSG00000226833\t1438\n+ENSG00000227006\t861\n+ENSG00000227057\t3115\n+ENSG00000227343\t600\n+ENSG00000227376\t552\n+ENSG00000227401\t284\n+ENSG00000227543\t3835\n+ENSG00000227666\t316\n+ENSG00000227742\t946\n+ENSG00000227968\t999\n+ENSG00000228118\t459\n+ENSG00000228195\t881\n+ENSG00000228236\t315\n+ENSG00000228599\t742\n+ENSG00000228612\t2737\n+ENSG00000228981\t843\n+ENSG00000229044\t439\n+ENSG00000229344\t682\n+ENSG00000229503\t477\n+ENSG00000229956\t6794\n+ENSG00000230006\t8042\n+ENSG00000230022\t634\n+ENSG00000230074\t665\n+ENSG00000230118\t258\n+ENSG00000230146\t1176\n+ENSG00000230243\t319\n+ENSG00000230295\t351\n+ENSG00000230406\t421\n+ENSG00000230531\t1798\n+ENSG00000230551\t8636\n+ENSG00000230650\t3130\n+ENSG00000230667\t909\n+ENSG00000230863\t742\n+ENSG00000230869\t2418\n+ENSG00000230913\t744\n+ENSG00000231096\t390\n+ENSG00000231181\t559\n+ENSG00000231245\t402\n+ENSG00000231434\t2167\n+ENSG00000231615\t1337\n+ENSG00000231711\t4947\n+ENSG00000231955\t1411\n+ENSG00000232186\t1228\n+ENSG00000232581\t357\n+ENSG00000232676\t1124\n+ENSG00000232699\t736\n+ENSG00000232905\t946\n+ENSG00000232943\t400\n+ENSG00000233122\t2436\n+ENSG00000233454\t275\n+ENSG00000233503\t1501\n+ENSG00000233602\t619\n+ENSG00000233836\t3242\n+ENSG00000233846\t487\n+ENSG00000234231\t2095\n+ENSG00000234639\t1239\n+ENSG00000234722\t3487\n+ENSG00000234742\t555\n+ENSG00000234981\t792\n+ENSG00000235065\t475\n+ENSG00000235363\t225\n+ENSG00000235424\t288\n+ENSG00000235444\t618\n+ENSG00000235512\t292\n+ENSG00000235623\t574\n+ENSG00000235655\t411\n+ENSG00000235698\t1200\n+ENSG00000235750\t4783\n+ENSG00000235847\t965\n+ENSG00000235859\t1234\n+ENSG00000235892\t1677\n+ENSG00000236086\t262\n+ENSG00000236285\t837\n+ENSG00000236290\t703\n+ENSG00000236330\t886\n+ENSG00000236468\t1335\n+ENSG00000236570\t1227\n+ENSG00000236680\t1238\n+ENSG00000236681\t523\n+ENSG00000236735\t375\n+ENSG00000236739\t535\n+ENSG00000236753\t2715\n+ENSG00000236801\t474\n+ENSG00000236824\t13458\n+ENSG00000236946\t1087\n+ENSG00000237017\t4158\n+ENSG00000237033\t609\n+ENSG00000237054\t3194\n+ENSG00000237101\t1323\n+ENSG00000237357\t2579\n+ENSG00000237517\t7448\n+ENSG00000237939\t652\n+ENSG00000237977\t563\n+ENSG00000238221\t500\n+ENSG00000238251\t514\n+ENSG00000239377\t420\n+ENSG00000239524\t400\n+ENSG00000239569\t736\n+ENSG00000239791\t1918\n+ENSG00000239887\t4495\n+ENSG00000239926\t747\n+ENSG00000240005\t589\n+ENSG00000240392\t575\n+ENSG00000240418\t893\n+ENSG00000240540\t1183\n+ENSG00000240821\t579\n+ENSG00000241258\t3540\n+ENSG00000241370\t1606\n+ENSG00000241494\t438\n+ENSG00000241680\t375\n+ENSG00000241697\t2611\n+ENSG00000241772\t1051\n+ENSG00000241923\t622\n+ENSG00000242061\t438\n+ENSG00000242140\t231\n+ENSG00000242349\t1427\n+ENSG00000242600\t2616\n+ENSG00000242612\t4046\n+ENSG00000242858\t602\n+ENSG00000243122\t413\n+ENSG00000243396\t402\n+ENSG00000243701\t4206\n+ENSG00000243779\t321\n+ENSG00000244171\t1291\n+ENSG00000244270\t403\n'
b
diff -r b79c65c90744 -r 0e9424413ab0 test-data/go_terms.tab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/go_terms.tab Thu Mar 03 09:56:51 2016 -0500
b
@@ -0,0 +1,85 @@
+ENSG00000162526 GO:0000003
+ENSG00000162526 GO:0000166
+ENSG00000162526 GO:0000287
+ENSG00000162526 GO:0001882
+ENSG00000162526 GO:0001883
+ENSG00000162526 GO:0003674
+ENSG00000162526 GO:0003824
+ENSG00000162526 GO:0004672
+ENSG00000162526 GO:0004674
+ENSG00000162526 GO:0005488
+ENSG00000162526 GO:0005515
+ENSG00000162526 GO:0005524
+ENSG00000162526 GO:0005575
+ENSG00000162526 GO:0005622
+ENSG00000162526 GO:0005623
+ENSG00000162526 GO:0005737
+ENSG00000162526 GO:0006464
+ENSG00000162526 GO:0006468
+ENSG00000162526 GO:0006793
+ENSG00000162526 GO:0006796
+ENSG00000162526 GO:0007154
+ENSG00000162526 GO:0007165
+ENSG00000162526 GO:0007275
+ENSG00000162526 GO:0007276
+ENSG00000162526 GO:0007283
+ENSG00000162526 GO:0008150
+ENSG00000162526 GO:0008152
+ENSG00000162526 GO:0009987
+ENSG00000162526 GO:0016301
+ENSG00000162526 GO:0016310
+ENSG00000162526 GO:0016740
+ENSG00000162526 GO:0016772
+ENSG00000162526 GO:0016773
+ENSG00000162526 GO:0017076
+ENSG00000162526 GO:0019538
+ENSG00000162526 GO:0019953
+ENSG00000162526 GO:0022414
+ENSG00000162526 GO:0023052
+ENSG00000162526 GO:0030154
+ENSG00000162526 GO:0030554
+ENSG00000162526 GO:0032501
+ENSG00000162526 GO:0032502
+ENSG00000162526 GO:0032504
+ENSG00000162526 GO:0032549
+ENSG00000162526 GO:0032550
+ENSG00000162526 GO:0032553
+ENSG00000162526 GO:0032555
+ENSG00000162526 GO:0032559
+ENSG00000162526 GO:0035556
+ENSG00000162526 GO:0035639
+ENSG00000162526 GO:0036094
+ENSG00000162526 GO:0036211
+ENSG00000162526 GO:0043167
+ENSG00000162526 GO:0043168
+ENSG00000162526 GO:0043169
+ENSG00000162526 GO:0043170
+ENSG00000162526 GO:0043412
+ENSG00000162526 GO:0044237
+ENSG00000162526 GO:0044238
+ENSG00000162526 GO:0044260
+ENSG00000162526 GO:0044267
+ENSG00000162526 GO:0044424
+ENSG00000162526 GO:0044464
+ENSG00000162526 GO:0044699
+ENSG00000162526 GO:0044700
+ENSG00000162526 GO:0044702
+ENSG00000162526 GO:0044703
+ENSG00000162526 GO:0044707
+ENSG00000162526 GO:0044763
+ENSG00000162526 GO:0044767
+ENSG00000162526 GO:0046872
+ENSG00000162526 GO:0048232
+ENSG00000162526 GO:0048609
+ENSG00000162526 GO:0048869
+ENSG00000162526 GO:0050789
+ENSG00000162526 GO:0050794
+ENSG00000162526 GO:0050896
+ENSG00000162526 GO:0051704
+ENSG00000162526 GO:0051716
+ENSG00000162526 GO:0065007
+ENSG00000162526 GO:0071704
+ENSG00000162526 GO:0097159
+ENSG00000162526 GO:0097367
+ENSG00000162526 GO:1901265
+ENSG00000162526 GO:1901363
b
diff -r b79c65c90744 -r 0e9424413ab0 test-data/in.fasta
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/in.fasta Thu Mar 03 09:56:51 2016 -0500
b
@@ -0,0 +1,2 @@
+>1
+AAAAAAAAAATTTTTTTTTTCCCCCCCCCCGGGGGGGGGGAAAAAAAAAAAAAAAAAAAATTTTTTTTTTCCCCCCCCCCGGGGGGGGGGAAAAAAAAAATTTTT
\ No newline at end of file
b
diff -r b79c65c90744 -r 0e9424413ab0 test-data/in.gtf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/in.gtf Thu Mar 03 09:56:51 2016 -0500
b
@@ -0,0 +1,6 @@
+1 ensembl_havana gene 1 103 . + . gene_id "ENSG00000162526"; gene_version "4"; gene_name "OR4F5"; gene_source "ensembl_havana"; gene_biotype "protein_coding"; havana_gene "OTTHUMG00000001094"; havana_gene_version "1";
+1 ensembl_havana transcript 1 103 . + . gene_id "ENSG00000162526"; gene_version "4"; transcript_id "ENST00000335137"; transcript_version "3"; gene_name "OR4F5"; gene_source "ensembl_havana"; gene_biotype "protein_coding"; havana_gene "OTTHUMG00000001094"; havana_gene_version "1"; transcript_name "OR4F5-001"; transcript_source "ensembl_havana"; transcript_biotype "protein_coding"; tag "CCDS"; ccds_id "CCDS30547"; havana_transcript "OTTHUMT00000003223"; havana_transcript_version "1"; tag "basic"; transcript_support_level "NA";
+1 ensembl_havana exon 1 103 . + . gene_id "ENSG00000162526"; gene_version "4"; transcript_id "ENST00000335137"; transcript_version "3"; exon_number "1"; gene_name "OR4F5"; gene_source "ensembl_havana"; gene_biotype "protein_coding"; havana_gene "OTTHUMG00000001094"; havana_gene_version "1"; transcript_name "OR4F5-001"; transcript_source "ensembl_havana"; transcript_biotype "protein_coding"; tag "CCDS"; ccds_id "CCDS30547"; havana_transcript "OTTHUMT00000003223"; havana_transcript_version "1"; exon_id "ENSE00002319515"; exon_version "1"; tag "basic"; transcript_support_level "NA";
+1 ensembl_havana CDS 1 100 . + 0 gene_id "ENSG00000162526"; gene_version "4"; transcript_id "ENST00000335137"; transcript_version "3"; exon_number "1"; gene_name "OR4F5"; gene_source "ensembl_havana"; gene_biotype "protein_coding"; havana_gene "OTTHUMG00000001094"; havana_gene_version "1"; transcript_name "OR4F5-001"; transcript_source "ensembl_havana"; transcript_biotype "protein_coding"; tag "CCDS"; ccds_id "CCDS30547"; havana_transcript "OTTHUMT00000003223"; havana_transcript_version "1"; protein_id "ENSP00000334393"; protein_version "3"; tag "basic"; transcript_support_level "NA";
+1 ensembl_havana start_codon 1 3 . + 0 gene_id "ENSG00000162526"; gene_version "4"; transcript_id "ENST00000335137"; transcript_version "3"; exon_number "1"; gene_name "OR4F5"; gene_source "ensembl_havana"; gene_biotype "protein_coding"; havana_gene "OTTHUMG00000001094"; havana_gene_version "1"; transcript_name "OR4F5-001"; transcript_source "ensembl_havana"; transcript_biotype "protein_coding"; tag "CCDS"; ccds_id "CCDS30547"; havana_transcript "OTTHUMT00000003223"; havana_transcript_version "1"; tag "basic"; transcript_support_level "NA";
+1 ensembl_havana stop_codon 101 103 . + 0 gene_id "ENSG00000162526"; gene_version "4"; transcript_id "ENST00000335137"; transcript_version "3"; exon_number "1"; gene_name "OR4F5"; gene_source "ensembl_havana"; gene_biotype "protein_coding"; havana_gene "OTTHUMG00000001094"; havana_gene_version "1"; transcript_name "OR4F5-001"; transcript_source "ensembl_havana"; transcript_biotype "protein_coding"; tag "CCDS"; ccds_id "CCDS30547"; havana_transcript "OTTHUMT00000003223"; havana_transcript_version "1"; tag "basic"; transcript_support_level "NA";
b
diff -r b79c65c90744 -r 0e9424413ab0 test-data/length.tab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/length.tab Thu Mar 03 09:56:51 2016 -0500
b
@@ -0,0 +1,1 @@
+ENSG00000162526 103
b
diff -r b79c65c90744 -r 0e9424413ab0 test-data/wal.tab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/wal.tab Thu Mar 03 09:56:51 2016 -0500
b
@@ -0,0 +1,3 @@
+category over_represented_pvalue under_represented_pvalue numDEInCat numInCat term ontology
+GO:0000278 0.01123506125343 0.999376653834006 4 5 mitotic cell cycle BP
+GO:0000003 1 0.805913166914891 0 1 reproduction BP