Predicates

A number of predicate or query functions are supported for sequences, allowing you to check for certain properties of a sequence.

BioSequences.isrepetitiveFunction
isrepetitive(seq::BioSequence, n::Integer = length(seq))

Return true if and only if seq contains a repetitive subsequence of length ≥ n.

source
BioSequences.ispalindromicFunction
ispalindromic(seq::NucSeq) -> Bool

Check if seq is palindromic. A palindromic sequence is identical to its reverse-complement, so this should be equivalent to checking if seq == reverse_complement(seq).

Examples

julia> ispalindromic(dna"TGCA")
true

julia> ispalindromic(dna"TCCT")
false

julia> ispalindromic(rna"ACGGU")
false

Return true if seq is a palindromic sequence; otherwise return false.

source
BioSequences.iscanonicalFunction
iscanonical(seq::NucleotideSeq)

Returns true if seq is canonical.

For any sequence, there is a reverse complement, which is the same sequence, but on the complimentary strand of DNA:

------->
ATCGATCG
CGATCGAT
<-------
Note

Using the reverse_complement of a DNA sequence will give give this reverse complement.

Of the two sequences, the canonical of the two sequences is the lesser of the two i.e. canonical_seq < other_seq.

source