annotate snpFreq2.pl @ 1:5c3ac057608b draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/hgv/snpfreq commit a1517c9d22029095120643bbe2c8fa53754dd2b7
author devteam
date Wed, 11 Nov 2015 12:50:35 -0500
parents 72ea0d13dd66
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
1 #!/usr/bin/env perl
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
2
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
3 use strict;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
4 use warnings;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
5
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
6 #using large SNP tables (~1G) may require large memory ~15G in R
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
7
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
8 #expected input: path to file, cols of counts (2 sets of 3), threshold
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
9 if (!@ARGV or scalar @ARGV != 11) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
10 if (!@ARGV or scalar @ARGV != 6) { #snpTable usage
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
11 print "usage for tab separated allele counts\n",
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
12 "snpFreq.pl inputType #threshold /path/to/snps.txt outfile <6 column numbers(1 based) with counts for alleles, first one group then another>\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
13 print "OR for SNP tables\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
14 print "usage snpFreq.pl inputType #threshold /path/to/snpTable.txt outfile group1File group2File\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
15 exit 1;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
16 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
17 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
18
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
19 #get and verify inputs
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
20 my ($file, $a1, $a2, $a3, $b1, $b2, $b3, $thresh, $outfile);
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
21 if ($ARGV[0] eq 'tab') {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
22 shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
23 $thresh = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
24 if ($thresh !~ /^\d*\.?\d+$/) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
25 print "Error the threshold must be a number. Got $thresh\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
26 exit 1;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
27 }elsif ($thresh > .3) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
28 print "Error the threshold can not be greater than 0.3 got $thresh\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
29 exit 1;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
30 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
31 $file = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
32 $outfile = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
33 $a1 = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
34 if ($a1 =~ /\D/ or $a1 < 1) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
35 print "Error the column number, must be an integer greater than or equal to 1. Got $a1\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
36 exit 1;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
37 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
38 $a2 = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
39 if ($a2 =~ /\D/ or $a2 < 1) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
40 print "Error the column number, must be an integer greater than or equal to 1. Got $a2\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
41 exit 1;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
42 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
43 $a3 = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
44 if ($a3 =~ /\D/ or $a3 < 1) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
45 print "Error the column number, must be an integer greater than or equal to 1. Got $a3\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
46 exit 1;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
47 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
48 $b1 = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
49 if ($b1 =~ /\D/ or $b1 < 1) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
50 print "Error the column number, must be an integer greater than or equal to 1. Got $b1\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
51 exit 1;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
52 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
53 $b2 = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
54 if ($b2 =~ /\D/ or $b2 < 1) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
55 print "Error the column number, must be an integer greater than or equal to 1. Got $b2\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
56 exit 1;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
57 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
58 $b3 = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
59 if ($b3 =~ /\D/ or $b3 < 1) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
60 print "Error the column number, must be an integer greater than or equal to 1. Got $b3\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
61 exit 1;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
62 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
63 }else { #snp table convert and assign variables
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
64 #snpTable.txt #threshold outfile workingdir
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
65 shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
66 $thresh = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
67 if ($thresh !~ /^\d*\.?\d+$/) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
68 print "Error the threshold must be a number. Got $thresh\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
69 exit 1;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
70 }elsif ($thresh > .3) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
71 print "Error the threshold can not be greater than 0.3 got $thresh\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
72 exit 1;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
73 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
74 $file = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
75 $outfile = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
76 my $grpFile = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
77 my @g1;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
78 open(FH, $grpFile) or die "Couldn't open $grpFile, $!\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
79 while (<FH>) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
80 chomp;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
81 if (/^(\d+)\s/) { push(@g1, $1); }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
82 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
83 close FH or die "Couldn't close $grpFile, $!\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
84 $grpFile = shift @ARGV;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
85 my @g2;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
86 open(FH, $grpFile) or die "Couldn't open $grpFile, $!\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
87 while (<FH>) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
88 chomp;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
89 if (/^(\d+)\s/) { push(@g2, $1); }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
90 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
91 close FH or die "Couldn't close $grpFile, $!\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
92 if ($file =~ /.gz$/) {
1
5c3ac057608b planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/hgv/snpfreq commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 0
diff changeset
93 open(FH, "zcat < $file |") or die "Couldn't read $file, $!\n";
0
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
94 }else {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
95 open(FH, $file) or die "Couldn't read $file, $!\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
96 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
97 open(OUT, ">", "snpTable.txt") or die "Couldn't open snpTable.txt, $!\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
98 my $size;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
99 while (<FH>) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
100 chomp;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
101 if (/^#/) { next; } #header
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
102 my @f = split(/\t/);
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
103 $size = scalar @f;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
104 my @gc1 = (0, 0, 0);
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
105 my @gc2 = (0, 0, 0);
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
106 foreach my $g (@g1) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
107 my $i = $g+1; #g is 1 based first col want 0 based snp call column
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
108 if ($i > $#f) { die "ERROR looking for index $i which is greater than the list $#f\n"; }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
109 if ($f[$i] == -1 or $f[$i] == 2) { #treat unknown as ref
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
110 $gc1[0]++;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
111 }elsif ($f[$i] == 1) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
112 $gc1[2]++;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
113 }elsif ($f[$i] == 0) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
114 $gc1[1]++;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
115 }else { die "Unexpected value for genotype $f[$i] in ", join(" ", @f), "\n"; }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
116 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
117 foreach my $g (@g2) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
118 my $i = $g+1; #g is 1 based first col want 0 based snp call column
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
119 if ($f[$i] == -1 or $f[$i] == 2) { #treat unknown as ref
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
120 $gc2[0]++;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
121 }elsif ($f[$i] == 1) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
122 $gc2[2]++;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
123 }elsif ($f[$i] == 0) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
124 $gc2[1]++;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
125 }else { die "Unexpected value for genotype $f[$i] in ", join(" ", @f), "\n"; }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
126 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
127 print OUT join("\t", @f), "\t", join("\t", @gc1), "\t", join("\t", @gc2),
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
128 "\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
129 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
130 close FH or die "Couldn't close $file, $!\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
131 close OUT or die "Couldn't close snpTable.txt, $!\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
132 my $i = $size + 1; #next 1 based column after input data
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
133 $a1 = $i++;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
134 $a2 = $i++;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
135 $a3 = $i++;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
136 $b1 = $i++;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
137 $b2 = $i++;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
138 $b3 = $i++;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
139 $file = "snpTable.txt";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
140 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
141
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
142 #run a fishers exact test (using R) on whole table
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
143 my $cmd = qq|options(warn=-1)
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
144 tab <- read.table('$file', sep="\t")
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
145 size <- length(tab[,1])
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
146 width <- length(tab[1,])
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
147 x <- 1:size
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
148 y <- matrix(data=0, nr=size, nc=6)
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
149 for(i in 1:size) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
150 m <- matrix(c(tab[i,$a1], tab[i,$b1], tab[i,$a2], tab[i,$b2], tab[i,$a3], tab[i,$b3]), nrow=2)
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
151 t <- fisher.test(m)
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
152 x[i] <- t\$p.value
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
153 if (x[i] >= 1) {
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
154 x[i] <- .999
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
155 }
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
156 n <- (tab[i,$a1] + tab[i,$a2] + tab[i,$a3] + tab[i,$b1] + tab[i,$b2] + tab[i,$b3])
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
157 n_a <- (tab[i,$a1] + tab[i,$a2] + tab[i,$a3])
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
158 y[i,1] <- ((tab[i,$a1] + tab[i,$b1])*(n_a))/n
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
159 y[i,1] <- round(y[i,1],3)
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
160 y[i,2] <- ((tab[i,$a2] + tab[i,$b2])*(n_a))/n
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
161 y[i,2] <- round(y[i,2],3)
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
162 y[i,3] <- ((tab[i,$a3] + tab[i,$b3])*(n_a))/n
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
163 y[i,3] <- round(y[i,3],3)
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
164 n_b <- (tab[i,$b1] + tab[i,$b2] + tab[i,$b3])
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
165 y[i,4] <- ((tab[i,$a1] + tab[i,$b1])*(n_b))/n
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
166 y[i,4] <- round(y[i,4],3)
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
167 y[i,5] <- ((tab[i,$a2] + tab[i,$b2])*(n_b))/n
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
168 y[i,5] <- round(y[i,5],3)
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
169 y[i,6] <- ((tab[i,$a3] + tab[i,$b3])*(n_b))/n
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
170 y[i,6] <- round(y[i,6],3)
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
171 }|;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
172 #results <- data.frame(tab[1:size,1:width], x[1:size])
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
173 #write.table(results, file="$outfile", row.names = FALSE ,col.names = FALSE,quote = FALSE, sep="\t")
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
174 #q()|;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
175
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
176 #my $cmd2 = qq|suppressPackageStartupMessages(library(lib.loc='/afs/bx.psu.edu/home/giardine/lib/R', qvalue))
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
177 my $cmd2 = qq|suppressPackageStartupMessages(library(qvalue))
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
178 qobj <- qvalue(x[1:size], lambda=seq(0,0.90,$thresh), pi0.method="bootstrap", fdr.level=0.1, robust=FALSE, smooth.log.pi0 = FALSE)
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
179 q <- qobj\$qvalues
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
180 results <- data.frame(tab[1:size,1:width], y[1:size,1:6], x[1:size], q[1:size])
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
181 write.table(results, file="$outfile", row.names = FALSE ,col.names = FALSE,quote = FALSE, sep="\t")
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
182 q()|;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
183
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
184 #for TESTING
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
185 my $pr = qq|results <- data.frame(tab[1:size,1:width], y[1:size,1:6], x[1:size])
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
186 write.table(results, file="$outfile", row.names = FALSE ,col.names = FALSE,quote = FALSE, sep="\t")
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
187 q()|;
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
188
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
189 open(FT, "| R --slave --vanilla")
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
190 or die "Couldn't call fisher.text, $!\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
191 print FT $cmd, "\n"; #fisher test
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
192 print FT $cmd2, "\n"; #qvalues and results
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
193 #print FT $pr, "\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
194 close FT or die "Couldn't finish fisher.test, $!\n";
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
195
72ea0d13dd66 Imported from capsule None
devteam
parents:
diff changeset
196 exit;