Package install :: Package MoSTBioDat :: Package DataBase :: Package ImportData :: Package Data2DB :: Module PDB2DB :: Class PDB2DB
[hide private]
[frames] | no frames]

Class PDB2DB

source code

                                                          object --+            
                                                                   |            
               MoSTBioDat.DataBase.Connect.MoSTBioDatDB.MoSTBioDatDB --+        
                                                                       |        
            MoSTBioDat.DataBase.Scheme.MoSTBioDatScheme.MoSTBioDatScheme --+    
                                                                           |    
                  MoSTBioDat.DataBase.ImportData.Data2DB.TaBuilder.TaBuilder --+
                                                                               |
                                                              object --+       |
                                                                       |       |
          MoSTBioDat.DataBase.ImportData.Data2DB.InserTables.InserTables --+   |
                                                                           |   |
MoSTBioDat.DataBase.ImportData.Data2DB.InsertMacMolTables.InsertMacMolTables --+
                                                                               |
                                                                              PDB2DB


Import data from PDB file into MacroMolecule database
INPUT:
    host - string, host to connect
    user - string, user to connect as
    passwd - string, password to use
    db - string, database to use
    port - integer, TCP/IP port to connect 
    log - boolean, logging flag
    ligandb - string, ligand database name
    repflag - boolean, print report, default False
    unix_socket - string, location of unix_socket to use
    conv - conversion dictionary, see MySQLdb.converters
    connect_timeout - number of seconds to wait before the connection attempt fails.
    compress - if set, compression is enabled
    named_pipe - if set, a named pipe is used to connect (Windows only)
    init_command - command which is run once the connection is created
    read_default_file - file from which default client values are read
    read_default_group -  configuration group to use from the default file
    cursorclass - class object, used to create cursors (keyword only)
    use_unicode - if True, text-like columns are returned as unicode objects
                  using the connection's character set.  Otherwise, text-like
                  columns are returned as strings.  columns are returned as
                  normal strings. Unicode objects will always be encoded to
                  the connection's character set regardless of this setting.
    charset - if supplied, the connection character set will be changed
                  to this character set (MySQL-4.1 and newer). This implies
                  use_unicode=True.
    sql_mode - if supplied, the session SQL mode will be changed to this
               setting (MySQL-4.1 and newer). For more details and legal
               values, see the MySQL documentation.  
    client_flag -  integer, flags to use or 0
                   (see MySQL docs or constants/CLIENTS.py)
    ssl - dictionary or mapping, contains SSL connection parameters;
          see the MySQL documentation for more details
          (mysql_ssl_set()).  If this is set, and the client does not
          support SSL, NotSupportedError will be raised.
    local_infile - integer, non-zero enables LOAD LOCAL INFILE; zero disables
    format - string format for log handler
    filter - filter object from logger object
    datefmt - data/time format
    path - directory path to log file
    filename - log filename, default log
    filemode - mode to open log file, default='a'
    level - set root logger level to specified level
    logfilelevel- set level to log file
    cache - create cache for query, default=True
    scheme2file - Boolean - save database scheme to shelve file

OUTPUT:
class object

Instance Methods [hide private]
 
__init__(self, pdbfilepath, host='localhost', db='macmol', user=None, passwd=None, port=3306, ligandb=' ', log=0, **kwargs)
INPUT: host - string, host to connect user - string, user to connect as passwd - string, password to use db - string, database to use port - integer, TCP/IP port to connect to unix_socket - string, location of unix_socket to use conv - conversion dictionary, see MySQLdb.converters connect_timeout - number of seconds to wait before the connection attempt fails.
source code
 
PDB2Tab(self, tabcolvaldict={}, logdebug=0, lowercasetablenames=1, addH=0, rmHetmol=0)
import data from pdb file to database tables INPUT: class object lowercasetablenames - boolean, lower case table names MySQL engine settings, default True logdebug - boolean, debug logging, default False addH - add hydrogens with OpenEye software, default False rmHetmol - remove heteromolecule, default False OUTPUT: importing data to database
source code
 
addConf(self, tabcolvaldict={}, logdebug=0, lowercasetablenames=1, addH=0, rmHetmol=0, rmMacmol=0)
add conformation from pdb file to database tables INPUT: class object lowercasetablenames - boolean, lower case table names MySQL engine settings, default True logdebug - boolean, debug logging, default False addH - add hydrogens with OpenEye software, default False rmHetmol - remove heteromolecule, default False rmMacMol - remove macromolecule, default False - if True - import only to Residue table OUTPUT: importing data to database
source code
 
getmacmolheader(self, macmolspecific)
get macromolecular contents from pdb COMPND records INPUT: macmolspecific - list of records from pdb COMPND tag OUTPUT: macmoldescdict - dict, macromolecular description dictionary
source code
 
getorigx(self, origx, keyname, transvecname, number)
get transformation matrix from orthogonal to submitted coordinates INPUT: orig -list, list of transformation items keyname - str, dictionary key name transvecname - str, transformation vector name number - int, matrix row number OUTPUT: origxdict - dict, transformation dictionary
source code
 
getscale(self, origx, keyname, transvecname, number)
get transformation matrix from orthogonal to fractional crystallogrpahic coordinates INPUT: orig -list, list of transformation items keyname - str, dictionary key name transvecname - str, transformation vector name number - int, matrix row number OUTPUT: origxdict - dict, transformation dictionary
source code
 
getmatrix(self, mtrix, number)
get transformation matrix expressing non-crystallographic symmetry INPUT: mtrix -list, list of transformation items number - int, matrix row number OUTPUT: mtrxdict - dict, transformation dictionary
source code
 
getdbref(self, dbref)
get cross-reference database links INPUT: dbref - list, list of reference items OUTPUT: dbreflist - list, database reference list
source code
 
getseqadv(self, seqadv)
get conflicts between SEQRES and DBREF INPUT: seqadv - list, list of conflicts items OUTPUT: seqadvlist - list, conflicts list
source code
 
getjournal(self, jrnl)
get journal dictionary INPUT: jrnl - list of records from pdb JRNL tag OUTPUT: journaldict - dict, journal dictionary
source code
 
gethetatname(self, hetatname)
get heteroatom name dictionary INPUT: hetatname - list, list of records from pdb HETNAM tag OUTPUT: hetatnamedict - dict, heteroatom name dictionary
source code
 
getitle(self, title, key)
get title dictionary INPUT: title - list, list of records from pdb TITLE tag OUTPUT: titledict - dict, title dictionary
source code
 
getkeyword(self, title, key)
get title dictionary INPUT: title - list, list of records from pdb TITLE tag OUTPUT: titledict - dict, title dictionary
source code
 
getexperimdat(self, title, key)
get title dictionary INPUT: title - list, list of records from pdb TITLE tag OUTPUT: titledict - dict, title dictionary
source code
 
getformul(self, formul)
get formula dictionary INPUT: formul - list, list of records from pdb FORMUL tag OUTPUT: formuldict - dict, formula dictionary
source code
 
getseqres(self, seqres)
get sequence of residues in each chain INPUT: seqres - list, list of records from pdb SEQRES tag OUTPUT: seqresdict - dict, sequence of residues dictionary
source code
 
gethet(self, het)
get het molecule description INPUT: het - list, list of records from pdb HET tag OUTPUT: hetdict - dict, het description dictionary
source code
 
getssbond(self, ssbond)
get ssbond molecule description INPUT: ssbond - list, list of records from pdb SSBOND tag OUTPUT: ssbondict - dict, symmetry disulfide bond dictionary
source code
 
getheader(self, header)
get header molecule description INPUT: ssbond - list, list of records from pdb SSBOND tag OUTPUT: ssbondict - dict, symmetry disulfide bond dictionary
source code
 
prepmoldict(self, macmoldescdict={}, ligmoldescdict={}, compndesc={}, machainlist={}, hetdict={}, hetatdict={}, formuldict={})
prepare molecule table input dictionary INPUT: macmoldescdict - dict, macromolecule description dictionary ligmoldescdict - dict, ligand description dictionary compdesc - dict, macromolecule description dictionary from pdb COMPND tags machainlist - list, macromolecule chain list hetdict - dict, het description dictionary OUTPUT: moldict - dict, molecule table input dictionary
source code
 
getmol(self, repflag=1, rmHetmol=0)
get ligand and macromolecule sorted list of tuples from pdb file INPUT: class object repflag - boolean, residue flag, default True rmHetmol - boolean, remove heteromolecule, default False OUTPUT: ligand and macromolecule sorted list of tuples
source code
 
isTabDesCorr(self, tablename, tabcol)
check macromolecule table description with table name INPUT: tablename- name of table tabcol - list of column names OUTPUT: boolean
source code
 
isMacMolTabDesCorr(self, tablename, tabcol)
check macromolecule table description with table name INPUT: tablename- name of table tabcol - list of column names OUTPUT: boolean
source code
 
createmol(self, molist, moldict, rmHetmol=1, addH=0)
create oe molecule object class INPUT: molist - list, sorted molecule list of tuples moldict - dict, molecule dictionary rmHetmol - boolean, remove hetero molecule, default True addH - boolean, add hydrogens, default False OUTPUT: altloclist - list, alternate location list modelist - list, model list chainlist - list, chain list moldescdict - dict, molecule description dictionary molnamedict - dict, molecule name dictionary
source code

Inherited from MoSTBioDat.DataBase.ImportData.Data2DB.TaBuilder.TaBuilder: genColumn, genTable, genTables, getFKDesc, isFK, isKey, isNull, parseType

Inherited from MoSTBioDat.DataBase.Scheme.MoSTBioDatScheme.MoSTBioDatScheme: createdict, executeQuery, geTableDesc, geTables, geTablesDesc, lastInsID

Inherited from MoSTBioDat.DataBase.Connect.MoSTBioDatDB.MoSTBioDatDB: __repr__, autocommit, closeDB, commit, connectDB, displayStatus, executeFileQuery, getClientInfo, getConnectPort, isDB, lockTable, rollback, starTransaction, unlockTables

Inherited from MoSTBioDat.DataBase.ImportData.Data2DB.InsertMacMolTables.InsertMacMolTables: AltLoc, Chain, ChainMol, ChainReSeq, DBRefDat, Entry, ExperimDat, HeadKeywDat, HetMol, JournalDat, MatrixDat, Model, Molecule, OrigDat, ReSSBond, ResAtomStat, ResAtoms, Residue, ScalDat, SeqAdvDat, User, getAltLoc, getChain, getChainMol, getChainReSeq, getCurrenTime, getDBRefDat, getEntry, getExperimDat, getHeadKeywDat, getHetMol, getJournalDat, getMatrixDat, getModel, getMolecule, getOrigDat, getResAtomStat, getResAtoms, getResidue, getScalDat, getSeqAdvDat

Inherited from MoSTBioDat.DataBase.ImportData.Data2DB.InserTables.InserTables: AtomStat, Atoms, ChemComp, ConfStat, ConnTab, ElemTab, Prop2Tab, PropDef, ProtStat, UserAtoms, UserChemComp, UserConnTab, UserProp2Tab, UserPropDef, UserProtStat, getAtomStatonIdFk, getAtomsonIdFk, getChemCompIdIsoSmi, getChemComponIdIsoSmiZINCode, getConfStatonIdFk, getConnTabonIdFk, getElemTab, getPropDef, getProponIdFk, getProtStat, getProtStatonIdFk, insertrecord, ligvalidrecord, uservalidrecord, validrecord

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Static Methods [hide private]

Inherited from MoSTBioDat.DataBase.Connect.MoSTBioDatDB.MoSTBioDatDB: getNumberConnect

Class Variables [hide private]

Inherited from MoSTBioDat.DataBase.Connect.MoSTBioDatDB.MoSTBioDatDB: db, host, numberConn, port

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, pdbfilepath, host='localhost', db='macmol', user=None, passwd=None, port=3306, ligandb=' ', log=0, **kwargs)
(Constructor)

source code 

INPUT:
host - string, host to connect
user - string, user to connect as
passwd - string, password to use
db - string, database to use
port - integer, TCP/IP port to connect to
unix_socket - string, location of unix_socket to use
conv - conversion dictionary, see MySQLdb.converters
connect_timeout - number of seconds to wait before the connection attempt fails.
compress - if set, compression is enabled
named_pipe - if set, a named pipe is used to connect (Windows only)
init_command - command which is run once the connection is created
read_default_file - file from which default client values are read
read_default_group -  configuration group to use from the default file
cursorclass - class object, used to create cursors (keyword only)
use_unicode - if True, text-like columns are returned as unicode objects
              using the connection's character set.  Otherwise, text-like
              columns are returned as strings.  columns are returned as
              normal strings. Unicode objects will always be encoded to
              the connection's character set regardless of this setting.
charset - if supplied, the connection character set will be changed
              to this character set (MySQL-4.1 and newer). This implies
              use_unicode=True.
sql_mode - if supplied, the session SQL mode will be changed to this
           setting (MySQL-4.1 and newer). For more details and legal
           values, see the MySQL documentation.  
client_flag -  integer, flags to use or 0
               (see MySQL docs or constants/CLIENTS.py)
ssl - dictionary or mapping, contains SSL connection parameters;
      see the MySQL documentation for more details
      (mysql_ssl_set()).  If this is set, and the client does not
      support SSL, NotSupportedError will be raised.
local_infile - integer, non-zero enables LOAD LOCAL INFILE; zero disables
format - string format for log handler
filter - filter object from logger object
datefmt - data/time format
path - directory path to log file
filename - log filename, default log
filemode - mode to open log file, default='a'
level - set root logger level to specified level
logfilelevel- set level to log file
OUTPUT:
class object 

Overrides: object.__init__
(inherited documentation)