-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
anton083
committed
Oct 26, 2023
1 parent
30d90ba
commit 3c13a85
Showing
6 changed files
with
37 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
module AssigningSecondaryStructure | ||
|
||
include("ssclass.jl") | ||
include("utils.jl") | ||
include("dssp.jl") | ||
include("pdb.jl") | ||
include("ss.jl") | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export SSClass, Loop, Helix, Strand, ss_composition | ||
|
||
struct SSClass | ||
n::Int | ||
end | ||
|
||
const CHAR_VEC = ['-', 'H', 'E'] | ||
Base.convert(::Type{Char}, cls::SSClass) = CHAR_VEC[cls.n] | ||
Base.string(ss::Vector{SSClass}) = join(convert(Char, cls) for cls in ss) | ||
|
||
const Loop = SSClass(1) | ||
const Helix = SSClass(2) | ||
const Strand = SSClass(3) | ||
|
||
const SSCLASS_NAMES = Dict(Loop => "Loop", Helix => "Helix", Strand => "Strand") | ||
|
||
Base.show(io::IO, cls::SSClass) = print(io, get(SSCLASS_NAMES, cls, "SSClass($(cls.n))")) | ||
|
||
ss_composition(ss::Vector{SSClass}) = [count(==(cls), ss) for cls in [Loop, Helix, Strand]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters