Package CHEM :: Package Common :: Module Smi2Depict
[hide private]
[frames] | no frames]

Module Smi2Depict



Given a list of molecules in SMILES format, map / translate the characters
to codes useable by the Daylight Depict web service.  This is a temporary
helper until we have our own graphical molecule depiction program setup.

Input: 
- smilesFile:  Molecule file
    Assumed to be in SMILES format, with one molecule string per line, 
    possibly followed by a title.
    Can take stdin as source by specifying the filename "-"

Output:
- depictFile:  Molecules as Depict encoded strings
    Output is the the molecule strings translated into an encoded form understandable
    by the Daylight Depict webservice.  Furthermore, these are written as html
    img objects, for direct usage as an html web page.
    
    Again, redirection to stdout possible by specifying the filename "-"



Classes [hide private]
  Smi2Depict
Functions [hide private]
 
main(argv)
Callable from command-line, but don't bother right now
Variables [hide private]
  MAX_CACHE_SIZE = 1000
  CACHE_SCALEBACK = 100
  SMI2DEPICT_MAP = dict(((' ', "20"), ('!', "21"), ('"', "22"), ...
  IMG_PREFIX = '<img width=%s height=%s src="'
  IMG_SUFFIX = '" alt="%s %s" border=0>'
  IMAGE_TEMPLATE = '<img width=%(width)s height=%(height)s src="...
  OGHAM_URL = 'http://%(hostname)s/CHEM/Web/cgibin/smi2gif.py?--...
  CHEMAXON_MARVIN_URL = 'http://%(hostname)s/arrow-webapp/ArrowW...
  DAYLIGHT_PREFIX = '<img width=%s height=%s src="'
  DAYLIGHT_SUFFIX = '" alt="%s %s">'
  DAYLIGHT_URL = 'http://www.daylight.com/daycgi/smi2gif?'
  JME_HTML = '<applet code="JME.class" archive="/CHEM/Web/resour...
  ENCRYPT_KEY = "enigma2004"
Variables Details [hide private]

SMI2DEPICT_MAP

Value:
dict(((' ', "20"), ('!', "21"), ('"', "22"), ('#', "23"), ('$', "24"),\
 ('%', "25"), ('&', "26"), ('\'', "27"), ('(', "28"), (')', "29"), ('*\
', "2A"), ('+', "2B"), (',', "2C"), ('-', "2D"), ('.', "2E"), ('/', "2\
F"), ('0', "30"), ('1', "31"), ('2', "32"), ('3', "33"), ('4', "34"), \
('5', "35"), ('6', "36"), ('7', "37"), ('8', "38"), ('9', "39"), (':',\
 "3A"), (';', "3B"), ('<', "3C"), ('=', "3D"), ('>', "3E"), ('?', "3F"\
), ('@', "40"), ('A', "41"), ('B', "42"), ('C', "43"), ('D', "44"), ('\
E', "45"), ('F', "46"), ('G', "47"), ('H', "48"), ('I', "49"), ('J', "\
...

IMAGE_TEMPLATE

Value:
'<img width=%(width)s height=%(height)s src="%(url)s" alt="%(smiles)s \
%(title)s" border=0>'

OGHAM_URL

Value:
'http://%(hostname)s/CHEM/Web/cgibin/smi2gif.py?--cob+--width+%(width)\
s+--height+%(height)s+--noencrypt+%(quotedSmiles)s'

CHEMAXON_MARVIN_URL

Value:
'http://%(hostname)s/arrow-webapp/ArrowWebService?action=smi2png&smile\
s=%(quotedSmiles)s&width=%(width)s&height=%(height)s&arrowdesc=%(arrow\
desc)s'

JME_HTML

Value:
'<applet code="JME.class" archive="/CHEM/Web/resource/JME.jar" width=%\
s height=%s><param name="options" value="depict"><param name="mol" val\
ue="%s"></applet>'