Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
90385c3
Updating the notebooks according last script(s) changes
github-actions[bot] Sep 19, 2023
444d949
Updating the notebooks according last script(s) changes
github-actions[bot] Sep 19, 2023
f47444d
Updating the notebooks according last script(s) changes
github-actions[bot] Sep 19, 2023
323313c
[ISSUE6] Fixing less_equal and absolute differences.
fredcfreitas Sep 20, 2023
ae372ff
Updating the notebooks according last script(s) changes
github-actions[bot] Sep 20, 2023
d5b5637
Updating the notebooks according last script(s) changes
github-actions[bot] Sep 20, 2023
0e685d9
Updating gitignore
fredcfreitas Sep 20, 2023
289c937
Delete share/contacts_chunk.py
fredcfreitas Sep 26, 2023
b963481
Updating the notebooks according last script(s) changes
github-actions[bot] Sep 26, 2023
7ef176a
Just to check passing tests.
fredcfreitas Dec 16, 2024
3569828
Updating the notebooks according last script(s) changes
github-actions[bot] Dec 16, 2024
bcb5c46
Updating actions.
fredcfreitas Dec 16, 2024
6270f77
Fixing issues
fredcfreitas Dec 16, 2024
86e009a
Solving?
fredcfreitas Dec 16, 2024
99aa80a
Updating the notebooks according last script(s) changes
github-actions[bot] Dec 17, 2024
2fb26ed
Fixing ssh-key comments
fredcfreitas Dec 17, 2024
8043dcc
Updating the notebooks according last script(s) changes
github-actions[bot] Dec 17, 2024
341ac83
Cosmetic changes
fredcfreitas Dec 17, 2024
cc51934
Updating the notebooks according last script(s) changes
github-actions[bot] Dec 17, 2024
29a4fee
Still is going to work if file.cont has only 4 columns
fredcfreitas Oct 15, 2025
73cc7b8
Updating the notebooks according last script(s) changes
github-actions[bot] Oct 15, 2025
88a70c0
Merge branch 'release' into master
fredcfreitas Oct 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/test_contact_probability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on: [push]
#permissions:
# contents: read
#

jobs:
build:

Expand Down Expand Up @@ -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]"
Expand All @@ -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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
23 changes: 20 additions & 3 deletions src/contact_probability.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
}
10 changes: 5 additions & 5 deletions src/contacts_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading