本文整理汇总了Python中Interval.Interval.end方法的典型用法代码示例。如果您正苦于以下问题:Python Interval.end方法的具体用法?Python Interval.end怎么用?Python Interval.end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interval.Interval
的用法示例。
在下文中一共展示了Interval.end方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: insert
# 需要导入模块: from Interval import Interval [as 别名]
# 或者: from Interval.Interval import end [as 别名]
def insert(self, intervals, newInterval):
if len(intervals) == 0:
return [newInterval]
r = []
overlapWithNewInterval = Interval(newInterval.start, newInterval.end)
didAddNewInterval = False
for i in intervals:
if (i.start < overlapWithNewInterval.start
and i.end < overlapWithNewInterval.start):
r.append(i)
elif (i.start < overlapWithNewInterval.start
and i.end >= overlapWithNewInterval.start
and i.end <= overlapWithNewInterval.end):
overlapWithNewInterval.start = i.start
elif (i.start < overlapWithNewInterval.start
and i.end > overlapWithNewInterval.end):
return intervals
elif (i.start >= overlapWithNewInterval.start
and i.end <= overlapWithNewInterval.end):
pass
elif (i.start >= overlapWithNewInterval.start
and i.start <= overlapWithNewInterval.end
and i.end >= overlapWithNewInterval.end):
overlapWithNewInterval.end = i.end
else: # hxl: i is after overlapWithNewInterval
if didAddNewInterval == False:
r.append(overlapWithNewInterval)
didAddNewInterval = True
r.append(i)
# hxl: It's possible that the new interval is not added yet!
if didAddNewInterval == False:
r.append(overlapWithNewInterval)
didAddNewInterval = True
return r
示例2: print
# 需要导入模块: from Interval import Interval [as 别名]
# 或者: from Interval.Interval import end [as 别名]
pos=exon.getBegin()-2
end=exon.getEnd()
else:
if(siteType=="donor"):
begin=exons[exonIndex-1].getEnd()
pos=exon.getBegin()-2
end=exon.getEnd()
else:
begin=exon.getBegin()
pos=exon.getEnd()
end=exons[exonIndex+1].getBegin()
exclusions=exclude.get(substrate,{})
begin=int(begin); pos=int(pos); end=int(end)
interval=Interval(pos-70,pos+70)
if(interval.begin<begin): interval.begin=begin
if(interval.end>end): interval.end=end
juncs=junctions.get(substrate,[])
#print("substrate=",substrate)
sum=0
for junc in juncs:
(substrate,begin,end,count)=junc
key=str(begin)+"-"+str(end)
if(exclusions.get(key,False)):
continue
if(interval.contains(begin) or interval.contains(end)): sum+=int(count)
geneCount=readCounts.get(geneID,0)
#print("gene=",geneID)
if(rex.find("(\S+)_\d",geneID)): geneID=rex[1]
print(indiv,hap,geneID,transID,strand,exonIndex,siteType,interval.begin,pos,
interval.end,sum,geneCount,totalMappedReads,sep="\t",flush=True)