diff --git a/.github/workflows/test_contact_probability.yml b/.github/workflows/test_contact_probability.yml index 7e11ea3..dbc0a57 100644 --- a/.github/workflows/test_contact_probability.yml +++ b/.github/workflows/test_contact_probability.yml @@ -12,6 +12,7 @@ on: [push] #permissions: # contents: read # + jobs: build: @@ -51,13 +52,13 @@ jobs: # Make sure the @v0.7.0 matches the current version of the action - uses: webfactory/ssh-agent@v0.7.0 with: - ssh-private-key: ${{ secrets.PAT_TOKEN }} + ssh-private-key: ${{ secrets.PAT_TOKEN }} -C "git@github.com:fredcfreitas/contacts-python" # github_token: ${{ secrets.PAT_TOKEN }} - name: Creating the Jupyter Notebook run: | py2nb src/contact_probability.py - - name: Commiting generated files # + - name: Committing generated files # run: | git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" @@ -69,9 +70,8 @@ jobs: uses: ad-m/github-push-action@master with: ssh: true - ssh-private-key: ${{ secrets.PAT_TOKEN }} -# github_token: ${{ secrets.GITHUB_TOKEN }} + ssh-private-key: ${{ secrets.PAT_TOKEN }} -C "git@github.com:fredcfreitas/contacts-python" ssh_key: ${{ secrets.PAT_TOKEN }} - github_token: ${{ secrets.PAT_TOKEN }} +# github_token: ${{ secrets.PAT_TOKEN }} branch: ${{ github.ref }} force: true diff --git a/README.md b/README.md index 608f4c1..cb8733c 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # contacts-python [![Test contact_probability.py](https://github.com/fredcfreitas/contacts-python/actions/workflows/test_contact_probability.yml/badge.svg?branch=release&event=push)](https://github.com/fredcfreitas/contacts-python/actions/workflows/test_contact_probability.yml) Created by Frederico Campos Freitas + This is a set of scripts to evaluate the number of contacts and/or contact probability in a GROMACS-SMOG simulation. Some features were implemented to fit our needs, so feel free to make any changes in order to tailor the scripts to your needs. + It relies on mdtraj and numpy libraries, so take a look at the requirements. + You may find some useful information in the scripts' comments. Contact us if you need some help: fredcfreitas(at)gmail.com diff --git a/src/contact_probability.ipynb b/src/contact_probability.ipynb index c677091..4d08c8d 100644 --- a/src/contact_probability.ipynb +++ b/src/contact_probability.ipynb @@ -15,7 +15,6 @@ "metadata": {}, "outputs": [], "source": [ - "#!/usr/bin/env python3\n", "# usage: python3 contact_probability.py #MODEL(AA or CA) #PDB_BASE #XTC_FILE \\\n", "# #file.cont_FILE #OUTPUT\n", "#\n", @@ -231,7 +230,25 @@ ] } ], - "metadata": {}, + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.0" + } + }, "nbformat": 4, - "nbformat_minor": 5 + "nbformat_minor": 2 } diff --git a/src/contacts_chunk.py b/src/contacts_chunk.py index 1d3aa05..de73906 100755 --- a/src/contacts_chunk.py +++ b/src/contacts_chunk.py @@ -36,15 +36,15 @@ def evaluate_r_initial(contacts, model="AA", precision=np.double): """ contacts = np.asarray(contacts, dtype=precision) if model == "CA": - r_initial = np.power(np.divide(np.multiply(contacts[:, 4], 1.2), \ - contacts[:, 3]), \ + r_initial = np.power(np.divide(np.multiply(contacts[:, -1], 1.2), \ + contacts[:, -2]), \ np.divide(1, 2)) elif model == "AA": - r_initial = np.power(np.divide(np.multiply(contacts[:, 4], 2), \ - contacts[:, 3]),\ + r_initial = np.power(np.divide(np.multiply(contacts[:, -1], 2), \ + contacts[:, -2]),\ np.divide(1, 6)) else: - print("You have not provided an unimplemented model.") + print("You have not provided a model.") sys.exit() return r_initial