def MMFFsmiles23D(ctab, multi=False): """ Generate 3D coordinates from SMILES using Merck Molecular Force Field. CTAB is urlsafe_base64 encoded string containing single molfile or concatenation of multiple molfiles. """ data = base64.urlsafe_b64decode(ctab) return _smiles23D(data, int(multi), True)
def smiles23D(): """ Generate 3D coordinates from SMILES using Universal Force Field. CTAB is either single molfile or SDF file. """ multi = int(request.forms.get('multi', False)) data = request.files.values()[0].file.read() if len(request.files) else request.body.read() return _smiles23D(data, multi, False)
def smiles23DView(data, params): kwargs = dict() kwargs['multi'] = int(params.get('multi', False)) kwargs['computeCoords'] = _parseFlag(params.get('computeCoords', False)) kwargs['delimiter'] = params.get('delimiter', ' ') kwargs['smilesColumn'] = int(params.get('smilesColumn', 0)) kwargs['nameColumn'] = int(params.get('nameColumn', 1)) kwargs['sanitize'] = _parseFlag(params.get('sanitize', True)) kwargs['mmff'] = _parseFlag(params.get('mmff', False)) if params.get('titleLine') is None and not data.startswith('SMILES Name'): kwargs['titleLine'] = False else: kwargs['titleLine'] = _parseFlag(params.get('titleLine', True)) return _smiles23D(data, **kwargs)