本文整理汇总了Java中htsjdk.samtools.util.Interval.length方法的典型用法代码示例。如果您正苦于以下问题:Java Interval.length方法的具体用法?Java Interval.length怎么用?Java Interval.length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.samtools.util.Interval
的用法示例。
在下文中一共展示了Interval.length方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: liftSimpleVariantContext
import htsjdk.samtools.util.Interval; //导入方法依赖的package包/类
protected static VariantContextBuilder liftSimpleVariantContext(VariantContext source, Interval target){
if (target == null || source.getReference().length() != target.length()) {
return null;
}
// Build the new variant context. Note: this will copy genotypes, annotations and filters
final VariantContextBuilder builder = new VariantContextBuilder(source);
builder.chr(target.getContig());
builder.start(target.getStart());
builder.stop(target.getEnd());
return builder;
}
示例2: testCoverageGetTotalOverflow
import htsjdk.samtools.util.Interval; //导入方法依赖的package包/类
@Test
public void testCoverageGetTotalOverflow() {
final Interval interval = new Interval("chr1", 1, 2);
final TargetMetricsCollector.Coverage coverage = new TargetMetricsCollector.Coverage(interval, 0);
for (int offset = 0; offset <= interval.length(); offset++) {
coverage.addBase(offset, Integer.MAX_VALUE - 1);
}
Assert.assertEquals((long)coverage.getTotal(), 2 * (long)(Integer.MAX_VALUE - 1));
}
示例3: trimInterval
import htsjdk.samtools.util.Interval; //导入方法依赖的package包/类
private Interval trimInterval(final Interval interval) {
if(interval.length()<=this.max_interval_length) return interval;
final Interval interval2 = new Interval(
interval.getContig(),
interval.getStart(),
interval.getStart()+this.max_interval_length-1
);
LOG.debug("trim interval "+interval+" to "+interval2);
return interval2;
}
示例4: overlap
import htsjdk.samtools.util.Interval; //导入方法依赖的package包/类
/** returns true two interval overlap with fraction_overlap */
private boolean overlap(final Interval i1,final Interval i2)
{
if(!i1.intersects(i2)) return false;
final int L1 = i1.length();
final int L2 = i2.length();
final int L3 = i1.getIntersectionLength(i2);
if(L3< (int)(this.fraction_overlap*L1)) return false;
if(L3< (int)(this.fraction_overlap*L2)) return false;
return true;
}