Mercurial > repos > artbio > fishertest
annotate fisher_test.xml @ 1:3a67bee2ef63 draft
"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 6215dff88ce7276f36f5793d8475d4da2c1c9292"
author | artbio |
---|---|
date | Mon, 22 Jun 2020 08:48:38 -0400 |
parents | 5f784a95ce13 |
children | 8052d037517f |
rev | line source |
---|---|
1
3a67bee2ef63
"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 6215dff88ce7276f36f5793d8475d4da2c1c9292"
artbio
parents:
0
diff
changeset
|
1 <tool id="fishertest" name="Fisher's exact test" version="1.1.0"> |
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> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
4 <!-- <requirement type="package" version="3.1.2">R</requirement> --> |
1
3a67bee2ef63
"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 6215dff88ce7276f36f5793d8475d4da2c1c9292"
artbio
parents:
0
diff
changeset
|
5 <requirement type="package" version="2.18.0=r36_1">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
|
6 </requirements> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
7 <command><![CDATA[ |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
8 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
|
9 ]]></command> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
10 <configfiles> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
11 <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
|
12 <![CDATA[ |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
13 ## 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
|
14 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
|
15 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
|
16 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
|
17 library(parallel) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
18 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
|
19 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
|
20 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
|
21 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
|
22 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
|
23 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
|
24 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
25 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
|
26 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
|
27 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
|
28 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
|
29 } |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
30 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
31 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
|
32 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
|
33 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
|
34 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
|
35 stopCluster(cl) |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
36 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
|
37 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
|
38 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
|
39 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
|
40 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
|
41 ]]> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
42 </configfile> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
43 </configfiles> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
44 <inputs> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
45 <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
|
46 </inputs> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
47 <outputs> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
48 <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
|
49 </outputs> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
50 <tests> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
51 <test> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
52 <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
|
53 <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
|
54 </test> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
55 </tests> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
56 <help> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
57 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
58 **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
|
59 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
60 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
|
61 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
62 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
|
63 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
64 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
|
65 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
66 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
|
67 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
68 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
69 </help> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
70 <citations> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
71 <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
|
72 </citations> |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
73 |
5f784a95ce13
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fisher_test commit 7d954797362ea5de843d812cb823ac1dd869e1df
artbio
parents:
diff
changeset
|
74 </tool> |