示例#1
0
    def __init__(self,seqerrorstart,seqerrorend,gff={}):
        # input validation
        if type(seqerrorstart) == type(int()):
            seqerrorstart = SequenceErrorCoordinate(seqerrorstart)
        else:
            IsSequenceErrorCoordinate(seqerrorstart)
        if type(seqerrorend) == type(int()):
            seqerrorend = SequenceErrorCoordinate(seqerrorend)
        else:
            IsSequenceErrorCoordinate(seqerrorend)

        # initialization
        BasicGFF.__init__(self)
        self._gff.update(gff)
        self.donor      = seqerrorstart
        self.acceptor   = seqerrorend
        self.length     = self.acceptor.pos-self.donor.pos
        self.start      = self.donor.pos
        self.end        = self.acceptor.pos
        self.typeof     = None
        # Estimated coordinate of this sequence error
        # It is possible to pinpoint this SequenceError to a certain
        # position but (re)label the estimated coordinate somewhere is.
        # This option is needed in ABFGP in case of Intertions/Deletions
        self._estimated_nt_coord = self.donor.pos

        # set shared nt/aa data. This mimmics attributes from
        # the Intron class and maintains readingframe in a genestructure
        self.shared_nts = "nnn"
        self.shared_aa  = "X"
示例#2
0
 def togff(self,gff={}):
     """ Overwrites BasicGFF.togff() """
     if not gff.has_key('gname') and not self._gff.has_key('gname'):
         gff['gname'] = "%s-%s" % (self.start, self.end)
     self._gff['column9data']['typeof'] = self.typeof
     retgff = {}
     retgff.update(self._gff)
     retgff.update(gff)
     return BasicGFF.togff(self,gff=retgff)