forked from bmajoros/python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBed3Record.py
executable file
·46 lines (40 loc) · 1.53 KB
/
Bed3Record.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#=========================================================================
# This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
# License (GPL) version 3, as described at www.opensource.org.
# Copyright (C)2016 William H. Majoros ([email protected]).
#=========================================================================
from __future__ import (absolute_import, division, print_function,
unicode_literals, generators, nested_scopes, with_statement)
from builtins import (bytes, dict, int, list, object, range, str, ascii,
chr, hex, input, next, oct, open, pow, round, super, filter, map, zip)
from Interval import Interval
#=========================================================================
# Attributes:
# chr : string
# interval : Interval
# Instance Methods:
# record=Bed3Record(chr,begin,end)
# bool=record.isBed3()
# bool=record.isBed6()
# begin=record.getBegin()
# end=record.getEnd()
# line=record.toString()
# Class Methods:
#
#=========================================================================
class Bed3Record:
"""Bed3Record represents a record in a BED3 file"""
def __init__(self,chr,begin,end):
self.chr=chr
self.interval=Interval(begin,end)
def isBed3(self):
return True
def isBed6(self):
return False
def getBegin(self):
return self.interval.begin
def getEnd(self):
return self.interval.end
def toString(self):
return self.chr+"\t"+str(self.interval.begin)+"\t"+\
str(self.interval.end)