I'm trying to call an external program (Openbabel) to each element (molecule) in a list of molecules (SMILES format). However, I keep getting the same error:
/bin/sh: 1: Syntax error: "(" unexpected (expecting ")").
What is wrong with my code?
from subprocess import call
with open('test_zinc.smi') as f:
smiles = [(line.split())[0] for line in f]
def call_obabel(smi):
for mol in smi:
call('(obabel %s -otxt -s %s -at %s -aa)' % ('fda_approved.fs', mol, '5'), shell=True)
call_obabel(smiles)