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