Package mmLib :: Module mmCIF :: Class mmCIFTable
[hide private]
[frames] | no frames]

Class mmCIFTable

source code

object --+    
         |    
      list --+
             |
            mmCIFTable

Contains columns and rows of data for a mmCIF section. Rows of data are stored as mmCIFRow classes.

Instance Methods [hide private]
new empty list
__init__(self, name, columns=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__deepcopy__(self, memo) source code
 
__eq__(self, other)
x==y
source code
 
is_single(self)
Return true if the table is not a _loop table with multiple rows of data.
source code
 
__getattr__(self, name) source code
 
__getitem__(self, x)
Retrieves mmCIFRow at index x from the table if the argument is an integer.
source code
 
__setitem__(self, x, value)
x[i]=y
source code
 
__delitem__(self, i)
del x[y]
source code
 
get(self, x, default=None) source code
 
append(self, row)
append object to end
source code
 
insert(self, i, row)
insert object before index
source code
 
remove(self, row)
remove first occurrence of value.
source code
 
set_columns(self, columns)
Sets the list of column(subsection) names to the list of names in columns.
source code
 
append_column(self, column)
Appends a column(subsection) name to the table.
source code
 
has_column(self, column)
Tests if the table contains the column name.
source code
 
remove_column(self, column)
Removes the column name from the table.
source code
 
autoset_columns(self)
Automatically sets the mmCIFTable column names by inspecting all mmCIFRow objects it contains.
source code
 
get_row1(self, clower, value)
Return the first row which which has column data matching value.
source code
 
get_row(self, *args)
Preforms a SQL-like 'AND' select aginst all the rows in the table, and returns the first matching row found.
source code
 
new_row(self)
Creates a new mmCIF rows, addes it to the table, and returns it.
source code
 
iter_rows(self, *args)
This is the same as get_row, but it iterates over all matching rows in the table.
source code
 
row_index_dict(self, clower)
Return a dictionary mapping the value of the row's value in column 'key' to the row itself.
source code

Inherited from list: __add__, __contains__, __delslice__, __ge__, __getattribute__, __getslice__, __gt__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setslice__, __sizeof__, count, extend, index, pop, reverse, sort

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from list: __hash__

Properties [hide private]
  columns
  columns_lower
  data
  name

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, columns=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns: new empty list
Overrides: object.__init__
(inherited documentation)

__eq__(self, other)
(Equality operator)

source code 

x==y

Overrides: list.__eq__
(inherited documentation)

__getitem__(self, x)
(Indexing operator)

source code 

Retrieves mmCIFRow at index x from the table if the argument is an integer. If the argument is a string, then the data from the first row is returned.

Overrides: list.__getitem__

__setitem__(self, x, value)
(Index assignment operator)

source code 

x[i]=y

Overrides: list.__setitem__
(inherited documentation)

__delitem__(self, i)
(Index deletion operator)

source code 

del x[y]

Overrides: list.__delitem__
(inherited documentation)

append(self, row)

source code 

append object to end

Overrides: list.append
(inherited documentation)

insert(self, i, row)

source code 

insert object before index

Overrides: list.insert
(inherited documentation)

remove(self, row)

source code 

remove first occurrence of value. Raises ValueError if the value is not present.

Overrides: list.remove
(inherited documentation)

get_row(self, *args)

source code 
Preforms a SQL-like 'AND' select aginst all the rows in the table,
and returns the first matching row found. The arguments are a
variable list of tuples of the form:
  (<lower-case-column-name>, <column-value>)
For example:
  get_row(('atom_id','CA'),('entity_id', '1'))
returns the first matching row with atom_id==1 and entity_id==1.

row_index_dict(self, clower)

source code 

Return a dictionary mapping the value of the row's value in column 'key' to the row itself. If there are multiple rows with the same key value, they will be overwritten with the last found row.