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 1cffcff commit 8a29fae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/ribbon/segment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export Segment, extend_segment, segments
Segment{SS, T}
A segment of a chain with uniform secondary structure.
The segment can have mixed secondary structure if the `SS` type parameter is `MiSSing`.
The segment can have mixed secondary structure if the `SS` type parameter is `Unassigned`.
"""
struct Segment{SS, T}
chain::Chain{T}
Expand All @@ -13,13 +13,13 @@ struct Segment{SS, T}

function Segment{SS}(chain::Chain{T}, range::UnitRange{Int}) where {SS, T}
ssvector = view(chain.ssvector, range)
@assert SS == MiSSing || all(==(SS), ssvector) "All residues in the '$SS' segment must have the '$SS' secondary structure"
@assert SS == Unassigned || all(==(SS), ssvector) "All residues in the '$SS' segment must have the '$SS' secondary structure"
backbone = chain.backbone[range]
return new{SS, T}(chain, range, backbone)
end

function Segment(chain::Chain{T}, range::UnitRange{Int}) where T
SS = allequal(ssvector) ? ssvector[1] : MiSSing
SS = allequal(ssvector) ? ssvector[1] : Unassigned
return Segment{SS}(chain, range)
end
end
Expand Down Expand Up @@ -48,7 +48,7 @@ This function is useful if one wishes to access the coordinates of the atoms of
parent_vec_range = range .+ offset
adjusted_range = max(1, parent_vec_range.start):min(length(segment.chain), parent_vec_range.stop)
#checkbounds(segment.chain.backbone, parent_vec_range)
return Segment{MiSSing}(segment.chain, adjusted_range)
return Segment{Unassigned}(segment.chain, adjusted_range)
end

"""
Expand Down
2 changes: 1 addition & 1 deletion test/ribbon/segment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
chain = Chain("A", Backbone(randn(3, 4, 5)))
chain.ssvector .= [Loop, Helix, Strand, Strand, Helix]
segment = Segment{Strand}(chain, 3:4)
@test extend_segment(segment, 0:3) == Segment{MiSSing}(chain, 2:5)
@test extend_segment(segment, 0:3) == Segment{Unassigned}(chain, 2:5)
end

@testset "segments" begin
Expand Down

0 comments on commit 8a29fae

Please sign in to comment.