Public Member Functions | Public Attributes

bbcflib::btrack::text::TextTrack Class Reference

Inheritance diagram for bbcflib::btrack::text::TextTrack:
bbcflib::btrack::Track bbcflib::btrack::text::BedGraphTrack bbcflib::btrack::text::BedTrack bbcflib::btrack::text::GffTrack bbcflib::btrack::text::SgaTrack bbcflib::btrack::text::WigTrack

List of all members.

Public Member Functions

def __init__
def open
def close
def read
def write

Public Attributes

 separator
 intypes
 outtypes
 filehandle

Detailed Description

Generic Track class for text files (extension ".txt" or ".text"). 
Additional attributes:

.. attribute:: separator

   character separating fields in the file (default "\t").

.. attribute:: intypes

   Dictionary with keys field names and values functions that will be called on each item when reading the file.

.. attribute:: outtypes

   Dictionary with keys field names and values functions that will be called on each item when writing the file.

When reading a file, lines beginning with "browser", "track" or "#" are skipped.
The *info* attribute will be filled with "key=value" pairs found on a "track" line at the top of the file.
The *open" method takes the argument *mode" which can be *read* (default), *write*, *append* or *overwrite*.
Path can be a url, or a gzipped file.

Member Function Documentation

def bbcflib::btrack::text::TextTrack::write (   self,
  source,
  fields = None,
  mode = 'write',
  chrom = None,
  kw 
)
Add data to the track. Effectively writes in the related file.

:param source: (FeatureStream) data to be added to the track.
:param fields: list of field names.
:param mode: (str) file opening mode - one of 'write','overwrite','append'. ['write']
:param chrom: (str) a chromosome name.

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions