forked from BioJulia/BioSequences.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The encode and decode methods are not allowed to produce invalid data. Instead, they throw an error when encountering invalid input data. This can lead to some frustration when checking if a symbol is permitted in an alphabet. One way to solve it is by checking `symbol in symbols(A)`, but this is not particularly effective. This PR adds a tryencode and trydecode method to existing alphabets. These methods return nothing when given invalid data. Methods encode and decode now internally call their try-variants. May solve BioJulia#219
- Loading branch information
1 parent
bf4aac5
commit 28a96bb
Showing
3 changed files
with
58 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters