Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOresten committed Sep 1, 2024
1 parent 4bbfab5 commit cf67c59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ LinearAlgebra = "1"
julia = "1"

[extras]
BioStructures = "de9282ab-8554-53be-b2d6-f6c222edabfc"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Test", "BioStructures"]
27 changes: 8 additions & 19 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,20 @@ using AssigningSecondaryStructure
using Test

import AssigningSecondaryStructure as ASS
import Backboner

using BioStructures

ss_composition(secondary_structure::Vector{Int}) = [count(==(ss), secondary_structure) for ss in 1:3]

@testset "AssigningSecondaryStructure.jl" begin

@testset "DSSP" begin

@testset "dssp" begin
coords = reshape(Backboner.Protein.readpdb("data/1ASS.pdb")[1].backbone.coords, 3, 3, :)
@test AssigningSecondaryStructure.dssp(coords[:, :, 35:39]) == [1, 1, 1, 1, 1] # minimum helix length is 4
@test AssigningSecondaryStructure.dssp(coords[:, :, 35:40]) == [1, 2, 2, 2, 2, 1]
@test AssigningSecondaryStructure.dssp(coords[:, :, 35:41]) == [1, 2, 2, 2, 2, 2, 1]
end

@testset "1ASS" begin
ss = assign_secondary_structure("data/1ASS.pdb")
@test ss_composition.(ss) == [[60, 53, 39]]
end

@testset "1ZAK" begin
ss = assign_secondary_structure("data/1ZAK.pdb")
@test ss_composition.(ss) == [[72, 116, 32], [72, 116, 32]]
end
backbones = map(collectchains(read("data/1ZAK.pdb", PDBFormat))) do chain
reshape(coordarray(chain, backboneselector), 3, 4, :)[:, 1:3, :]
end

@testset "1ZAK" begin
ss = assign_secondary_structure(backbones)
@test ss_composition.(ss) == [[72, 116, 32], [72, 116, 32]]
end

end

0 comments on commit cf67c59

Please sign in to comment.