Skip to content

Commit

Permalink
Remove backbone directory
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOresten committed Dec 24, 2023
1 parent 254fb3b commit 683ad6e
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/Backboner.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Backboner

using LinearAlgebra
import Rotations

include("backbone/backbone.jl")
include("backbone.jl")
include("bonds.jl")
include("protein/protein.jl")

end
3 changes: 0 additions & 3 deletions src/backbone/backbone.jl → src/backbone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,3 @@ end
@inline Base.size(backbone::Backbone) = Tuple(length(backbone))
@inline Base.getindex(backbone::Backbone, i::Integer) = view(backbone.coords, :, i)
@inline Base.getindex(backbone::Backbone, r::AbstractVector{<:Integer}) = Backbone(view(backbone.coords, :, r))

include("rotations.jl")
include("bonds.jl")
4 changes: 3 additions & 1 deletion src/backbone/bonds.jl → src/bonds.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Rotations

export get_atom_displacements
export get_atom_distances

Expand Down Expand Up @@ -49,7 +51,7 @@ end

get_bond_angles(backbone::Backbone) = get_bond_angles(get_bond_vectors(backbone))

# source: en.wikipedia.org/wiki/Dihedral_angle#In_polymer_physics
# source: https://en.wikipedia.org/w/index.php?title=Dihedral_angle&oldid=1182848974#In_polymer_physics
function dihedral_angle(u1::V, u2::V, u3::V) where V <: AbstractVector{<:Real}
c12, c23 = cross(u1, u2), cross(u2, u3)
return atan(dot(u2, cross(c12, c23)), norm(u2) * dot(c12, c23))
Expand Down
1 change: 1 addition & 0 deletions src/protein/protein.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ include("chain.jl")
include("oxygen.jl")
include("assign.jl")
include("io.jl")
include("rotations.jl")

end
2 changes: 2 additions & 0 deletions src/backbone/rotations.jl → src/protein/rotations.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Rotations

export locs_and_rots_to_backbone, backbone_to_locs_and_rots

const STANDARD_TRIANGLE_ANGSTROM = Float32[
Expand Down
9 changes: 9 additions & 0 deletions test/backbone.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@testset "backbone.jl" begin

coords = randn(3, 20)
backbone = Backbone(coords)
@test length(backbone) == 20
@test size(backbone) == (20,)
@test backbone[1] == coords[:, 1]

end
16 changes: 0 additions & 16 deletions test/backbone/backbone.jl

This file was deleted.

File renamed without changes.
3 changes: 2 additions & 1 deletion test/protein/protein.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ include("residue.jl")
include("chain.jl")
include("oxygen.jl")
include("assign.jl")
include("io.jl")
include("io.jl")
include("rotations.jl")
File renamed without changes.
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ using LinearAlgebra

@testset "Backboner.jl" begin

include("backbone/backbone.jl")
include("backbone.jl")
include("bonds.jl")
include("protein/protein.jl")

end

0 comments on commit 683ad6e

Please sign in to comment.