code cleanup and containsStartPosition function
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1919 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
186a8dd698
commit
ef2ea79994
|
|
@ -1,10 +1,10 @@
|
||||||
package org.broadinstitute.sting.utils;
|
package org.broadinstitute.sting.utils;
|
||||||
|
|
||||||
import net.sf.samtools.SAMRecord;
|
import net.sf.samtools.SAMRecord;
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by IntelliJ IDEA.
|
* Created by IntelliJ IDEA.
|
||||||
|
|
@ -16,9 +16,7 @@ import java.util.List;
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class GenomeLoc implements Comparable<GenomeLoc>, Cloneable {
|
public class GenomeLoc implements Comparable<GenomeLoc>, Cloneable, Serializable {
|
||||||
private static Logger logger = Logger.getLogger(GenomeLoc.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the basic components of a genome loc, its contig index,
|
* the basic components of a genome loc, its contig index,
|
||||||
* start and stop position, and (optionally) the contig name
|
* start and stop position, and (optionally) the contig name
|
||||||
|
|
@ -178,6 +176,15 @@ public class GenomeLoc implements Comparable<GenomeLoc>, Cloneable {
|
||||||
return onSameContig(that) && getStart() <= that.getStart() && getStop() >= that.getStop();
|
return onSameContig(that) && getStart() <= that.getStart() && getStop() >= that.getStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this GenomeLoc contains the start position of GenomeLoc that, on the same contig
|
||||||
|
* @param start
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public final boolean containsStartPosition(long start) {
|
||||||
|
return getStart() <= start && start <= getStop();
|
||||||
|
}
|
||||||
|
|
||||||
public final boolean onSameContig(GenomeLoc that) {
|
public final boolean onSameContig(GenomeLoc that) {
|
||||||
return (this.contigIndex == that.contigIndex);
|
return (this.contigIndex == that.contigIndex);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue