Package: qikpropservice
MolSSI QikProp As A Service API Wrapper LibraryA library which wraps the API calls for the QikProp v3 As A ServiceThe version of QikProp reached by this library has been provided byWilliam L. Jorgensenand hosted as a service by theMolecular Sciences Software Institute (MolSSI). To report a
problem or suggest improvements, please open an issue onthe Project GitHub. Additional features and options will be
added over time.This project serves as the Python wrapper for making the API calls by providing both an importable
library and a CLI tool to make calls to the QikProp Service.For direct information regarding the API endpoints, please seethe Project GitHub.Installation From Conda or PipThis package can be installed from either Conda (via Conda-Forge) or Pipcondainstall-cconda-forgeqikpropserviceORpipinstallqikpropserviceInstallation from SourceClone the repo athttps://github.com/MolSSI/qikpropserviceNavigate to the folderapiwrapperRunpython setup.py installUsage as a CLI ToolThe CLI can be run from any command line interface by invokingqikpropcliThe CLI provides its own documentation for how to use it, but most commonly can be used as such:qikpropclirunFILESWhereFILEScan be replaced with any number of entries of files to submit to the QikProp Service API endpoints.
There are options which can be specified here such as custom URI server's (e.g. for local testing) or QikProp
options, but all of those are documented in the--helpflag.Usage as a Python LibraryThere are two main library functions depending on if you want to do large bulk processing, or more fine-grained
file-by-file processing. In either use case, the library works on on-disk files rather than data pre-read
into memory.The main helper function isqikprop_as_a_servicewhich acts much as the CLI does in that it processes many files
all the same way.fromqikpropserviceimportqikprop_as_a_serviceqikprop_as_a_service("file1.mol, file2.mol, ligand_series*.mol2")This will run the two named filesfile1.mol,file2.moland all the files matching the globligand_series*.mol2.
It is possible to set the output name of each of the returned.tar.gzfiles through a keyword. Other options such as
what settings that can be passed to QikProp are available as well. See the function docstring or callqikprop_as_a_service.__doc__to see the options.The second object is the API Endpoint call wrapperQikpropAsAServicewhich can be used to
integrate with exiting pipelines and make each of the API calls directly, without having to write the request itself
directly. This class only works on a per-call/file basis. Theqikprop_as_a_servicefunction uses this class to make
all of its calls and operations on each file. Its most common invocation is below (wrapped in a practical use), but
things such as the URI, endpoints, hashing functions, etc. can all be set in the class initialization.fromqikpropserviceimportQikpropAsAService,QikPropOptionsfromtimeimportsleepservice=QikpropAsAService()# Example of options, there are defaults for this model and it does not need to be passed to the Service calls# if only defaults are wantedoptions=QikPropOptions(fast=True,similar=30)success,ret_code,data=service.post_task("file1.mol",options=options)task_id=data["id"]whileTrue:success,ret_code,ret_data=service.get_result(task_id=task_id,output_file="file1_result.tar.gz")ifsuccess:breaksleep(5)See the documentation for each class and function to see its options and expected returns.UtilityThere is an expected return code dataclass calledStatusCodes. It's a simple holder for information regarding the
HTTP codes returned normally by the QikProp Service API Endpoint and what they mean.The class is imported withfromqikpropserviceimportStatusCodesStatusCodes.ready# 200StatusCodes.created# 201StatusCodes.staged# 202StatusCodes.error# 220StatusCodes.null# 404StatusCodes.unmatched# 409where each of the attributes and codes corresponds to a particular meaning.ready : 200 - GET and POSTTask is ready to pull down.created: 201 - POSTSubmitted task has been accepted by the server and no issues on input validation.staged: 202 - GETTask is queued in the service but has not been processed or is in processing.error : 220 - GETTask has been processed but had an error associated with processing. See data dict or pull error file for details.null : 404 - GETNo task exists on the server with a given IDunmatched : 409 - GET and POSTFor a provided task ID and file data, Checksum/hashing does not match