Mercurial > repos > artbio > fishertest
annotate fisher_test.xml @ 2:8052d037517f draft
"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:08:40 +0000 |
parents | 3a67bee2ef63 |
children | 4b76708c6b95 |
rev | line source |
---|---|
2
8052d037517f
"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
1
diff
changeset
|
1 <tool id="fishertest" name="Fisher's exact test" version="2.22.0+galaxy0"> |
0
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
2 <description>on two gene hit lists</description> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
3 <requirements> |
2
8052d037517f
"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 9c5f0b8e89dfe4347c610f42923f0acad2ecc81b"
artbio
parents:
1
diff
changeset
|
4 <requirement type="package" version="2.22.0">bioconductor-qvalue</requirement> |
0
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
5 </requirements> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
6 <command><![CDATA[ |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
7 Rscript '$fisher_test' "\${GALAXY_SLOTS:-1}" |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
8 ]]></command> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
9 <configfiles> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
10 <configfile name="fisher_test"> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
11 <![CDATA[ |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
12 ## Setup R error handling to go to stderr |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
13 options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
14 options(warn=-1) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
15 suppressMessages(library(qvalue)) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
16 library(parallel) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
17 args = commandArgs(trailingOnly = TRUE) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
18 slots = as.numeric(args[1]) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
19 countsTable = read.delim("${input}", header=TRUE, check.names=FALSE, stringsAsFactor = TRUE) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
20 depth1 = sum(countsTable[,2]) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
21 depth2 = sum(countsTable[,3]) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
22 float_table=data.frame(countsTable[,2], countsTable[,3]) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
23 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
24 calc_pvalue <- function(row, depth1, depth2, ... ){ |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
25 thearray = array( c(row, (depth1 - row[1]), (depth2 - row[2])), dim=c(2,2)) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
26 current_test = fisher.test( thearray ) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
27 return(current_test\$p.value) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
28 } |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
29 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
30 cl <- makePSOCKcluster(slots) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
31 clusterExport(cl=cl, varlist=c("calc_pvalue", "depth1", "depth2")) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
32 ptm <- proc.time() |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
33 p_val = parApply(cl, float_table, 1, function(x) calc_pvalue(x, depth1, depth2)) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
34 stopCluster(cl) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
35 proc.time() - ptm |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
36 p_val[p_val>1]=1 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
37 p = qvalue(p_val) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
38 finalTable = cbind(countsTable, data.frame(p\$pvalues), data.frame(p\$qvalues)) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
39 write.table ( finalTable, file = "${output}", row.names=FALSE, col.names=TRUE, quote= FALSE, dec = ".", sep = "\t", eol = "\n") |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
40 ]]> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
41 </configfile> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
42 </configfiles> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
43 <inputs> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
44 <param name="input" type="data" format="tabular" label="gene hit lists, 2 samples"/> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
45 </inputs> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
46 <outputs> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
47 <data name="output" format="tabular" label="Fisher test p-values" /> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
48 </outputs> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
49 <tests> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
50 <test> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
51 <param name="input" value="counts.tab" ftype="tabular"/> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
52 <output name="output" file="fisher.tab" ftype="tabular"/> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
53 </test> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
54 </tests> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
55 <help> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
56 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
57 **What it does** |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
58 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
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. |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
60 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
61 p.pvalues: the chance of getting this data if it is independent between columns (false negative); the p-value. |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
62 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
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. |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
64 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
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. |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
66 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
67 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
68 </help> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
69 <citations> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
70 <citation type="doi">10.1111/1467-9868.00346</citation> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
71 </citations> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
72 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
73 </tool> |