Skip to content

Commit

Permalink
Recognize '|' as accession code terminator
Browse files Browse the repository at this point in the history
With the revisions to diegozea/MIToS.jl#75, we
need to recognize `|` as a terminator for the accession code.
  • Loading branch information
timholy committed Jun 7, 2024
1 parent b4e40c5 commit 622a6d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/naming_conventions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ function species(name::AbstractString)
return m.captures[1]::AbstractString
end

const rex_uniprotX_Swiss = r"^([A-Z0-9]{1,5})($|_)" # Swiss
const rex_uniprot_accession = r"^([OPQ][0-9][A-Z0-9]{3}[0-9]|[A-NR-Z][0-9](?:[A-Z][A-Z0-9]{2}[0-9]){1,2})(?:$|_|\.\d+)"
const rex_uniprotX_Swiss = r"^([A-Z0-9]{1,5})(?:$|_)" # Swiss
const rex_uniprot_accession = r"^([OPQ][0-9][A-Z0-9]{3}[0-9]|[A-NR-Z][0-9](?:[A-Z][A-Z0-9]{2}[0-9]){1,2})(?:$|_|\||\.\d+)"

"""
uniprotX(name)
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ using Test
@test @inferred(GPCRAnalysis.strip_residue_range("Q8VGW6_MOUSE/31-308")) == "Q8VGW6_MOUSE"
@test @inferred(species("Q8VGW6_MOUSE/31-308")) == "MOUSE"
@test @inferred(uniprotX("Q8VGW6_MOUSE/31-308")) == "Q8VGW6"
# ClusalOmega MSA codes
@test uniprotX("Q5QD11|reviewed|Trace") == "Q5QD11"
# Examples from https://www.uniprot.org/help/accession_numbers
@test @inferred(uniprotX("A2BC19")) == "A2BC19"
@test @inferred(uniprotX("P12345")) == "P12345"
Expand Down

0 comments on commit 622a6d2

Please sign in to comment.