Skip to content

Commit

Permalink
Merge pull request #20 from m3g/remove_AtomsBase
Browse files Browse the repository at this point in the history
Remove atoms base
  • Loading branch information
lmiq authored Nov 22, 2024
2 parents d6169dc + f81b162 commit 7c5cee8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ authors = ["Leandro Martinez <lmartine@unicamp.br> and contributors"]
version = "1.22.2-DEV"

[deps]
AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
CellListMap = "69e1c6dd-3888-40e6-b3c8-31ac5f578864"
Chemfiles = "46823bd8-5fb3-5f92-9aa0-96921f3dd015"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand All @@ -30,7 +29,6 @@ Plotting = "Plots"

[compat]
Aqua = "0.8"
AtomsBase = "0.3.4, 0.4"
BenchmarkTools = "1.3"
CellListMap = "0.9.6"
Chemfiles = "0.10.31"
Expand Down
4 changes: 3 additions & 1 deletion src/MolSimToolkit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import OffsetArrays
import LaTeXStrings # only because Aqua complains: used in the Plotting extensions

using TestItems: @testitem
using AtomsBase: atomic_mass
using StaticArrays: FieldVector, SMatrix, MVector
using LinearAlgebra: norm
using Reexport: @reexport
Expand All @@ -33,6 +32,9 @@ export center_of_mass
# Version of the package: used for printing in some places
const version = pkgversion(@__MODULE__)

# Minimal AtomType interface
atomic_mass(atom::PDBTools.Atom) = PDBTools.mass(atom)

# Testing module
include("../test/Testing.jl")

Expand Down
9 changes: 5 additions & 4 deletions src/datastructures/Simulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@ export get_frame
Creates a new `Simulation` object.
The first constructor creates a `Simulation` object from a PDB file and a trajectory file. It will use the
The first constructor creates a `Simulation` object from a PDB or mmCIF file and a trajectory file. It will use the
`PDBTools.Atom` for the atom type, which will populate the `atoms` vector of the `Simulation` object.
Currently, other atom types are supported, if the `MolSimToolkit.atomic_mass(::AtomType)` function is defined
for the atom type.
With the second constructor, the `atoms` vector is passed as an argument. This is useful when the atoms
are provided by a different source than the PDB file. If the `AtomType` of the `atoms` vector conforms
the `AtomsBase` interface, most functions in the `MolSimToolkit` will work with the `Simulation` object.
are provided by a different source than the PDB file.
If `first`, `last`, and `step` are not specified, the `Simulation` will iterate over all frames in the file.
A `Simulation` object contains a trajectory file and a PDB data of the atoms. It can be iterated over to
obtain the frames in the trajectory. The `Simulation` object is a mutable struct
that contains the following data, that can be retrived by the corresponding
that contains the following data, that can be retrieved by the corresponding
functions:
- `frame_range(::Simulation)`: the range of frames to be iterated over
Expand Down

0 comments on commit 7c5cee8

Please sign in to comment.