Skip to content

Commit

Permalink
Update AtomPacker package
Browse files Browse the repository at this point in the history
  • Loading branch information
jvsguerra committed Jan 15, 2024
1 parent ccae2ff commit 3ad9971
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 146 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
2 changes: 1 addition & 1 deletion AtomPacker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

__author__ = """João V S Guerra"""
__email__ = '[email protected]'
__version__ = '0.1.0'
__version__ = '0.1.1'

from . import AtomPacker
from .AtomPacker import PackmolStructure, CavityDetector, AtomPacker
40 changes: 1 addition & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ pip install -e AtomPacker

## Usage

There are two pipelines available to pack nanoparticle atoms inside a supramolecular cage:

### 1. Packing nanoparticle atoms freely with packmol and filter atoms inside the cavity;
Packing nanoparticle atoms freely with packmol and filter atoms inside the cavity

```python
from AtomPacker import *
Expand Down Expand Up @@ -69,42 +67,6 @@ ap.packing(replicates=10)
print(ap.summary)
```

### 2. Packing nanoparticle atoms with packmol inside a boundary and filter atoms inside the cavity;

```python
from AtomPacker import *
# Load supramolecular cage into PackmolStructure object
smc = PackmolStructure(
os.path.join("data", "C1.pdb"),
number=1,
instructions=["center", "fixed 0. 0. 0. 0. 0. 0."],
)
# Load nanoparticle atoms into PackmolStructure object
# NOTE: You must set an appropriate number of atoms to fill the cavity and define a sphere that contains the whole supramolecular cage
np_atom = PackmolStructure(
os.path.join("data", "Au.pdb"), number=40, instructions=["inside sphere 0. 0. 0. 6."]
)
# Create a CavityDetector with detection parameters appropriate for the supramolecular cage
cd = CavityDetector(step=0.25, probe_in=1.4, probe_out=10.0, removal_distance=1.0, volume_cutoff=5.0, vdw=None)
# Create the AtomPacked object
# NOTE: For gold, atom radius is 1.36 Å
ap = AtomPacker(smc, np_atom, np_atom_radius=1.36, cavity_detector=cd,
basedir="pipeline-2")
# Add a boundary to pack nanoparticle atoms
ap.add_boundary()
# Run Packing algorithm with 10 replicates
ap.packing(replicates=10)
# Show number of packed atoms
print(ap.summary)
```

## Citing

If you find `AtomPacker` useful for you, please cite the following sources:
Expand Down
13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ build-backend = "setuptools.build_meta"
name = "AtomPacker"
description = "A python package for packing atoms into a supramolecular cage"
authors = [
{ name = "João Victor da Silva Guerra", email = "[email protected]" },
{ name = "João Victor da Silva Guerra" },
{ name = "Gabriel Ernesto Jara" },
]
maintainers = [
{ name = "João Victor da Silva Guerra", email = "[email protected]" },
Expand All @@ -29,11 +30,11 @@ classifiers = [
"Programming Language :: Python :: 3 :: Only",
]
dependencies = [
"MDAnalysis==2.6.1",
"numpy==1.26.1",
"pyKVFinder==0.6.8",
"pandas==2.1.1",
"scipy==1.11.2",
"MDAnalysis==2.7.0",
"numpy==1.26.3",
"pyKVFinder==0.6.11",
"pandas==2.1.4",
"scipy==1.11.4",
]
dynamic = ["version"]

Expand Down
3 changes: 1 addition & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
def clean_directories():
# Define the directories to remove
directories_to_remove = [
"tests/pipeline-1",
"tests/pipeline-2",
"tests/pipeline",
# Add more directories to remove as needed
]

Expand Down
12 changes: 6 additions & 6 deletions tests/test_pipeline_1.py → tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ def test_pipeline_1(np_atom_params):
np_atom,
np_atom_radius=np_atom_radius,
cavity_detector=cd,
basedir=os.path.join(HERE, "pipeline-1", basename),
basedir=os.path.join(HERE, "pipeline", basename),
)

# Run Packing algorithm
ap.packing(replicates=REPLICATES)

# Perform assertions to check if files were created for the specified np_atom and np_atom_radius
assert os.path.exists(os.path.join(HERE, "pipeline-1", basename, "PackedAtoms.csv"))
assert os.path.exists(os.path.join(HERE, "pipeline-1", basename, "cavity.pdb"))
assert os.path.exists(os.path.join(HERE, "pipeline-1", basename, "packmol.inp"))
assert os.path.exists(os.path.join(HERE, "pipeline-1", basename, "packmol.stdout"))
assert os.path.exists(os.path.join(HERE, "pipeline", basename, "PackedAtoms.csv"))
assert os.path.exists(os.path.join(HERE, "pipeline", basename, "cavity.pdb"))
assert os.path.exists(os.path.join(HERE, "pipeline", basename, "packmol.inp"))
assert os.path.exists(os.path.join(HERE, "pipeline", basename, "packmol.stdout"))
for replicate in range(REPLICATES):
assert os.path.exists(
os.path.join(HERE, "pipeline-1", basename, f"packed{replicate}.pdb")
os.path.join(HERE, "pipeline", basename, f"packed{replicate}.pdb")
)


Expand Down
92 changes: 0 additions & 92 deletions tests/test_pipeline_2.py

This file was deleted.

0 comments on commit 3ad9971

Please sign in to comment.