-
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.
Merge pull request #1 from MurrellGroup/dev
assign_secondary_structure
- Loading branch information
Showing
7 changed files
with
49 additions
and
43 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
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,39 @@ | ||
export assign_secondary_structure!, assign_secondary_structure | ||
|
||
function assign_secondary_structure! end | ||
|
||
""" | ||
assign_secondary_structure(coords_chains) | ||
Given a vector of chains, each represented as a 3-dimensional array of size 3x4xL, this function assigns the secondary structure to each residue. In these arrays: | ||
- The first dimension corresponds to the x, y, and z coordinates of the atoms. | ||
- The second dimension represents the atom type, ordered as N, CA, C, and O. | ||
- The third dimension specifies the residue number in the chain. | ||
""" | ||
function assign_secondary_structure(coords_chains::Vector{<:AbstractArray{T, 3}}) where T | ||
lengths = size.(coords_chains, 3) | ||
|
||
coords = cat(coords_chains..., dims=3) | ||
num_vector = dssp(coords) | ||
|
||
cum_indices = cumsum(lengths) | ||
num_vectors_by_chain = [num_vector[get(cum_indices, n-1, 0)+1:cum_indices[n]] for n in 1:length(lengths)] | ||
|
||
return num_vectors_by_chain | ||
end | ||
|
||
""" | ||
assign_secondary_structure(filename) | ||
Returns a vector of vectors of integers, each of which is the secondary structure assignment | ||
for the corresponding chain and their respective residues. | ||
The integers are assigned as follows: | ||
- 1: loop | ||
- 2: helix | ||
- 3: strand | ||
""" | ||
function assign_secondary_structure(filename::String) | ||
chains = load_pdb_backbone_coords(filename) | ||
return assign_secondary_structure(chains) | ||
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
739b785
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
739b785
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 updated: JuliaRegistries/General/94760
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: