Skip to content

Commit 03c9ef9

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents e6f6e33 + 4349001 commit 03c9ef9

40 files changed

+1277
-356
lines changed

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@ build/
3030
/web/jnlp.template
3131
/batik-codec.jar
3232
/goby-io-igv.jar
33-
/launcher/dist
33+
/launcher/dist
34+
/test/largedata
35+
36+
#Ignore index files
37+
*.*.idx
38+
!isect_res.bed.idx

src/org/broad/igv/data/seg/SegmentFileParser.java

+6-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
/*
2-
* Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved.
2+
* Copyright (c) 2007-2012 The Broad Institute, Inc.
3+
* SOFTWARE COPYRIGHT NOTICE
4+
* This software and its documentation are the copyright of the Broad Institute, Inc. All rights are reserved.
5+
*
6+
* This software is supplied without any warranty or guaranteed support whatsoever. The Broad Institute is not responsible for its use, misuse, or functionality.
37
*
48
* This software is licensed under the terms of the GNU Lesser General Public License (LGPL),
59
* Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php.
6-
*
7-
* THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR
8-
* WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING,
9-
* WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
10-
* PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER
11-
* OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE
12-
* TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES
13-
* OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
14-
* ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER
15-
* THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT
16-
* SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING.
1710
*/
1811
package org.broad.igv.data.seg;
1912

@@ -189,7 +182,7 @@ public SegmentedAsciiDataSet loadSegments(ResourceLocator locator, Genome genome
189182
throw new RuntimeException(e);
190183
}
191184
} finally {
192-
if (reader == null) {
185+
if (reader != null) {
193186
reader.close();
194187
}
195188
}
+155
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/*
2+
* Copyright (c) 2007-2012 The Broad Institute, Inc.
3+
* SOFTWARE COPYRIGHT NOTICE
4+
* This software and its documentation are the copyright of the Broad Institute, Inc. All rights are reserved.
5+
*
6+
* This software is supplied without any warranty or guaranteed support whatsoever. The Broad Institute is not responsible for its use, misuse, or functionality.
7+
*
8+
* This software is licensed under the terms of the GNU Lesser General Public License (LGPL),
9+
* Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php.
10+
*/
11+
12+
package org.broad.igv.dev;
13+
14+
import java.sql.ResultSet;
15+
import java.sql.SQLException;
16+
17+
/**
18+
* User: jacob
19+
* Date: 2012-Aug-30
20+
*/
21+
public class GenDataParser {
22+
23+
public final byte getByte(ResultSet rs, int index) throws SQLException {
24+
return rs.getByte(index + 1);
25+
}
26+
27+
public final byte getByte(ResultSet rs, String label) throws SQLException {
28+
return rs.getByte(label);
29+
}
30+
31+
public final byte getByte(String[] array, int index) throws NumberFormatException {
32+
return Byte.valueOf(array[index]);
33+
}
34+
35+
public final short getShort(ResultSet rs, int index) throws SQLException {
36+
return rs.getShort(index + 1);
37+
}
38+
39+
public final short getShort(ResultSet rs, String label) throws SQLException {
40+
return rs.getShort(label);
41+
}
42+
43+
public final short getShort(String[] array, int index) throws NumberFormatException {
44+
return Short.valueOf(array[index]);
45+
}
46+
47+
public final int getInt(ResultSet rs, int index) throws SQLException {
48+
return rs.getInt(index + 1);
49+
}
50+
51+
public final int getInt(ResultSet rs, String label) throws SQLException {
52+
return rs.getInt(label);
53+
}
54+
55+
public final int getInt(String[] array, int index) throws NumberFormatException {
56+
return Integer.valueOf(array[index]);
57+
}
58+
59+
public final double getDouble(ResultSet rs, int index) throws SQLException {
60+
return rs.getDouble(index + 1);
61+
}
62+
63+
public final double getDouble(ResultSet rs, String label) throws SQLException {
64+
return rs.getDouble(label);
65+
}
66+
67+
public final double getDouble(String[] array, int index) throws NumberFormatException {
68+
return Double.valueOf(array[index]);
69+
}
70+
71+
public final float getFloat(ResultSet rs, int index) throws SQLException {
72+
return rs.getFloat(index + 1);
73+
}
74+
75+
public final float getFloat(ResultSet rs, String label) throws SQLException {
76+
return rs.getFloat(label);
77+
}
78+
79+
public final float getFloat(String[] array, int index) throws NumberFormatException {
80+
return Float.valueOf(array[index]);
81+
}
82+
83+
public final String getString(ResultSet rs, int index) throws SQLException {
84+
return rs.getString(index + 1);
85+
}
86+
87+
public final String getString(ResultSet rs, String label) throws SQLException {
88+
return rs.getString(label);
89+
}
90+
91+
public final String getString(String[] array, int index) throws NumberFormatException {
92+
return array[index];
93+
}
94+
95+
// public final byte getByte(Object obj, int index) throws SQLException{
96+
// if(obj instanceof ResultSet){
97+
// return ((ResultSet) obj).getByte(index + 1);
98+
// }else if(obj instanceof String[]){
99+
// return Byte.valueOf(((String[]) obj)[index]);
100+
// }else{
101+
// throw new IllegalArgumentException("Input must be a ResultSet or String[]");
102+
// }
103+
// }
104+
//
105+
// public final short getShort(Object obj, int index) throws SQLException{
106+
// if(obj instanceof ResultSet){
107+
// return ((ResultSet) obj).getShort(index + 1);
108+
// }else if(obj instanceof String[]){
109+
// return Short.valueOf(((String[]) obj)[index]);
110+
// }else{
111+
// throw new IllegalArgumentException("Input must be a ResultSet or String[]");
112+
// }
113+
// }
114+
//
115+
// public final int getInt(Object obj, int index) throws SQLException{
116+
// if(obj instanceof ResultSet){
117+
// return ((ResultSet) obj).getInt(index + 1);
118+
// }else if(obj instanceof String[]){
119+
// return Integer.valueOf(((String[]) obj)[index]);
120+
// }else{
121+
// throw new IllegalArgumentException("Input must be a ResultSet or String[]");
122+
// }
123+
// }
124+
//
125+
// public final float getFloat(Object obj, int index) throws SQLException{
126+
// if(obj instanceof ResultSet){
127+
// return ((ResultSet) obj).getFloat(index + 1);
128+
// }else if(obj instanceof String[]){
129+
// return Float.valueOf(((String[]) obj)[index]);
130+
// }else{
131+
// throw new IllegalArgumentException("Input must be a ResultSet or String[]");
132+
// }
133+
// }
134+
//
135+
// public final double getDouble(Object obj, int index) throws SQLException{
136+
// if(obj instanceof ResultSet){
137+
// return ((ResultSet) obj).getDouble(index + 1);
138+
// }else if(obj instanceof String[]){
139+
// return Double.valueOf(((String[]) obj)[index]);
140+
// }else{
141+
// throw new IllegalArgumentException("Input must be a ResultSet or String[]");
142+
// }
143+
// }
144+
//
145+
// public final String getString(Object obj, int index) throws SQLException{
146+
// if(obj instanceof ResultSet){
147+
// return ((ResultSet) obj).getString(index + 1);
148+
// }else if(obj instanceof String[]){
149+
// return ((String[]) obj)[index];
150+
// }else{
151+
// throw new IllegalArgumentException("Input must be a ResultSet or String[]");
152+
// }
153+
// }
154+
//
155+
}

src/org/broad/igv/dev/IParser.java

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) 2007-2012 The Broad Institute, Inc.
3+
* SOFTWARE COPYRIGHT NOTICE
4+
* This software and its documentation are the copyright of the Broad Institute, Inc. All rights are reserved.
5+
*
6+
* This software is supplied without any warranty or guaranteed support whatsoever. The Broad Institute is not responsible for its use, misuse, or functionality.
7+
*
8+
* This software is licensed under the terms of the GNU Lesser General Public License (LGPL),
9+
* Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php.
10+
*/
11+
12+
package org.broad.igv.dev;
13+
14+
import org.broad.igv.exceptions.ParserException;
15+
16+
/**
17+
* User: jacob
18+
* Date: 2012-Aug-30
19+
*/
20+
public interface IParser<TContainer, TIndex> {
21+
22+
byte getByte(TContainer obj, TIndex index) throws ParserException;
23+
24+
short getShort(TContainer obj, TIndex index) throws ParserException;
25+
26+
int getInt(TContainer obj, TIndex index) throws ParserException;
27+
28+
float getFloat(TContainer obj, TIndex index) throws ParserException;
29+
30+
double getDouble(TContainer obj, TIndex index) throws ParserException;
31+
32+
String getString(TContainer obj, TIndex index) throws ParserException;
33+
34+
/**
35+
* Return the number of data objects contained.
36+
* For an array, this would be the length
37+
*
38+
* @param obj
39+
* @return
40+
* @throws ParserException
41+
*/
42+
int size(TContainer obj) throws ParserException;
43+
}

0 commit comments

Comments
 (0)