|
1 | | -# alvaDescPy |
2 | | -Python wrapper for alvaDesc software |
| 1 | +[](http://faculty.uml.edu/Hunter_Mack/) |
| 2 | + |
| 3 | +# alvaDescPy: A Python wrapper for alvaDesc software |
| 4 | + |
| 5 | +[](https://badge.fury.io/gh/ecrl%2Falvadescpy) |
| 6 | +[](https://badge.fury.io/py/alvadescpy) |
| 7 | +[](https://raw.githubusercontent.com/ecrl/alvadescpy/master/LICENSE.txt) |
| 8 | + |
| 9 | +alvaDescPy provides a Python wrapper for the [alvaDesc](https://www.alvascience.com/alvadesc/) molecular descriptor calculation software. It was created to allow direct access to the alvaDesc command-line interface via Python. |
| 10 | + |
| 11 | +## Installation |
| 12 | + |
| 13 | +Installation via pip: |
| 14 | + |
| 15 | +``` |
| 16 | +$ pip install alvadescpy |
| 17 | +``` |
| 18 | + |
| 19 | +Installation via cloned repository: |
| 20 | + |
| 21 | +``` |
| 22 | +$ git clone https://github.com/ecrl/alvadescpy |
| 23 | +$ cd alvadescpy |
| 24 | +$ python setup.py install |
| 25 | +``` |
| 26 | + |
| 27 | +There are currently no additional dependencies for alvaDescPy, however it requires a valid, licensed installation of [alvaDesc](https://www.alvascience.com/alvadesc/). |
| 28 | + |
| 29 | +## Basic Usage |
| 30 | + |
| 31 | +alvaDescPy assumes the location of alvaDesc's command-line interface is located at ```C:\Program Files\Alvascience\alvaDesc\alvaDescCLI.exe```. If alvaDesc is located in a different location, you can change the path: |
| 32 | + |
| 33 | +```python |
| 34 | +from alvadescpy import ALVADESC_PATH |
| 35 | + |
| 36 | +ALVADESC_PATH = '\\path\\to\\alvaDescCLI.exe' |
| 37 | +``` |
| 38 | + |
| 39 | +alvaDescPy provides direct access to all alvaDesc command line arguments via the "alvadesc" function: |
| 40 | + |
| 41 | +```python |
| 42 | +from alvadescpy import alvadesc |
| 43 | + |
| 44 | +# providing an XML script file |
| 45 | +alvadesc(script='my_script.xml') |
| 46 | + |
| 47 | +# supplying a SMILES string returns a list of descriptors |
| 48 | +descriptors = alvadesc(ismiles='CCC', descriptors='ALL') |
| 49 | + |
| 50 | +# a Python dictionary is returned if labels are desired |
| 51 | +descriptors = alvadesc(ismiles='CCC', descriptors='ALL', labels=True) |
| 52 | + |
| 53 | +# specific descriptors can be calculated |
| 54 | +descriptors = alvadesc(ismiles='CCC', descriptors=['MW', 'AMW'], labels=True) |
| 55 | + |
| 56 | +# input/output files (and input type) can be specified |
| 57 | +alvadesc( |
| 58 | + input_file='mols.mdl', |
| 59 | + inputtype='MDL', |
| 60 | + descriptors='ALL', |
| 61 | + output='descriptors.txt' |
| 62 | +) |
| 63 | + |
| 64 | +# various fingerprints can be calculated |
| 65 | +ecfp = alvadesc(ismiles='CCC', ecfp=True) |
| 66 | +pfp = alvadesc(ismiles='CCC', pfp=True) |
| 67 | +maccsfp = alvadesc(ismiles='CCC', pfp=True) |
| 68 | + |
| 69 | +# fingerprint hash size, min/max fragment length, bits/pattern and other |
| 70 | +# options can be specified |
| 71 | +ecfp = alvadesc( |
| 72 | + ismiles='CCC', |
| 73 | + ecfp=True, |
| 74 | + fpsize=2048, |
| 75 | + fpmin=1, |
| 76 | + fpmax=4, |
| 77 | + bits=4, |
| 78 | + fpoptions='- Additional Options -' |
| 79 | +) |
| 80 | + |
| 81 | +# alvaDesc uses a number of threads equal to the maximum number of CPUs, but |
| 82 | +# can be changed |
| 83 | +descriptors=alvadesc(ismiles='CCC', descriptors='ALL', threads=4) |
| 84 | +``` |
| 85 | + |
| 86 | +alvaDescPy also provides the "smiles_to_descriptors" function: |
| 87 | + |
| 88 | +```python |
| 89 | +from alvadescpy import smiles_to_descriptors |
| 90 | + |
| 91 | +# returns a list of descriptor values |
| 92 | +descriptors = smiles_to_descriptors('CCC', descriptors='ALL') |
| 93 | + |
| 94 | +# returns a dictionary of descriptor labels, values |
| 95 | +descriptors = smiles_to_descriptors('CCC', descriptors='ALL', labels=True) |
| 96 | + |
| 97 | +# returns a dictionary containing MW, AMW labels, values |
| 98 | +descriptors = smiles_to_descriptors( |
| 99 | + 'CCC', |
| 100 | + descriptors=['MW', 'AMW'], |
| 101 | + labels=True |
| 102 | +) |
| 103 | +``` |
| 104 | + |
| 105 | +## Contributing, Reporting Issues and Other Support |
| 106 | + |
| 107 | +To contribute to alvaDescPy, make a pull request. Contributions should include tests for new features added, as well as extensive documentation. |
| 108 | + |
| 109 | +To report problems with the software or feature requests, file an issue. When reporting problems, include information such as error messages, your OS/environment and Python version. |
| 110 | + |
| 111 | +For additional support/questions, contact Travis Kessler (Travis_Kessler@student.uml.edu). |
0 commit comments