-
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
1 parent
4d3ca30
commit cfe493f
Showing
10 changed files
with
74 additions
and
155 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,21 @@ | ||
name = "AssigningSecondaryStructure" | ||
uuid = "8ed43e74-60fb-4e11-99b9-91deed37aef7" | ||
authors = ["Anton Oresten <[email protected]>", "Shintaro Minami"] | ||
version = "0.3.2" | ||
version = "0.3.3" | ||
|
||
[deps] | ||
Backboner = "9ac9c2a2-1cfe-46d3-b3fd-6fa470ea56a7" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
PDBTools = "e29189f1-7114-4dbd-93d0-c5673a921a58" | ||
PaddedViews = "5432bcbf-9aad-5242-b902-cca2824c8663" | ||
|
||
[weakdeps] | ||
Backboner = "9ac9c2a2-1cfe-46d3-b3fd-6fa470ea56a7" | ||
|
||
[extensions] | ||
BackbonerExt = "Backboner" | ||
|
||
[compat] | ||
Backboner = "0.9" | ||
LinearAlgebra = "1" | ||
PDBTools = "1" | ||
PaddedViews = "0.5" | ||
julia = "^1.7" | ||
|
||
[extras] | ||
Backboner = "9ac9c2a2-1cfe-46d3-b3fd-6fa470ea56a7" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["Test", "Backboner"] | ||
test = ["Test"] |
This file was deleted.
Oops, something went wrong.
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("utils.jl") | ||
include("hydrogen.jl") | ||
include("dssp.jl") | ||
include("assign.jl") | ||
include("pdb.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
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,54 @@ | ||
function get_hydrogen_positions(coords::AbstractArray{T, 3}) where T <: Real | ||
vec_cn = coords[2:end, 1, :] .- coords[1:end-1, 3, :] | ||
vec_cn ./= mapslices(norm, vec_cn, dims=2) | ||
vec_can = coords[2:end, 1, :] .- coords[2:end, 2, :] | ||
vec_can ./= mapslices(norm, vec_can, dims=2) | ||
vec_nh = vec_cn .+ vec_can | ||
vec_nh ./= mapslices(norm, vec_nh, dims=2) | ||
return coords[2:end, 1, :] .+ 1.01 .* vec_nh | ||
end | ||
|
||
function get_hbond_map( | ||
coords::AbstractArray{T, 3}; | ||
cutoff::Float64 = DEFAULT_CUTOFF, | ||
margin::Float64 = DEFAULT_MARGIN, | ||
) where T <: Real | ||
residue_count, atoms_per_residue, _ = size(coords) | ||
atoms_per_residue == 4 || throw(DimensionMismatch("Expected 4 atoms per residue, got $atoms_per_residue")) | ||
|
||
cpos = coords[1:end-1, 3, :] | ||
opos = coords[1:end-1, 4, :] | ||
npos = coords[2:end, 1, :] | ||
hpos = get_hydrogen_positions(coords) | ||
|
||
cmap = repeat(reshape(cpos, 1, :, 3), outer=(residue_count-1, 1, 1)) | ||
omap = repeat(reshape(opos, 1, :, 3), outer=(residue_count-1, 1, 1)) | ||
nmap = repeat(reshape(npos, :, 1, 3), outer=(1, residue_count-1, 1)) | ||
hmap = repeat(reshape(hpos, :, 1, 3), outer=(1, residue_count-1, 1)) | ||
|
||
d_on = dropdims(sqrt.(sum(abs2.(omap .- nmap), dims=3)), dims=3) | ||
d_ch = dropdims(sqrt.(sum(abs2.(cmap .- hmap), dims=3)), dims=3) | ||
d_oh = dropdims(sqrt.(sum(abs2.(omap .- hmap), dims=3)), dims=3) | ||
d_cn = dropdims(sqrt.(sum(abs2.(cmap .- nmap), dims=3)), dims=3) | ||
|
||
arr = Q1Q2_F .* (1.0 ./ d_on .+ 1.0 ./ d_ch .- 1.0 ./ d_oh .- 1.0 ./ d_cn) | ||
|
||
e = _pad(0.0, arr, (1,0), (0,1)) | ||
|
||
local_mask = trues(residue_count, residue_count) | ||
for i in 1:residue_count | ||
local_mask[i, i] = false | ||
if i > 1 | ||
local_mask[i, i-1] = false | ||
end | ||
if i > 2 | ||
local_mask[i, i-2] = false | ||
end | ||
end | ||
|
||
hbond_map = clamp.(cutoff - margin .- e, -margin, margin) | ||
hbond_map .= (sin.(hbond_map .* (π / 2 / margin)) .+ 1.0) ./ 2.0 | ||
hbond_map .*= local_mask | ||
|
||
return hbond_map | ||
end |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
cfe493f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
Release notes:
assign_secondary_structure
forBackboner.Protein.Chain
andVector{Backboner.Protein.Chain}
cfe493f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/104836
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: