예제 #1
0
    def __init__(self, stream, locus):
        GBRecord.__init__(self, stream, locus)

        self["location"] = None
        keywords = info.parse(stream)
        if len(keywords) == 1 and "contig" in keywords:
            self["location"] = keywords["contig"]
        elif len(keywords) != 0:
            stream.throw("Invalid info parsed: %s" % keywords)
        
        line = stream.next().strip()
        if line != "//":
            stream.throw("Unexpected data after CONTIG: %s" % line)
예제 #2
0
    def __init__(self, stream, locus, stream_seq):
        GBRecord.__init__(self, stream, locus)

        self["counts"] = {}        
        keywords = info.parse(stream)
        if len(keywords) == 1 and "base count" in keywords:
            self["counts"] = keywords["base count"]
        elif len(keywords) != 0:
            stream.throw("Invalid info parsed: %s" % keywords)

        line = iter(stream).next()
        if line.strip() != "ORIGIN":
            stream.throw("Invalid ORIGIN line: %s" % line.strip())
        
        self.stream = stream
        if not stream_seq:
            self["sequence"] = ''.join(list(iter(self)))