Skip to content

Commit

Permalink
Update tests, README
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOresten committed Sep 1, 2024
1 parent cf67c59 commit ed21b41
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ The package is registered in the General registry, and can be installed from the

The `assign_secondary_structure` function takes a vector of atom coordinate arrays of size (3, 3, L). The first axis is for the x, y, and z coordinates, the second axis is for the atom types (N, CA, C), and the third axis is for the residues.

In cases where the coordinates aren't already loaded, one can import Backboner, which adds support for .pdb and .cif files.

```julia
julia> using AssigningSecondaryStructure, Backboner
julia> using BioStructures

julia> using Backboner
julia> coords_vector = map(collectchains(read("test/data/1ZAK.pdb", PDBFormat))) do chain
reshape(coordarray(chain, backboneselector), 3, 4, :)[:, 1:3, :] # get N, CA, C atoms only
end

julia> assign_secondary_structure("test/data/1ASS.pdb") # 1 chain
1-element Vector{Vector{Int64}}:
[1, 1, 1, 3, 3, 3, 1, 1, 1, 1 3, 3, 3, 3, 3, 3, 3, 1, 1, 1]
julia> using AssigningSecondaryStructure

julia> assign_secondary_structure("test/data/1ZAK.pdb") # 2 chains
julia> assign_secondary_structure(coords_vector) # 2 chains
2-element Vector{Vector{Int64}}:
[1, 1, 1, 1, 3, 3, 3, 3, 3, 3 2, 2, 2, 2, 2, 2, 2, 1, 1, 1]
[1, 1, 1, 1, 3, 3, 3, 3, 3, 3 2, 2, 2, 2, 2, 2, 2, 1, 1, 1]
Expand Down
8 changes: 5 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ using BioStructures

ss_composition(secondary_structure::Vector{Int}) = [count(==(ss), secondary_structure) for ss in 1:3]

loadchaincoords(args...) = map(collectchains(read(args...))) do chain
reshape(coordarray(chain, backboneselector), 3, 4, :)[:, 1:3, :]
end

@testset "AssigningSecondaryStructure.jl" begin

backbones = map(collectchains(read("data/1ZAK.pdb", PDBFormat))) do chain
reshape(coordarray(chain, backboneselector), 3, 4, :)[:, 1:3, :]
end
backbones = loadchaincoords("data/1ZAK.pdb", PDBFormat)

@testset "1ZAK" begin
ss = assign_secondary_structure(backbones)
Expand Down

2 comments on commit ed21b41

@AntonOresten
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

  • Remove Backboner extension.
  • Assign secondary structure chain-wise, without accounting for inter-chain bonds.

@JuliaRegistrator
Copy link

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/114316

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:

git tag -a v0.5.0 -m "<description of version>" ed21b41529cb345da30b53293c3fe6443165f4cf
git push origin v0.5.0

Please sign in to comment.