Package install :: Package MoSTBioDat :: Package DataBase :: Package ImportData :: Package DB2Data :: Module DB2PDB :: Class DB2PDB
[hide private]
[frames] | no frames]

Class DB2PDB

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 --+
                                                                               |
                                                                              DB2PDB


Import data from MacroMolecule DataBase into PDB file
INPUT:
    id - int, compound Id in Entry table, default False
    pdbcode - str, compound PDB code, default False
    dirpath - str, directory path
    pdbfile - str, pdb file path
    modelid - int, model id list or integer, default empty list
    tags - boolean, get tags, default False
    lowercasetablenames, boolean, MySQL lower case table setting, default True
    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
    rmHetmol - boolean, remove heteromolecule, 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:
pdb file

Instance Methods [hide private]
 
__init__(self, dirpath='', pdbfile='', 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
 
db2mol(self, logdebug=0, tabcolvaldict={}, lowercasetablenames=1, **kwarg)
INPUT: logdebug - boolean, debug logging tabcolvalidict - table column/value dictionary lowercasetablename - boolean, MySQL lower case table names setting OUTPUT: moldict - dict, molecule dictionary
source code
 
setseqres(self, chainreseqdict)
set SEQRES in pdb file INPUT: chainreseqdict - dict, data from ChainReSeq table {chain:[residue_name]} OUTPUT: seqresdict - dict, tag and tag value dictionary
source code
 
setscal(self, scaldatdict)
set SCALEn in pdb file INPUT: scaldatdict - list, data from ScalDat table OUTPUT: scaldict - dict, tag and tag value dictionary
source code
 
setorig(self, origdatdict)
set ORIGXn in pdb file INPUT: origdatdict - list, data from OrigDat table OUTPUT: origdict - dict, tag and tag value dictionary
source code
 
setmatrix(self, matrixdatdict)
set MTRIXn in pdb file INPUT: matrixdatdict - list, data from MatrixDat table OUTPUT: matrixdict - dict, tag and tag value dictionary
source code
 
setseqadv(self, seqadvdatdict, chaindict)
set SEQADV in pdb file INPUT: seqadvdatdict - list, data from SeqAdvDat table chaindict - dict, {chain_id: chain_name} OUTPUT: seqadvdict - dict, tag and tag value dictionary
source code
 
setjrnl(self, journaldatdict)
set JRNL in pdb file INPUT: journaldatdict - list, data from JournalDat table OUTPUT: journaldict - dict, tag and tag value dictionary
source code
 
setdbref(self, dbrefdatdict, chaindict)
set DBREF in pdb file dbrefdatdict - list, data from DBRefDat table chaindict - dict, {chain_id: chain_name} OUTPUT: dbrefdict - dict, tag and tag value dictionary
source code
 
setexpdta(self, experimdatdict)
set EXPDTA in pdb file INPUT: experimdatdict - list, data from ExperimDat table OUTPUT: expdatdict - dict, tag and tag value dictionary
source code
 
setheadertitlekeywds(self, headkeywdatdict)
set HEADER, KEYWDS and TITLE in pdb file INPUT: headkeywdatdict - list, data from HeadKeywDat table OUTPUT: headict - dict, tag and tag value dictionary
source code
 
splitline(self, tagvalue, linelen, specificator=' ', fillspec='')
Split specified string into list of strings INPUT: tagvalue - str, tag value linelen - int, line length specificator - str, split specificator fillspec - str, fill tag value to line length with specificator, default empty OUTPUT: linelist - list, list of strings
source code
 
createhetmoldict(self, hetdict, chaindict, modeldict, atomstatdict, molchargeflag=None, pdbsymbolflag=None, conntabdict={}, elemtabdict={}, hetflag=1)
create heteromolecule dictionary INPUT: hetdict - dict, heteromolecule table dictionary chaindict - dict, chain table dictionary modeldict - dict, model table dictionary atomstatdict - dict, heteromolecule atom stat table dictionary molchargeflag - boolean, set heteromolecule charge OE charge pdbsymbolflag - boolean, set hetermolecule pdb OE symbols altlocdict - dict, alternate location dictionary elemtabdict - dict, elements table dictionary, default empty OUTPUT: macmoldict - dict, macromolecule dictionary
source code
 
createmacmoldict(self, resdict, chaindict, modeldict, resatomsdict, resatomstatdict, altlocdict, elemtabdict={}, hetflag=0)
create macromolecule dictionary INPUT: resdict - dict, residue table dictionary chaindict - dict, chain table dictionary modeldict - dict, model table dictionary resatomsdict - dict, residue atoms table dictionary resatomstatdict - dict, residue atom stat table dictionary altlocdict - dict, alternate location dictionary elemtabdict - dict, elements table dictionary, default empty OUTPUT: macmoldict - dict, macromolecule dictionary
source code
 
checkIDB(self, getid, idb)
check whether specified value exists in database INPUT: getid - list, get Id idb - list, Id taken from database OUTPUT: corrconf - list, list of corrected id refid - list, list of refused id
source code
 
checkId(self, id)
check Id INPUT: Id - input Id OUTPUT: Id - output Id
source code
 
checkPropId(self, propname, propdefdict)
check whether specified value exists in database INPUT: propname - list, property name list propdefdict - dict, property definiction dictionary OUTPUT: tags - dict, property id: property name dictionary reftags - list, refused tag name list
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
 
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

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, dirpath='', pdbfile='', 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)