Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lilyminium/atb_api
https://github.com/lilyminium/atb_api
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lilyminium/atb_api
- Owner: lilyminium
- License: mit
- Created: 2022-02-17T22:12:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-18T14:40:41.000Z (almost 3 years ago)
- Last Synced: 2024-11-21T07:17:49.208Z (about 1 month ago)
- Language: Python
- Size: 183 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
atb_api
==============================
[//]: # (Badges)
[![GitHub Actions Build Status](https://github.com/lilyminium/atb_api/workflows/CI/badge.svg)](https://github.com/lilyminium/atb_api/actions?query=workflow%3ACI)
[![PyPI version](https://badge.fury.io/py/atb_api.svg)](https://pypi.org/project/atb-api/)
![PyPI - Downloads](https://img.shields.io/pypi/dm/atb_api)
[![codecov](https://codecov.io/gh/lilyminium/atb_api/branch/master/graph/badge.svg)](https://codecov.io/gh/lilyminium/atb_api/branch/master)This API is a re-write of the [UQ version](https://github.com/ATB-UQ/atb_api_public) in Python 2.7
This is a work in progress. It is for Lily's personal use, so not all features of the old API are supported yet.
Please open an issue on the [Issue tracker](https://github.com/lilyminium/atb_api/issues) if you notice a bug or need a feature.### Example
You will need a valid ATB token to use this API. Please email the ATB administrators to request a token.
Create an instance by passing an API token, or the filename of one:
```python
api = ATBApi(api_token="MY_TOKEN")
```Submit a molecule by passing in a PDB string or filename:
```python
molid = api.submit_molecule(my_pdb_file.pdb, net_charge=0, molecule_type="heteromolecule")
assert isinstance(molid, int)
```Get a molecule with a molecule ID:
```python
molecule = api.get_molecule(molid=molid)
print(molecule.atoms)
print(molecule.bonds[0].code)
```Download a molecule file with a molecule ID:
```python
pdb_as_str = api.download_molecule(molid=903922, format="pdb",
resolution="all_atom", optimized=True)
```### Copyright
Copyright (c) 2022, Lily Wang
#### Acknowledgements
Many thanks to the original [ATB API](https://github.com/ATB-UQ/atb_api_public) from Bertrand Caron.Project based on the
[Computational Molecular Science Python Cookiecutter](https://github.com/molssi/cookiecutter-cms) version 1.6.