From af4d142a42414c1f40c17611a6a38c289bc49407 Mon Sep 17 00:00:00 2001 From: anton083 Date: Sun, 4 Aug 2024 03:26:13 +0200 Subject: [PATCH] Add PDBEntry, pdb"" notation --- Project.toml | 2 +- src/protein/oxygen.jl | 2 -- src/protein/protein.jl | 30 ++++++++++++++++++++++-------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/Project.toml b/Project.toml index 968b04e..cdb2524 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Backboner" uuid = "9ac9c2a2-1cfe-46d3-b3fd-6fa470ea56a7" authors = ["Anton Oresten "] -version = "0.11.1" +version = "0.11.2" [deps] BioStructures = "de9282ab-8554-53be-b2d6-f6c222edabfc" diff --git a/src/protein/oxygen.jl b/src/protein/oxygen.jl index cd8f1ab..f80c123 100644 --- a/src/protein/oxygen.jl +++ b/src/protein/oxygen.jl @@ -1,5 +1,3 @@ -export oxygen_coords - ## Warning: wonky code ahead using LinearAlgebra diff --git a/src/protein/protein.jl b/src/protein/protein.jl index 67aaa73..f4301ad 100644 --- a/src/protein/protein.jl +++ b/src/protein/protein.jl @@ -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 \ No newline at end of file