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

def Bio::SeqIO::StockholmIO::StockholmIterator::__getitem__ (   self,

Provides random access to the SeqRecords

Definition at line 251 of file StockholmIO.py.

00251                             :
        """Provides random access to the SeqRecords"""
        if i < 0 or i >= len(self.ids) : raise ValueError
        id = self.ids[i]
        seq_len = len(self.sequences[id])

        name, start, end = self._identifier_split(id)

        record = SeqRecord(Seq(self.sequences[id], self.alphabet), id=id, name=name, description=id)

        if start : record.annotations["start"] = int(start)
        if end   : record.annotations["end"]   = int(end)
        #will be overridden by _populate_meta_data if an explicit accession is provided:
        self._populate_meta_data(id, record)

        #DO NOT TOUCH self._n
        return record

class StockholmWriter(SequentialSequenceWriter):

Generated by  Doxygen 1.6.0   Back to index