Skip to content

Commit

Permalink
Also support mmCIF with getchain (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy authored Aug 28, 2024
1 parent 3ec1b69 commit 4efd19d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GPCRAnalysis"
uuid = "c1d73f9e-d42a-418a-8d5b-c7b00ec0358f"
authors = ["Tim Holy <[email protected]> and contributors"]
version = "0.5.0"
version = "0.5.1"

[deps]
BioStructures = "de9282ab-8554-53be-b2d6-f6c222edabfc"
Expand Down
7 changes: 5 additions & 2 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ end
"""
getchain(filename::AbstractString; model=1, chain="A")
Read a PDB file `filename` and extract the specified chain.
Read a PDB or mmCIF file `filename` and extract the specified chain.
"""
getchain(filename::AbstractString; model=1, chain="A") = read(filename, PDBFormat)[model][chain]
getchain(filename::AbstractString; model=1, chain="A") =
endswith(filename, ".pdb") ? read(filename, PDBFormat)[model][chain] :
endswith(filename, ".cif") ? read(filename, MMCIFFormat)[model][chain] :
throw(ArgumentError("Unknown file format"))

function validate_seq_residues(seq::AnnotatedAlignedSequence, chain)
for (i, r) in zip(getsequencemapping(seq), seq)
Expand Down

0 comments on commit 4efd19d

Please sign in to comment.