Logo Search packages:      
Sourcecode: python-biopython version File versions  Download package

def Bio::GenBank::Scanner::GenBankScanner::parse_footer (   self  ) 

returns a tuple containing a list of any misc strings, and the sequence

Reimplemented from Bio::GenBank::Scanner::InsdcScanner.

Definition at line 736 of file Scanner.py.

00736                           :
        """returns a tuple containing a list of any misc strings, and the sequence"""
        assert self.line[:self.HEADER_WIDTH].rstrip() in self.SEQUENCE_HEADERS, \
               "Eh? '%s'" % self.line

        misc_lines = []
        while self.line[:self.HEADER_WIDTH].rstrip() in self.SEQUENCE_HEADERS \
        or self.line[:self.HEADER_WIDTH] == " "*self.HEADER_WIDTH \
        or "WGS" == self.line[:3]:
#            if self.line[-1] == "\n" : self.line = self.line[:-1]
            self.line = self.line.rstrip(os.linesep)
            self.line = self.handle.readline()
            if not self.line:
                raise ValueError("Premature end of file")
            self.line = self.line

        assert self.line[:self.HEADER_WIDTH].rstrip() not in self.SEQUENCE_HEADERS, \
               "Eh? '%s'" % self.line

        #Now just consume the sequence lines until reach the // marker
        #or a CONTIG line
        seq_lines = []
        line = self.line
        while True:
            if not line:
                raise ValueError("Premature end of file in sequence data")
            line = line.rstrip()
            if not line:
                import warnings
                warnings.warn("Blank line in sequence data")
                line = self.handle.readline()
            if line=='//':
            if line.find('CONTIG')==0:
            if len(line) > 9 and  line[9:10]!=' ':
                raise ValueError("Sequence line mal-formed, '%s'" % line)
            seq_lines.append(line[10:].replace(" ",""))
            line = self.handle.readline()

        self.line = line
        #Seq("".join(seq_lines), self.alphabet)
        return (misc_lines,"".join(seq_lines))

    def _feed_first_line(self, consumer, line):

Generated by  Doxygen 1.6.0   Back to index