Skip to content

Commit

Permalink
Add PDBEntry, pdb"" notation
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOresten committed Aug 4, 2024
1 parent b19875e commit af4d142
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Backboner"
uuid = "9ac9c2a2-1cfe-46d3-b3fd-6fa470ea56a7"
authors = ["Anton Oresten <anton.oresten42@gmail.com>"]
version = "0.11.1"
version = "0.11.2"

[deps]
BioStructures = "de9282ab-8554-53be-b2d6-f6c222edabfc"
Expand Down
2 changes: 0 additions & 2 deletions src/protein/oxygen.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export oxygen_coords

## Warning: wonky code ahead

using LinearAlgebra
Expand Down
30 changes: 22 additions & 8 deletions src/protein/protein.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,45 @@ module Protein

# TODO: un-export Atom and Residue as they shouldn't really be public (breaking)

using ..Backboner

import BioStructures

include("atom.jl")
export Atom

include("residue.jl")
export Residue

include("chain.jl")
export Chain
export has_assigned_ss

include("oxygen.jl")
export oxygen_coords

include("BioStructures-interface.jl")
export nitrogen_coords, alphacarbon_coords, carbonyl_coords
export nitrogen_alphacarbon_distances, alphacarbon_carbonyl_distances, carbonyl_nitrogen_distances
export phi_angles, psi_angles, omega_angles

include("idealization.jl")
export readchains, writechains
export readpdb, writepdb
export readcif, writecif
export PDBFormat, MMCIFFormat

using ..Backboner
PDBEntry(pdbid::AbstractString; format=BioStructures.PDBFormat, kwargs...) = mktempdir() do dir
path = BioStructures.downloadpdb(pdbid; dir, format, kwargs...)
Backboner.Protein.readchains(path, format)
end

import BioStructures
macro pdb_str(pdbid)
quote
PDBEntry($(esc(pdbid)))
end
end

include("atom.jl")
include("residue.jl")
include("chain.jl")
include("oxygen.jl")
include("BioStructures-interface.jl")
include("idealization.jl")
export PDBEntry, @pdb_str

end

2 comments on commit af4d142

@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:

  • Add Protein.PDBEntry function for getting a PDB entry in the form of a Vector{Protein.Chain} from the PDB without an explicit download.
  • Add pdb_str macro for convenience. (e.g. pdb"1ASS")

@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/112366

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.11.2 -m "<description of version>" af4d142a42414c1f40c17611a6a38c289bc49407
git push origin v0.11.2

Please sign in to comment.