Skip to content

Instantly share code, notes, and snippets.

@ssorgatem
Created August 26, 2013 08:49
Show Gist options
  • Select an option

  • Save ssorgatem/6339360 to your computer and use it in GitHub Desktop.

Select an option

Save ssorgatem/6339360 to your computer and use it in GitHub Desktop.
Use of find_decoys.py
import find_decoys
query_files = ["CID_389710.sdf"] #this is a list with a single file name
db_files = ["ligand.sdf"] #Here, the same.
results = find_decoys.find_decoys(query_files = query_files, db_files = db_files)
# This last change is not mandatory, but since it is a function with
# so many arguments, it's very easy to misplace them when not using
# keyword arguments. This way the order of the arguments doesn't
# matter, as we are specifying what is each argument explicitly.
#Also note that find_decoys.find_decoys() is a generator function, which means that by calling it it returns
# an iterator, and the actual work is done while iterating over it.
#So up to this point no work has been done.
#Let's start doing the job:
for result in results:
#Here it is working
print result
#And now it has finished, after exhausting the iterator.
#The results yielded by the iterator are just information used by the GUI to display the progress bar
# so they are not the most useful thing int he world. You can print them or do whatever you like with them, but
# the iterator must be itereated over, otherwise no work will be done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment