2330 |
29 May 06 |
enell |
1 |
import java.io.BufferedReader; |
2330 |
29 May 06 |
enell |
2 |
import java.io.IOException; |
2330 |
29 May 06 |
enell |
3 |
import java.io.InputStreamReader; |
2330 |
29 May 06 |
enell |
4 |
import java.io.PrintWriter; |
2330 |
29 May 06 |
enell |
5 |
|
2205 |
28 Apr 06 |
enell |
6 |
/* |
2205 |
28 Apr 06 |
enell |
$Id$ |
2205 |
28 Apr 06 |
enell |
8 |
|
2205 |
28 Apr 06 |
enell |
Copyright (C) 2006 Johan Enell |
2205 |
28 Apr 06 |
enell |
10 |
|
2205 |
28 Apr 06 |
enell |
This file is part of BASE - BioArray Software Environment. |
2205 |
28 Apr 06 |
enell |
Available at http://base.thep.lu.se/ |
2205 |
28 Apr 06 |
enell |
13 |
|
2205 |
28 Apr 06 |
enell |
BASE is free software; you can redistribute it and/or modify it |
2205 |
28 Apr 06 |
enell |
under the terms of the GNU General Public License as published by |
4480 |
05 Sep 08 |
jari |
the Free Software Foundation; either version 3 of the License, or |
2205 |
28 Apr 06 |
enell |
(at your option) any later version. |
2205 |
28 Apr 06 |
enell |
18 |
|
2205 |
28 Apr 06 |
enell |
BASE is distributed in the hope that it will be useful, but |
2205 |
28 Apr 06 |
enell |
WITHOUT ANY WARRANTY; without even the implied warranty of |
2205 |
28 Apr 06 |
enell |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2205 |
28 Apr 06 |
enell |
General Public License for more details. |
2205 |
28 Apr 06 |
enell |
23 |
|
2205 |
28 Apr 06 |
enell |
You should have received a copy of the GNU General Public License |
4514 |
11 Sep 08 |
jari |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
2205 |
28 Apr 06 |
enell |
26 |
*/ |
2205 |
28 Apr 06 |
enell |
27 |
|
2205 |
28 Apr 06 |
enell |
28 |
public class Base1NullPlugin |
2205 |
28 Apr 06 |
enell |
29 |
{ |
2205 |
28 Apr 06 |
enell |
30 |
|
2205 |
28 Apr 06 |
enell |
31 |
/** |
2205 |
28 Apr 06 |
enell |
* @param args |
2330 |
29 May 06 |
enell |
* @throws IOException |
2205 |
28 Apr 06 |
enell |
34 |
*/ |
2330 |
29 May 06 |
enell |
35 |
public static void main(String[] args) throws IOException |
2205 |
28 Apr 06 |
enell |
36 |
{ |
2330 |
29 May 06 |
enell |
37 |
PrintWriter log = new PrintWriter("base1nullplugin.log"); |
2330 |
29 May 06 |
enell |
38 |
log.println("base1nullplugin started"); |
2330 |
29 May 06 |
enell |
39 |
|
2330 |
29 May 06 |
enell |
40 |
BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); |
2330 |
29 May 06 |
enell |
41 |
String line = in.readLine(); |
2330 |
29 May 06 |
enell |
42 |
while (line != null) |
2330 |
29 May 06 |
enell |
43 |
{ |
4537 |
18 Sep 08 |
nicklas |
44 |
if (line.startsWith("assayFields") && line.contains("_xc_")) |
4537 |
18 Sep 08 |
nicklas |
45 |
{ |
4537 |
18 Sep 08 |
nicklas |
46 |
/* |
4537 |
18 Sep 08 |
nicklas |
The file contains extra values. To make the |
4537 |
18 Sep 08 |
nicklas |
import work we must remove the _xc_ prefix for the |
4537 |
18 Sep 08 |
nicklas |
extra value columns and add a setExtraFloats header |
4537 |
18 Sep 08 |
nicklas |
50 |
*/ |
4537 |
18 Sep 08 |
nicklas |
51 |
String[] columns = line.split("\\t"); |
4537 |
18 Sep 08 |
nicklas |
52 |
line = "assayFields"; |
4537 |
18 Sep 08 |
nicklas |
53 |
String setExtraFloats = "setExtraFloats"; |
4537 |
18 Sep 08 |
nicklas |
54 |
for (int i = 1; i < columns.length; ++i) |
4537 |
18 Sep 08 |
nicklas |
55 |
{ |
4537 |
18 Sep 08 |
nicklas |
56 |
String column = columns[i]; |
4537 |
18 Sep 08 |
nicklas |
57 |
if (column.startsWith("_xc_")) |
4537 |
18 Sep 08 |
nicklas |
58 |
{ |
4537 |
18 Sep 08 |
nicklas |
59 |
column = column.substring(4); |
4537 |
18 Sep 08 |
nicklas |
60 |
setExtraFloats += "\t" + column; |
4537 |
18 Sep 08 |
nicklas |
61 |
} |
4537 |
18 Sep 08 |
nicklas |
62 |
line += "\t" + column; |
4537 |
18 Sep 08 |
nicklas |
63 |
} |
4537 |
18 Sep 08 |
nicklas |
64 |
System.out.println(setExtraFloats); |
4537 |
18 Sep 08 |
nicklas |
65 |
} |
2330 |
29 May 06 |
enell |
66 |
System.out.println(line); |
2330 |
29 May 06 |
enell |
67 |
log.println(line); |
2330 |
29 May 06 |
enell |
68 |
line = in.readLine(); |
2330 |
29 May 06 |
enell |
69 |
log.flush(); |
2330 |
29 May 06 |
enell |
70 |
} |
2330 |
29 May 06 |
enell |
71 |
|
2330 |
29 May 06 |
enell |
72 |
log.println("base1nullplugin ended"); |
2330 |
29 May 06 |
enell |
73 |
log.close(); |
2205 |
28 Apr 06 |
enell |
74 |
} |
2205 |
28 Apr 06 |
enell |
75 |
|
2205 |
28 Apr 06 |
enell |
76 |
} |