cif
index

module for reading and writing mmCif files.
 
This module allows for reading/writing of arbitrary Cif data. Data is
stored in a three-level hierarchy. The base level is Datablock. For
PDBx files, these blocks are named by PDB ID, e.g. "1GB1", each
introduced by lines starting with data_BLOCKNAME, where BLOCKNAME is
replaced by the name of the block. Each datablock consists of multiple
categories, e.g. citation and atom_site, the later of which contains
atomic coordinate information. Categories are introduced in a cif file
with lines starting with _CATEGORYNAME, where CATEGORYNAME is replaced
with the name of the category. In the cif file, each category contains
one or more item names separated from the category name by a "."
character. Within a category each item can contain a single value, or
a list of values when the category is begun with a line starting with
the string "loop_". Within a single category, all items have the same
number of values. An item example is the Cartesian x atomic coordinate
given by the category.item: _atom_site.Cartn_x. Item/value specifications
are separated by white space. White space within a value must be
quoted. Items which consist of multiple lines begin with the sequence
"\n;" and end with the sequence "\n;\n"
 
This module can also load nmrStar-formatted files: saveframes
introduced by \nsave_ are read in as datablocks. Additionally,
zero-length value list are supported.
 
The toplevel object type is Cif:
 
Constructor:
 
  Cif()
 
Methods:
 
  size()               - the number of datablocks loaded
  keys()               - return an (ordered) list of datablock names.
  getDatablock(string) - return the named datablock
 
  addDatablock(string,
               datablock) - add a new, named CifDatablock.
 
  clear()              - clear all datablocks.
 
 
  parse(string)        - load cif entries by parsing a Cif-formatted string
  
  asString()           - return a string representation of the Cif object.
 
Accessors:
    [Values are read using  form quantity(), while they are set using the 
     form setQuantity(value).]
 
  modelToRead          - which mmCIF model (_atom_site.pdbx_PDB_model_num) 
                         to read. Default value of -1 specifies all models.
  numDatablocksToRead  - How many datablocks to read. One can specify
                         which blocks to read using datablocksToRead.
                         However, it's frequently more convenient to 
                         specify 1 for this. The default value of -1 
                         specifies all datablocks.
 
  useTrailingPound     - after each _loop category, print a line consisting
                         solely of the '#' character.
  useTrailingStop      - after each _loop category, print a line consisting
                         of the literal "stop_"
  useTrailingSave      - at the end of each save frame, print a line 
                         consisting of the literal "save_"
  catsUseLoops         - controls write-out behavior such that
                         categories after the first include all items in
                         loops. This seems to be required for NEF files.
 
Members:
 
  datablocksToRead          - if specified, only read the named datablocks.
  setDatablocksToRead(list)   Use the set accessor in the Python interface.
  categoriesToRead          - if specified, only read the named categories.
  setCategoriesToRead(list)   Use the set accessor in the Python interface.
 
In addition to the getDatablock method, the __getitem__ method has
been defined such that, e.g.
 
  data = Cif(); data.parse(input)
  block = data['1GB1']
 
will return the appropriate datablock. New datablocks can be added using the
__set_item__ method:
 
  data['1GB1'] = datablock
 
 
 
 
The CifDatablock Object:
 
Constructor:
 
  CifDatablock()
 
Methods:
 
  size()                - the number of categories present
  keys()                - an ordered list of category names
  getCategory(string)   - return the specified category
 
  addCategory(string,   
              category) - add a new, named CifCategory
  
  isSaveframe()         - whether this block is actually a saveframe.
                          Saveframes which are read in have a
                          begin with a category including the literal
                          "category" with an identifying name. The NEF
                          convention is that the identifying name is
                          same as that of this category.
 
  setIsSaveFrame(val)   - (for writing), specify whether the datablock is
                          actually a saveframe.  
 
  clear()               - clear all categories
 
In addition to the getCategory method, categories can be accessed via
__getitem__, or __getattr__: e.g.
 
block['atom_site'] or block.atom_site
 
New Categories can be added using the __set_item__ method:
 
block['atom_site'] = category
 
 
The CifCategory Object:
 
Constructor:
 
  CifCategory()
 
Methods:
 
  size()            - the number of items present
  keys()            - an ordered list of item names
 
  getValues(string) - return the values associated with the specified 
                      item name.
 
  addKey(string)    - add the specified item name
  addValue(key,     - add a value to the item list associated with the
           value)     specified item name.
   
  clear()           - clear all items.
  clearValues()     - resize all value lists to zero size.
 
  asTable(list)     - The argument is a sequence of item names. The return
                      value is a list of sequences of the form
                          [ value1_i, value2_i, ... ]
                      where valueN_i corresponds to getValues(itemN)[i].
 
In addition to the getValues method, items can be access via
__getitem__ and __getattr__ methods: e.g.
 
 
block['atom_site']['Cartn_x']
 
or
 
block.atom_site.Cartn_x
 
New Objects containing single values can be added using the __set_item__method:
 
category['name'] = "a value"
 
Module Functions
 
  unknownValue()    - return string which represents unknown values (?)
  inapplicableValue - return string which represents inapplicable values (.)
 
 
 
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

 
Classes
       
builtins.object
CDSList_CDSList_String
Cif
CifCategory
CifDatablock

 
class CDSList_CDSList_String(builtins.object)
    CDSList_CDSList_String(*args)
 

 
  Methods defined here:
__delitem__(self, *args, **kwargs) -> 'void'
__getitem__(self, *args) -> 'CDSList< CDSList< String,10 > >'
__getslice__(self, *args, **kwargs) -> 'CDSList< CDSList< String,10 > >'
__init__(self, *args)
Initialize self.  See help(type(self)) for accurate signature.
__len__(self, *args, **kwargs) -> 'int'
__repr__ = _swig_repr(self)
__setitem__(self, *args, **kwargs) -> 'void'
append(self, *args, **kwargs) -> 'void'
help(self, *args, **kwargs) -> 'String'
remove(self, *args, **kwargs) -> 'void'
removeAll(self, *args, **kwargs) -> 'void'

Static methods defined here:
__swig_destroy__ = delete_CDSList_CDSList_String(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
class Cif(builtins.object)
    Cif(*args, **kwargs)
 

 
  Methods defined here:
__contains__(s, attr)
__getattr__(s, attr)
__getitem__(s, key)
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
__setitem__(s, key, val)
addDatablock(self, *args, **kwargs) -> 'void'
asString(self, *args, **kwargs) -> 'String'
catsUseLoops(self, *args, **kwargs) -> 'bool const'
clear(self, *args, **kwargs) -> 'void'
formatBlock(self, *args, **kwargs) -> 'ostream &'
formatCategory(self, *args, **kwargs) -> 'ostream &'
getDatablock(self, *args, **kwargs) -> 'CifDatablock &'
keys(self, *args, **kwargs) -> 'CDSList< String > const &'
modelToRead(self, *args, **kwargs) -> 'int const'
numDatablocksToRead(self, *args, **kwargs) -> 'int'
okBlockAndCategory(self, *args, **kwargs) -> 'bool'
okDatablock(self, *args, **kwargs) -> 'bool'
parse(self, *args) -> 'String'
pyXplorHelp(self, *args, **kwargs) -> 'String'
quoteData(self, *args, **kwargs) -> 'String'
setCategoriesToRead(self, *args, **kwargs) -> 'void'
setCatsUseLoops(self, *args, **kwargs) -> 'void'
setDatablocksToRead(self, *args, **kwargs) -> 'void'
setModelToRead(self, *args, **kwargs) -> 'void'
setNumDatablocksToRead(self, *args, **kwargs) -> 'void'
setUseTrailingPound(self, *args, **kwargs) -> 'void'
setUseTrailingSave(self, *args, **kwargs) -> 'void'
setUseTrailingStop(self, *args, **kwargs) -> 'void'
size(self, *args, **kwargs) -> 'int'
useTrailingPound(self, *args, **kwargs) -> 'bool const'
useTrailingSave(self, *args, **kwargs) -> 'bool const'
useTrailingStop(self, *args, **kwargs) -> 'bool const'
write(self, *args, **kwargs) -> 'void'

Static methods defined here:
__swig_destroy__ = delete_Cif(...)
getCategory(*args, **kwargs) -> 'String'
getItem(*args, **kwargs) -> 'String'

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
categoriesToRead

 
datablocksToRead

 
thisown

 
The membership flag

Data and other attributes defined here:
inapplicableValue = <Swig Object of type 'String *'>
unknownValue = <Swig Object of type 'String *'>

 
class CifCategory(builtins.object)
    CifCategory(*args, **kwargs)
 

 
  Methods defined here:
__contains__(s, attr)
__getattr__(s, attr)
__getitem__(s, key)
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
__setitem__(s, key, val)
addKey(self, *args, **kwargs) -> 'bool'
addValue(self, *args, **kwargs) -> 'bool'
asTable(self, *args, **kwargs) -> 'CDSList< CDSList< String > >'
clear(self, *args, **kwargs) -> 'void'
clearValues(self, *args, **kwargs) -> 'void'
getValues(self, *args, **kwargs) -> 'CDSList< String > const &'
keys(self, *args, **kwargs) -> 'CDSList< String > const &'
size(self, *args, **kwargs) -> 'int'

Static methods defined here:
__swig_destroy__ = delete_CifCategory(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
class CifDatablock(builtins.object)
    CifDatablock(*args, **kwargs)
 

 
  Methods defined here:
__contains__(s, attr)
__getattr__(s, attr)
__getitem__(s, key)
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
__setitem__(s, key, val)
addCategory(self, *args, **kwargs) -> 'void'
clear(self, *args, **kwargs) -> 'void'
getCategory(self, *args, **kwargs) -> 'CifCategory const &'
isSaveframe(self, *args, **kwargs) -> 'bool const'
keys(self, *args, **kwargs) -> 'CDSList< String > const &'
setIsSaveframe(self, *args, **kwargs) -> 'void'
size(self, *args, **kwargs) -> 'int'

Static methods defined here:
__swig_destroy__ = delete_CifDatablock(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
Functions
       
Cif_getCategory(*args, **kwargs) -> 'String'
Cif_getItem(*args, **kwargs) -> 'String'
inapplicableValue(*args) -> 'String const &'
pyXplorHelp(*args) -> 'String'
unknownValue(*args) -> 'String const &'

 
Data
        cvar = <Swig global variables>