Skip to content

Commit

Permalink
Optionally suppress warnings in align (#23)
Browse files Browse the repository at this point in the history
This adds a keyword to skip warnings about missing anchor residues.
  • Loading branch information
timholy authored Jun 7, 2024
1 parent 89012a5 commit 7c653fa
Show file tree
Hide file tree
Showing 2 changed files with 3 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.4.0"
version = "0.4.1"

[deps]
CoordinateTransformations = "150eb455-5306-5404-9cee-2592286d6298"
Expand Down
4 changes: 2 additions & 2 deletions src/align.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
Return a rotated and shifted version of `moving` so that the α-carbons of residues `moving[sm]` have least
mean square error deviation from positions `fixedpos` or those of residues `fixed`.
"""
function align(fixedpos::AbstractMatrix{Float64}, moving::AbstractVector{PDBResidue}, sm::SequenceMapping; seqname=nothing)
function align(fixedpos::AbstractMatrix{Float64}, moving::AbstractVector{PDBResidue}, sm::SequenceMapping; seqname=nothing, warn::Bool=true)
length(sm) == size(fixedpos, 2) || throw(DimensionMismatch("reference has $(size(fixedpos, 2)) positions, but `sm` has $(length(sm))"))
movres = moving[sm]
keep = map(!isnothing, movres)
if !all(keep)
if !all(keep) && warn
@warn "missing $(length(keep)-sum(keep)) anchors for sequence $seqname"
end
movpos = residue_centroid_matrix(movres[keep])
Expand Down

0 comments on commit 7c653fa

Please sign in to comment.