elynx-seq-0.7.2.2: Handle molecular sequences
Copyright2021 Dominik Schrempf
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

ELynx.Character.Character

Description

Creation date: Fri Oct 12 16:24:02 2018.

See header of Alphabet.

Synopsis

Documentation

class (Show a, Read a, Eq a, Ord a, Enum a, Bounded a, Unbox a) => Character a where Source #

A set of characters forms an Alphabet. At the moment, Word8 is used, since none of the alphabets has more than 255 characters.

Methods

toWord :: a -> Word8 Source #

Write characters.

fromWord :: Word8 -> a Source #

Read characters.

fromChar :: Character a => Char -> a Source #

Conversion from Char.

toChar :: Character a => a -> Char Source #

Conversion to Char.

fromString :: Character a => String -> [a] Source #

Conversion from String.

toString :: Character a => [a] -> String Source #

Conversion to String.

class Character a => CharacterX a where Source #

An extended character type with gaps and unknowns.

Methods

gap :: a Source #

Instances

Instances details
CharacterX AminoAcidI Source # 
Instance details

Defined in ELynx.Character.AminoAcidI

CharacterX AminoAcidS Source # 
Instance details

Defined in ELynx.Character.AminoAcidS

CharacterX AminoAcidX Source # 
Instance details

Defined in ELynx.Character.AminoAcidX

CharacterX NucleotideI Source # 
Instance details

Defined in ELynx.Character.NucleotideI

CharacterX NucleotideX Source # 
Instance details

Defined in ELynx.Character.NucleotideX

isGap :: CharacterX a => a -> Bool Source #

Is the character a gap or unknown?

class CharacterX a => CharacterI a where Source #

IUPAC characters with a mapping to extended characters.

Methods

unknown :: a Source #

iupac :: [a] Source #

toStandard :: a -> [a] Source #

isUnknown :: CharacterI a => a -> Bool Source #

Check if a IUPAC CharacterI is unknown (e.g., N for nucleotides).

isIUPAC :: CharacterI a => a -> Bool Source #

Is the given character a IUPAC character?

isStandard :: CharacterI a => a -> Bool Source #

Is the given character a standard character?

convert :: (Character a, Character b) => a -> b Source #

Convert between character classes. May throw error.