Back to index

python-biopython  1.60
Public Member Functions
Bio.SeqIO._index.TabRandomAccess Class Reference
Inheritance diagram for Bio.SeqIO._index.TabRandomAccess:
Inheritance graph
[legend]
Collaboration diagram for Bio.SeqIO._index.TabRandomAccess:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __iter__
def get_raw
def get

Detailed Description

Random access to a simple tabbed file.

Definition at line 956 of file _index.py.


Member Function Documentation

Returns (id,offset) tuples.

Reimplemented from Bio.SeqIO._index.SeqFileRandomAccess.

Definition at line 958 of file _index.py.

00958 
00959     def __iter__(self):
00960         handle = self._handle
00961         handle.seek(0)
00962         tab_char = _as_bytes("\t")
00963         while True:
00964             start_offset = handle.tell()
00965             line = handle.readline()
00966             if not line : break #End of file
00967             try:
00968                 key = line.split(tab_char)[0]
00969             except ValueError, err:
00970                 if not line.strip():
00971                     #Ignore blank lines
00972                     continue
00973                 else:
00974                     raise err
00975             else:
00976                 yield _bytes_to_string(key), start_offset, len(line)

Here is the call graph for this function:

def Bio.SeqIO._index.SeqFileRandomAccess.get (   self,
  offset 
) [inherited]
Returns SeqRecord.

Reimplemented in Bio.SeqIO._index.UniprotRandomAccess, Bio.SeqIO._index.SffTrimedRandomAccess, and Bio.SeqIO._index.SffRandomAccess.

Definition at line 540 of file _index.py.

00540 
00541     def get(self, offset):
00542         """Returns SeqRecord."""
00543         #Should be overriden for binary file formats etc:
00544         return self._parse(StringIO(_bytes_to_string(self.get_raw(offset))))

Here is the call graph for this function:

def Bio.SeqIO._index.TabRandomAccess.get_raw (   self,
  offset 
)
Like the get method, but returns the record as a raw string.

Reimplemented from Bio.SeqIO._index.SeqFileRandomAccess.

Definition at line 977 of file _index.py.

00977 
00978     def get_raw(self, offset):
00979         """Like the get method, but returns the record as a raw string."""
00980         handle = self._handle
00981         handle.seek(offset)
00982         return handle.readline()
00983 


The documentation for this class was generated from the following file: