Package CHEM :: Package Web :: Package cgibin :: Module smi2gif
[hide private]
[frames] | no frames]

Module smi2gif



Functions [hide private]
 
main(argv)
 
extractSmiles(inputStr)
 
generateGif(smiles, options)
 
cacheImage(imagePath, gifBytes)
Write the respective image bytes to a file for cache storage / retrieval.
 
makeCurrent(imagePath)
Update the modified / accessed date of the file to the current time.
 
quoteFilepath(filepath)
Neutralize any special characters for use as a filepath, including '/' which could be a SMILES character.
Variables [hide private]
  PIXSCALE = 25
  CACHE_DIR = 'cache'
  IMAGE_SUFFIX = '.gif'
  MAX_CACHE_SIZE = 1000
  CACHE_SCALEBACK = 100
Function Details [hide private]

cacheImage(imagePath, gifBytes)

 
Write the respective image bytes to a file for cache storage / retrieval. While here, check if exceeded maximum cache size. If so, scaleback.

makeCurrent(imagePath)

 
Update the modified / accessed date of the file to the current time. This has the effect of bringing the file to the head of the cache so it won't be removed if a cache scaleback occurs soon.

quoteFilepath(filepath)

 
Neutralize any special characters for use as a filepath, including '/' which could be a SMILES character. Additional issue on Windows systems: File names are NOT case-sensitive. This is a problem for SMILES strings where upper vs. lowercase atom labels is necessary to distinguish aromatic vs. aliphatic atoms.