Skip to content

Commit

Permalink
Merge pull request #27 from dinabandhu50/master
Browse files Browse the repository at this point in the history
Update wrapper.py
  • Loading branch information
tjkessler authored Jul 12, 2021
2 parents 059c7aa + d945330 commit a3728f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ padeldescriptor(waitingjobs=10)

# to set the maximum number of threads used
padeldescriptor(threads=2)

# to prevents padel-splash image from loading.
padeldescriptor(headless=True)

```

## Contributing, Reporting Issues and Other Support
Expand Down
12 changes: 9 additions & 3 deletions padelpy/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def padeldescriptor(maxruntime: int = -1, waitingjobs: int = -1,
standardizetautomers: bool = False,
tautomerlist: str = None,
usefilenameasmolname: bool = False,
sp_timeout: int = None) -> None:
sp_timeout: int = None,
headless: bool = True,
) -> None:
''' padeldescriptor: complete wrapper for PaDEL-Descriptor descriptor/
fingerprint generation software
Expand Down Expand Up @@ -94,6 +96,7 @@ def padeldescriptor(maxruntime: int = -1, waitingjobs: int = -1,
tautomerlist (str): path to SMIRKS tautomers file (optional)
usefilenameasmolname (bool): if `True`, uses filename (minus the
extension) as the molecule name
headless (bool): if `True`, Prevents Padel-splash image from loading.
Returns:
None
Expand All @@ -103,8 +106,10 @@ def padeldescriptor(maxruntime: int = -1, waitingjobs: int = -1,
raise ReferenceError(
'Java JRE 6+ not found (required for PaDEL-Descriptor)'
)

command = 'java -jar {}'.format(_PADEL_PATH)
if headless:
command = 'java -Djava.awt.headless=true -jar {}'.format(_PADEL_PATH)
else:
command = 'java -jar {}'.format(_PADEL_PATH)
command += ' -maxruntime {}'.format(maxruntime)
command += ' -waitingjobs {}'.format(waitingjobs)
command += ' -threads {}'.format(threads)
Expand Down Expand Up @@ -150,3 +155,4 @@ def padeldescriptor(maxruntime: int = -1, waitingjobs: int = -1,
err.decode('utf-8')
))
return

0 comments on commit a3728f0

Please sign in to comment.