244 |
01 Mar 07 |
enell |
1 |
/* |
244 |
01 Mar 07 |
enell |
$Id$ |
244 |
01 Mar 07 |
enell |
3 |
|
244 |
01 Mar 07 |
enell |
Copyright (C) 2006 Johan Enell |
244 |
01 Mar 07 |
enell |
5 |
|
244 |
01 Mar 07 |
enell |
This file is part of BASE - BioArray Software Environment. |
244 |
01 Mar 07 |
enell |
Available at http://base.thep.lu.se/ |
244 |
01 Mar 07 |
enell |
8 |
|
244 |
01 Mar 07 |
enell |
BASE is free software; you can redistribute it and/or modify it |
244 |
01 Mar 07 |
enell |
under the terms of the GNU General Public License as published by |
244 |
01 Mar 07 |
enell |
the Free Software Foundation; either version 2 of the License, or |
244 |
01 Mar 07 |
enell |
(at your option) any later version. |
244 |
01 Mar 07 |
enell |
13 |
|
244 |
01 Mar 07 |
enell |
BASE is distributed in the hope that it will be useful, but |
244 |
01 Mar 07 |
enell |
WITHOUT ANY WARRANTY; without even the implied warranty of |
244 |
01 Mar 07 |
enell |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
244 |
01 Mar 07 |
enell |
General Public License for more details. |
244 |
01 Mar 07 |
enell |
18 |
|
244 |
01 Mar 07 |
enell |
You should have received a copy of the GNU General Public License |
244 |
01 Mar 07 |
enell |
along with this program; if not, write to the Free Software |
244 |
01 Mar 07 |
enell |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
244 |
01 Mar 07 |
enell |
02111-1307, USA. |
244 |
01 Mar 07 |
enell |
23 |
*/ |
244 |
01 Mar 07 |
enell |
24 |
package oneclass.rankproduct; |
244 |
01 Mar 07 |
enell |
25 |
|
252 |
10 Apr 07 |
enell |
26 |
import basefile.BASEFile; |
244 |
01 Mar 07 |
enell |
27 |
import basefile.BASEFileException; |
244 |
01 Mar 07 |
enell |
28 |
|
244 |
01 Mar 07 |
enell |
29 |
import java.io.File; |
244 |
01 Mar 07 |
enell |
30 |
|
244 |
01 Mar 07 |
enell |
31 |
public class Start |
244 |
01 Mar 07 |
enell |
32 |
{ |
244 |
01 Mar 07 |
enell |
33 |
|
244 |
01 Mar 07 |
enell |
34 |
/** |
244 |
01 Mar 07 |
enell |
* @param args |
244 |
01 Mar 07 |
enell |
36 |
*/ |
252 |
10 Apr 07 |
enell |
37 |
public static void main(String[] args) throws BASEFileException |
244 |
01 Mar 07 |
enell |
38 |
{ |
244 |
01 Mar 07 |
enell |
39 |
try |
244 |
01 Mar 07 |
enell |
40 |
{ |
255 |
13 Apr 07 |
enell |
41 |
File dataFolder = new File("lib"); |
255 |
13 Apr 07 |
enell |
42 |
dataFolder.mkdir(); |
255 |
13 Apr 07 |
enell |
43 |
|
252 |
10 Apr 07 |
enell |
44 |
BASEFile<Reporter, Spot> basefile; |
252 |
10 Apr 07 |
enell |
45 |
basefile = new BASEFile<Reporter, Spot>(new File(args.length == 1 ? args[0] : "stdin.txt"), "r"); |
246 |
13 Mar 07 |
enell |
46 |
|
252 |
10 Apr 07 |
enell |
47 |
RankProduct rankproduct = new RankProduct(basefile); |
252 |
10 Apr 07 |
enell |
48 |
rankproduct.calculate(); |
255 |
13 Apr 07 |
enell |
49 |
rankproduct.print(dataFolder); |
244 |
01 Mar 07 |
enell |
50 |
} |
244 |
01 Mar 07 |
enell |
51 |
catch (BASEFileException e) |
244 |
01 Mar 07 |
enell |
52 |
{ |
252 |
10 Apr 07 |
enell |
53 |
throw e; |
244 |
01 Mar 07 |
enell |
54 |
} |
244 |
01 Mar 07 |
enell |
55 |
} |
244 |
01 Mar 07 |
enell |
56 |
|
244 |
01 Mar 07 |
enell |
57 |
|
252 |
10 Apr 07 |
enell |
// private static void print(BASEFileSpotSection<Reporter, Spot> bfss, String prefix) throws BASEFileException |
252 |
10 Apr 07 |
enell |
59 |
// { |
252 |
10 Apr 07 |
enell |
// XYSeries oSeries = new XYSeries("Observed"); |
252 |
10 Apr 07 |
enell |
// XYSeries eSeries = new XYSeries("Expected"); |
252 |
10 Apr 07 |
enell |
// XYSeries fdrSeries = new XYSeries("FDR"); |
252 |
10 Apr 07 |
enell |
// HistogramDataset mHist = new HistogramDataset("M", 0.1); |
252 |
10 Apr 07 |
enell |
64 |
// |
252 |
10 Apr 07 |
enell |
// for (int i = 0; i < bfss.getReporterSize(); i++) |
252 |
10 Apr 07 |
enell |
66 |
// { |
252 |
10 Apr 07 |
enell |
// int rank = i + 1; |
252 |
10 Apr 07 |
enell |
// Reporter r = bfss.getReporter(i); |
252 |
10 Apr 07 |
enell |
// double rankProduct = r.getRankProduct(); |
252 |
10 Apr 07 |
enell |
70 |
// |
252 |
10 Apr 07 |
enell |
71 |
// |
252 |
10 Apr 07 |
enell |
// oSeries.add(rank, rank); |
252 |
10 Apr 07 |
enell |
// eSeries.add(rank, rankProduct); |
244 |
01 Mar 07 |
enell |
// fdrSeries.add(rank, fdr); |
252 |
10 Apr 07 |
enell |
// mHist.addObservation(r.getM()); |
252 |
10 Apr 07 |
enell |
76 |
// } |
252 |
10 Apr 07 |
enell |
77 |
// |
246 |
13 Mar 07 |
enell |
// Plot.plotFDR(fdrSeries); |
246 |
13 Mar 07 |
enell |
// Plot.plotOE(oSeries, eSeries); |
246 |
13 Mar 07 |
enell |
// Plot.plotOE_FDR(oSeries, eSeries, fdrSeries); |
244 |
01 Mar 07 |
enell |
// Plot.plotMHist(mHist, ztest.getTotalMean(), ztest.getTotalSD()); |
252 |
10 Apr 07 |
enell |
82 |
// } |
244 |
01 Mar 07 |
enell |
83 |
} |