projects
/
tabix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
# Using debhelper 8.
[tabix.git]
/
TabixReader.java
diff --git
a/TabixReader.java
b/TabixReader.java
index 40d395120e4df26cbf04a7667fba2775a921a05b..5874202581ee8bf72f4b0c3917a743f59c40c03e 100644
(file)
--- a/
TabixReader.java
+++ b/
TabixReader.java
@@
-217,7
+217,7
@@
public class TabixReader
int[] ret = new int[3];
colon = reg.indexOf(':'); hyphen = reg.indexOf('-');
chr = colon >= 0? reg.substring(0, colon) : reg;
int[] ret = new int[3];
colon = reg.indexOf(':'); hyphen = reg.indexOf('-');
chr = colon >= 0? reg.substring(0, colon) : reg;
- ret[1] = colon >= 0? Integer.parseInt(reg.substring(colon+1, hyphen)) - 1 : 0;
+ ret[1] = colon >= 0? Integer.parseInt(reg.substring(colon+1, hyphen
>= 0? hyphen : reg.length()
)) - 1 : 0;
ret[2] = hyphen >= 0? Integer.parseInt(reg.substring(hyphen+1)) : 0x7fffffff;
ret[0] = chr2tid(chr);
return ret;
ret[2] = hyphen >= 0? Integer.parseInt(reg.substring(hyphen+1)) : 0x7fffffff;
ret[0] = chr2tid(chr);
return ret;
@@
-339,6
+339,7
@@
public class TabixReader
for (int j = 0; j < chunks.length; ++j)
if (less64(min_off, chunks[j].v))
off[n_off++] = new TPair64(chunks[j]);
for (int j = 0; j < chunks.length; ++j)
if (less64(min_off, chunks[j].v))
off[n_off++] = new TPair64(chunks[j]);
+ if (n_off == 0) return null;
Arrays.sort(off, 0, n_off);
// resolve completely contained adjacent blocks
for (i = 1, l = 0; i < n_off; ++i) {
Arrays.sort(off, 0, n_off);
// resolve completely contained adjacent blocks
for (i = 1, l = 0; i < n_off; ++i) {
@@
-385,7
+386,7
@@
public class TabixReader
System.out.println(s);
} else { // a region is specified; random access
TabixReader.Iterator iter = tr.query(args[1]); // get the iterator
System.out.println(s);
} else { // a region is specified; random access
TabixReader.Iterator iter = tr.query(args[1]); // get the iterator
- while ((s = iter.next()) != null)
+ while (
iter != null &&
(s = iter.next()) != null)
System.out.println(s);
}
} catch (IOException e) {
System.out.println(s);
}
} catch (IOException e) {