Easier to print GenomeLoc compareTo()
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1597 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
3949b4ac72
commit
3ad97e4ab4
|
|
@ -256,19 +256,27 @@ public class GenomeLoc implements Comparable<GenomeLoc>, Cloneable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int compareTo( GenomeLoc that ) {
|
public int compareTo( GenomeLoc that ) {
|
||||||
if ( this == that ) return 0;
|
int result = 0;
|
||||||
|
if ( this == that ) {
|
||||||
|
result = 0;
|
||||||
|
} else {
|
||||||
|
final int cmpContig = compareContigs(that);
|
||||||
|
|
||||||
final int cmpContig = compareContigs(that);
|
if ( cmpContig != 0 ) {
|
||||||
|
result = cmpContig;
|
||||||
|
} else {
|
||||||
|
if ( this.getStart() < that.getStart() ) result = -1;
|
||||||
|
if ( this.getStart() > that.getStart() ) result = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if ( cmpContig != 0 ) return cmpContig;
|
// TODO: and error is being thrown because we are treating reads with the same start positions
|
||||||
if ( this.getStart() < that.getStart() ) return -1;
|
// but different stop as out of order
|
||||||
if ( this.getStart() > that.getStart() ) return 1;
|
//if ( this.getStop() < that.getStop() ) return -1;
|
||||||
|
//if ( this.getStop() > that.getStop() ) return 1;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: and error is being thrown because we are treating reads with the same start positions
|
//System.out.printf("this vs. that = %s %s => %d%n", this, that, result);
|
||||||
// but different stop as out of order
|
return result;
|
||||||
//if ( this.getStop() < that.getStop() ) return -1;
|
|
||||||
//if ( this.getStop() > that.getStop() ) return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue