-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Modify fasta (and CLIP) files in several optional ways
--   
--   Modify fasta (and CLIP) files in several optional ways
@package modify-fasta
@version 0.8.2.3

module Types
data GeneticUnit
AminoAcid :: GeneticUnit
Nucleotide :: GeneticUnit
data FrameType
InFrame :: FrameType
OutFrame :: FrameType
type ID = Int
type Codon = Text
type CodonMut = Int
type Field = Int
type Start = Int
type Stop = Int
type Position = Int
type Frame = Int
type CloneEntry = (Germline, [FastaSequence])
type FillInValue = (Field, Start, Char)
type CodonTable = [(Text, Char)]
type Mutation = (Char, Char)
type CountMap = Map (Position, Mutation) Int
type CodonMutations = [[(Position, Mutation)]]
instance GHC.Show.Show Types.FrameType
instance GHC.Read.Read Types.FrameType
instance GHC.Show.Show Types.GeneticUnit
instance GHC.Read.Read Types.GeneticUnit

module Utility

-- | Adds the length of a sequence to the header of that sequence
addLengthHeader :: FastaSequence -> FastaSequence

-- | Adds the mutations of a sequence to the header of that sequence
addMutationsHeader :: Bool -> Field -> FastaSequence -> FastaSequence

-- | Adds filler germlines to normal fasta files
addFillerGermlines :: [FastaSequence] -> CloneMap

-- | Replace characters in the first string with another in the second
--   string if they are equal to a certain character and they aren't
--   replaced with a gap.
replaceChars :: Char -> Text -> Text -> Text

-- | Error for left
fromEither :: Either Text b -> b

module TransformFastaList

-- | Convert sequences to amino acids
convertToAminoAcidsFastaSequence :: CodonTable -> FastaSequence -> FastaSequence

-- | Replace characters in the first string with another in the second
--   string if they are equal to a certain character and they aren't
--   replaced with a gap.
replaceChars :: Char -> Text -> Text -> Text

-- | Fill in the sequence with corrected nucleotides or amino acids
fillInSequence :: Field -> Start -> Char -> FastaSequence -> FastaSequence

-- | Change a field to a match, so a regex "ch.*_" to field 2 of
--   "&gt;abc|brie_cheese_dude" would result in "&gt;abc|cheese_". Useful
--   for getting specific properties from a field
changeField :: Maybe Field -> Text -> FastaSequence -> FastaSequence

-- | Change all fields to their matches based on changeField
changeAllFields :: FastaSequence -> [(Maybe Int, Text)] -> FastaSequence

-- | Get a region of a sequence, 1 indexed
getRegionSequence :: Maybe Start -> Maybe Stop -> FastaSequence -> FastaSequence

-- | Trim off extra nucleotides (or amino acids) from a fasta sequence. If
--   inframe and outframe are specified, instead cut off based on those
--   frames.
trimFasta :: GeneticUnit -> Maybe Frame -> Maybe Frame -> FastaSequence -> FastaSequence

-- | Convert non standard nucleotides to gaps
removeUnknownNucs :: FastaSequence -> FastaSequence

module Print

-- | Return the results of the filtration in text form for saving to a file
printFasta :: CloneMap -> Text

-- | Return the results of the filtration in text form for saving to a file
--   and excluding germline
printFastaNoGermline :: CloneMap -> Text
printSequenceCount :: Bool -> Int -> CloneMap -> Text

-- | Takes a clone entry and returns a formatted text with or without
--   germline
printCloneEntry :: Bool -> CloneEntry -> Text

module FilterFastaList

-- | Remove clone sequences that have stop codons in the first stopRange
--   codons
hasNoStops :: GeneticUnit -> CodonTable -> Int -> FastaSequence -> Bool

-- | Remove out of frame sequences
isInFrame :: FastaSequence -> Bool

-- | Remove sequences that do not contain the string customFilter in the
--   customField location, split by "|". Note that this is 1 indexed and 0
--   means to search the entire header for the customFilter. If the
--   customRemove option is enabled, this function will instead remove
--   sequences that have headers which match the custom filter, as opposed
--   to the other way around (this is defined in the "equal" function).
--   Also takes into account whether to filter on the germline versus the
--   actual sequences.
hasCustomFilter :: Bool -> Maybe Int -> Text -> FastaSequence -> Bool
hasAllCustomFilters :: Bool -> [(Maybe Int, Text)] -> FastaSequence -> Bool

module FilterCloneList

-- | Remove highly mutated sequences (sequences with more than a third of
--   their sequence being mutated).
filterHighlyMutatedEntry :: GeneticUnit -> CodonTable -> CloneEntry -> CloneEntry

module Diversity

-- | Takes two strings, returns Hamming distance
hamming :: Text -> Text -> Int

module FilterCloneMap

-- | Check if the data structure is Right
isRight' :: Either a b -> Bool

-- | Altered version of listToMaybe
listToMaybe' :: [a] -> Maybe [a]

-- | Remove highly mutated sequences (sequences with more than a third of
--   their sequence being mutated).
filterHighlyMutated :: GeneticUnit -> CodonTable -> CloneMap -> (CloneMap, Maybe String)

-- | Replace codons that have more than CodonMut mutations (make them "---"
--   codons).
removeCodonMutCount :: CodonMut -> Text -> Text -> CloneMap -> CloneMap

-- | Remove clone sequences that have stop codons in the first stopRange
--   codons
removeStopsCloneMap :: GeneticUnit -> CodonTable -> Int -> CloneMap -> (CloneMap, Maybe String)

-- | Remove duplicate sequences
removeDuplicatesCloneMap :: CloneMap -> CloneMap

-- | Remove out of frame sequences
removeOutOfFrameSeqs :: CloneMap -> CloneMap

-- | Remove sequences that do not contain the string customFilter in the
--   customField location, split by "|". Note that this is 1 indexed and 0
--   means to search the entire header for the customFilter. If the
--   customRemove option is enabled, this function will instead remove
--   sequences that have headers which match the custom filter, as opposed
--   to the other way around (this is defined in the "equal" function).
--   Also takes into account whether to filter on the germline versus the
--   actual sequences.
removeCustomFilter :: Bool -> Bool -> Maybe Int -> Text -> CloneMap -> CloneMap
removeAllCustomFilters :: Bool -> Bool -> CloneMap -> [(Maybe Int, Text)] -> CloneMap

-- | Remove clones that do not have any sequences after the filtrations
removeEmptyClone :: CloneMap -> CloneMap

-- | Convert sequences to amino acids
convertToAminoAcidsCloneMap :: CodonTable -> CloneMap -> (CloneMap, Maybe String)

module TransformCloneList

-- | Replace codons that have more than CodonMut mutations (make them "---"
--   codons) and don't have gaps in them.
onlyMutations :: CodonMut -> Text -> Text -> CloneEntry -> CloneEntry

-- | Only include codons containing mutations found in a certain number of
--   mutants
frequentMutations :: Maybe Int -> Maybe Int -> Maybe Double -> CloneEntry -> CloneEntry
