annotate fisher_test.xml @ 0:c3facdc53ddc draft default tip

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
author artbio
date Wed, 17 Mar 2021 22:07:17 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
1 <tool id="fishertest" name="Fisher's exact test" version="2.22.0+galaxy0">
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
2 <description>on two gene hit lists</description>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
3 <requirements>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
4 <requirement type="package" version="2.22.0">bioconductor-qvalue</requirement>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
5 </requirements>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
6 <command><![CDATA[
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
7 Rscript '$fisher_test' "\${GALAXY_SLOTS:-1}"
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
8 ]]></command>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
9 <configfiles>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
10 <configfile name="fisher_test">
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
11 <![CDATA[
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
12 ## Setup R error handling to go to stderr
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
13 options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
14 options(warn=-1)
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
15 suppressMessages(library(qvalue))
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
16 library(parallel)
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
17 args = commandArgs(trailingOnly = TRUE)
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
18 slots = as.numeric(args[1])
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
19 countsTable = read.delim("${input}", header=TRUE, check.names=FALSE, stringsAsFactor = TRUE)
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
20 depth1 = sum(countsTable[,2])
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
21 depth2 = sum(countsTable[,3])
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
22 float_table=data.frame(countsTable[,2], countsTable[,3])
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
23
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
24 calc_pvalue <- function(row, depth1, depth2, ... ){
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
25 thearray = array( c(row, (depth1 - row[1]), (depth2 - row[2])), dim=c(2,2))
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
26 current_test = fisher.test( thearray )
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
27 return(current_test\$p.value)
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
28 }
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
29
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
30 cl <- makePSOCKcluster(slots)
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
31 clusterExport(cl=cl, varlist=c("calc_pvalue", "depth1", "depth2"))
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
32 ptm <- proc.time()
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
33 p_val = parApply(cl, float_table, 1, function(x) calc_pvalue(x, depth1, depth2))
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
34 stopCluster(cl)
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
35 proc.time() - ptm
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
36 p_val[p_val>1]=1
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
37 p = qvalue(p_val)
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
38 finalTable = cbind(countsTable, data.frame(p\$pvalues), data.frame(p\$qvalues))
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
39 write.table ( finalTable, file = "${output}", row.names=FALSE, col.names=TRUE, quote= FALSE, dec = ".", sep = "\t", eol = "\n")
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
40 ]]>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
41 </configfile>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
42 </configfiles>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
43 <inputs>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
44 <param name="input" type="data" format="tabular" label="gene hit lists, 2 samples"/>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
45 </inputs>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
46 <outputs>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
47 <data name="output" format="tabular" label="Fisher test p-values" />
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
48 </outputs>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
49 <tests>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
50 <test>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
51 <param name="input" value="counts.tab" ftype="tabular"/>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
52 <output name="output" file="fisher.tab" ftype="tabular"/>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
53 </test>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
54 </tests>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
55 <help>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
56
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
57 **What it does**
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
58
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
59 Runs Fisher's exact test for testing the null of independence of rows and columns in a contingency table of two columns.
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
60
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
61 p.pvalues: the chance of getting this data if it is independent between columns (false negative); the p-value.
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
62
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
63 q.qvalues: FDR (Faslse Detection Rate) adjusted p-values; a q-value of 0.05 implies that 5% of significant tests will result in false positives.
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
64
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
65 Be aware that this test does not take into account the biological noise that would be visible if replicates were available.
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
66
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
67
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
68 </help>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
69 <citations>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
70 <citation type="doi">10.1111/1467-9868.00346</citation>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
71 </citations>
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
72
c3facdc53ddc "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
diff changeset
73 </tool>