Skip to content

Commit

Permalink
Don't collect empty chains
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOresten committed Aug 13, 2024
1 parent 50d1425 commit b290aa5
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 = "Backboner"
uuid = "9ac9c2a2-1cfe-46d3-b3fd-6fa470ea56a7"
authors = ["Anton Oresten <[email protected]>"]
version = "0.11.3"
version = "0.11.4"

[deps]
BioStructures = "de9282ab-8554-53be-b2d6-f6c222edabfc"
Expand Down
7 changes: 5 additions & 2 deletions src/protein/BioStructures-interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ end

function Protein.Chain(chain::BioStructures.Chain, selector=backbone_residue_selector)
residues = BioStructures.collectresidues(chain, selector)
isempty(residues) && return Protein.Chain(BioStructures.chainid(chain), Backbone(Matrix{Float64}(undef, 3, 0)); modelnum=BioStructures.modelnumber(chain))
isempty(residues) && return Protein.Chain(Backbone(Matrix{Float64}(undef, 3, 0)); id=BioStructures.chainid(chain), modelnum=BioStructures.modelnumber(chain))
return Protein.Chain(residues)
end

function collectchains(struc::BioStructures.MolecularStructure, selector=backbone_residue_selector)
chains = Protein.Chain[]
for model in struc, chain in model
isempty(chain) || push!(chains, Protein.Chain(chain, selector))
if !isempty(chain)
protein_chain = Protein.Chain(chain, selector)
!isempty(protein_chain) && push!(chains, protein_chain)
end
end
return chains
end
Expand Down

2 comments on commit b290aa5

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

  • Don't collect empty chains

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

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.4 -m "<description of version>" b290aa5762bedcb33420d44fb0fc2389f4e2bd52
git push origin v0.11.4

Please sign in to comment.