From 13efb0b69d648c333a0f7c8236c1bf5d67bb6871 Mon Sep 17 00:00:00 2001
From: Joe Greener <jgreener@hotmail.co.uk>
Date: Fri, 21 Jun 2024 14:06:28 +0100
Subject: [PATCH] BioStructures.jl compat

---
 Project.toml      | 2 +-
 README.md         | 2 +-
 docs/src/index.md | 2 +-
 src/bonds.jl      | 8 ++++----
 src/structure.jl  | 4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Project.toml b/Project.toml
index 308213e4..d79f50a9 100644
--- a/Project.toml
+++ b/Project.toml
@@ -38,7 +38,7 @@ TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b"
 
 [compat]
 BioAlignments = "2, 3"
-BioStructures = "1, 2, 3"
+BioStructures = "4"
 ColorSchemes = "3"
 ColorTypes = "0.11"
 Colors = "0.12"
diff --git a/README.md b/README.md
index 7ea48f77..2221e4b9 100644
--- a/README.md
+++ b/README.md
@@ -35,7 +35,7 @@ using GLMakie
 using BioStructures
 struc = retrievepdb("2vb1") |> Observable
 ## or
-struc = read("2vb1.pdb", BioStructures.PDB) |> Observable
+struc = read("2vb1.pdb", BioStructures.PDBFormat) |> Observable
 
 fig = Figure()
 plotstruc!(fig, struc; plottype = :ballandstick, gridposition = (1,1), atomcolors = aquacolors)
diff --git a/docs/src/index.md b/docs/src/index.md
index 9bb6cd04..ff62cd08 100644
--- a/docs/src/index.md
+++ b/docs/src/index.md
@@ -64,7 +64,7 @@ using GLMakie
 using BioStructures
 struc = retrievepdb("2vb1") |> Observable
 ## or
-struc = read("2vb1.pdb", BioStructures.PDB) |> Observable
+struc = read("2vb1.pdb", BioStructures.PDBFormat) |> Observable
 
 fig = Figure()
 plotstruc!(fig, struc; plottype = :ballandstick, gridposition = (1,1), atomcolors = aquacolors)
diff --git a/src/bonds.jl b/src/bonds.jl
index e1a75b34..cb53c4f7 100644
--- a/src/bonds.jl
+++ b/src/bonds.jl
@@ -489,7 +489,7 @@ end
 """
 	getbonds( chn::BioStructures.Chain, selectors... ) -> BitMatrix
 	getbonds( modl::BioStructures.Model, selectors... ) -> BitMatrix
-	getbonds( struc::BioStructures.ProteinStructure, selectors... ) -> BitMatrix
+	getbonds( struc::BioStructures.MolecularStructure, selectors... ) -> BitMatrix
 
 Returns a matrix of all bonds in `chn`, where Mat[i,j] = 1 if atoms i and j are bonded. 
 
@@ -678,7 +678,7 @@ function getbonds(modl::BioStructures.Model, selectors...;
 
 	return nothing
 end
-function getbonds(struc::BioStructures.ProteinStructure, selectors...;
+function getbonds(struc::BioStructures.MolecularStructure, selectors...;
 				algo = :knowledgebased, 
 				H = true,
 				cutoff = 1.9,
@@ -1179,7 +1179,7 @@ function bondshapes(chn::BioStructures.Chain; algo = :knowledgebased, distance =
 
     return bshapes
 end
-function bondshapes(struc::BioStructures.ProteinStructure; algo = :knowledgebased, distance = 1.9, bondwidth = 0.2)
+function bondshapes(struc::BioStructures.MolecularStructure; algo = :knowledgebased, distance = 1.9, bondwidth = 0.2)
 	bshapes = Cylinder3{Float32}[]
 	bnds = getbonds(struc; algo = algo, cutoff = distance)
 	atms = BioStructures.collectatoms(struc)
@@ -1274,7 +1274,7 @@ function bondshapes(chn::BioStructures.Chain, bnds::AbstractMatrix; algo = nothi
 
     return bshapes
 end
-function bondshapes(struc::BioStructures.ProteinStructure, bnds::AbstractMatrix; algo = nothing, cutoff = nothing, bondwidth = 0.2)
+function bondshapes(struc::BioStructures.MolecularStructure, bnds::AbstractMatrix; algo = nothing, cutoff = nothing, bondwidth = 0.2)
 	bshapes = Cylinder3{Float32}[]
 	atms = BioStructures.collectatoms(struc)
 
diff --git a/src/structure.jl b/src/structure.jl
index cb2ad8f0..d4263431 100644
--- a/src/structure.jl
+++ b/src/structure.jl
@@ -521,7 +521,7 @@ using BioStructures
 struc = retrievepdb("2vb1", dir = "data/") |> Observable
 strucplot = plotstruc!(fig, struc)
 
-struc = read("data/2vb1_mutant1.pdb", BioStructures.PDB) |> Observable
+struc = read("data/2vb1_mutant1.pdb", BioStructures.PDBFormat) |> Observable
 strucplot = plotstruc!(fig, struc)
 
 chain_A = retrievepdb("2vb1", dir = "data/")["A"] |> Observable
@@ -1150,7 +1150,7 @@ using BioStructures
 struc = retrievepdb("2vb1", dir = "data/") |> Observable
 strucplot = plotstruc(struc)
 
-struc = read("data/2vb1_mutant1.pdb", BioStructures.PDB) |> Observable
+struc = read("data/2vb1_mutant1.pdb", BioStructures.PDBFormat) |> Observable
 strucplot = plotstruc(struc)
 
 chain_A = retrievepdb("2hhb", dir = "data/")["A"] |> Observable