Skip to content

Commit

Permalink
Add assign_oxygens!, fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOresten committed May 16, 2024
1 parent d6eafbb commit 8c16a1b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Backboner"
uuid = "9ac9c2a2-1cfe-46d3-b3fd-6fa470ea56a7"
authors = ["Anton Oresten <anton.oresten42@gmail.com>"]
version = "0.9.6"
version = "0.9.7"

[deps]
BioStructures = "de9282ab-8554-53be-b2d6-f6c222edabfc"
Expand Down
2 changes: 1 addition & 1 deletion src/backbone.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export Backbone

"""
Backbone{T <: Real} <: AbstractMatrix{T}
Backbone{T <: Real, M <: AbstractMatrix{T}} <: AbstractMatrix{T}
The `Backbone` type is designed to efficiently store and manipulate the three-dimensional coordinates of backbone atoms.
Expand Down
8 changes: 8 additions & 0 deletions src/protein/oxygen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ function oxygen_coords(chain::Chain)
return stack(get_oxygen(chain, i) for i in 1:length(chain))
end

function assign_oxygens!(chain::Chain)
for (i, residue) in enumerate(chain)
deleteat!(residue.atoms, findfirst(==("O") (atom -> atom.name), residue.atoms))
insert!(residue.atoms, 4, Atom("O", estimate_oxygen_position(chain, i)))
end
return chain
end

function assign_missing_oxygens!(chain::Chain)
for (i, residue) in enumerate(chain)
!any(==("O") (atom -> atom.name), residue.atoms) && insert!(residue.atoms, 4, Atom("O", estimate_oxygen_position(chain, i)))
Expand Down

2 comments on commit 8c16a1b

@AntonOresten
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

  • Filter out disordered atoms.
  • Add assign_oxygens! function, recalculating the oxygen positions and overwriting any existing oxygen atom for each residue.
  • Define indexing of Chain with e.g. ranges to get a subchain.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/106974

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.7 -m "<description of version>" 8c16a1b01f628ee29d0d910e2ec2047cfaf82beb
git push origin v0.9.7

Please sign in to comment.