Skip to content

Commit

Permalink
MiSSing -> Unassigned
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOresten committed Nov 17, 2023
1 parent 1577d49 commit ba7e804
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/backbone/rotations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ end

# 4xL matrix of quaternions
function Backbone(locations::AbstractMatrix{T}, quatrot_matrix::AbstractMatrix{T}; unit::Symbol=:angstrom) where T
@assert size(quatrot_matrix, 1) == 4 "quatrotations must be a 4xL array"
@assert size(quatrot_matrix, 1) == 4 "quatrot_matrix must be a 4xL array"
quatrots = QuatRotation.(eachcol(quatrot_matrix))
return Backbone(locations, quatrots, unit=unit)
end
Expand Down
4 changes: 2 additions & 2 deletions src/chain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct Chain{T}
end

function Chain(id::AbstractString, backbone::Backbone{4,T}) where T
return Chain(id, backbone, fill(MiSSing, length(backbone)))
return Chain(id, backbone, fill(Unassigned, length(backbone)))
end

function Chain(id::AbstractString, backbone::Backbone{3})
Expand All @@ -27,7 +27,7 @@ struct Chain{T}
Chain(backbone::Backbone) = Chain("", backbone)
end

@inline Base.:(==)(chain1::Chain, chain2::Chain) = chain1.id == chain2.id && chain1.backbone == chain2.backbone && (all(==(MiSSing), chain1.ssvector) || all(==(MiSSing), chain2.ssvector) || chain1.ssvector == chain2.ssvector)
@inline Base.:(==)(chain1::Chain, chain2::Chain) = chain1.id == chain2.id && chain1.backbone == chain2.backbone && (all(==(Unassigned), chain1.ssvector) || all(==(Unassigned), chain2.ssvector) || chain1.ssvector == chain2.ssvector)
@inline Base.length(chain::Chain) = length(chain.backbone)
@inline Base.size(chain::Chain) = (length(chain),)

Expand Down
6 changes: 3 additions & 3 deletions src/secondarystructure.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export SecondaryStructure, MiSSing, Loop, Helix, Strand, has_missing_ss
export SecondaryStructure, Unassigned, Loop, Helix, Strand, has_missing_ss

@enum SecondaryStructure MiSSing Loop Helix Strand
@enum SecondaryStructure Unassigned Loop Helix Strand

has_missing_ss(ssv::AbstractVector{SecondaryStructure}) = MiSSing in ssv
has_missing_ss(ssv::AbstractVector{SecondaryStructure}) = Unassigned in ssv
2 changes: 1 addition & 1 deletion test/chain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@test chain isa Chain{Float64}
@test chain.id == "A"
@test chain.backbone.coords == coords
@test chain.ssvector == fill(MiSSing, length(chain))
@test chain.ssvector == fill(Unassigned, length(chain))
@test has_missing_ss(chain)
@test length(chain) == 5
@test size(chain) == (5,)
Expand Down
2 changes: 1 addition & 1 deletion test/secondarystructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@test Loop == SecondaryStructure(1)
@test Helix == SecondaryStructure(2)
@test Strand == SecondaryStructure(3)
@test has_missing_ss([Loop, Helix, Strand, MiSSing])
@test has_missing_ss([Loop, Helix, Strand, Unassigned])
@test !has_missing_ss([Loop, Helix, Strand])

end

0 comments on commit ba7e804

Please sign in to comment.