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


-- | Libary for processing the NCBI genbank format
--   
--   Haskell cabal Genbank libary contains tools, parser and datastructures
--   for the NCBI (National Center for Biotechnology Information) Genbank
--   format.
--   
--   For more information on genbank refer to:
--   <a>http://www.ncbi.nlm.nih.gov/genbank/</a>
--   
--   For a sample genbank record see:
--   <a>http://www.ncbi.nlm.nih.gov/Sitemap/samplerecord.html</a>
--   
--   <a>Bio.GenbankData</a> - Datastructures for Genbank format
--   
--   Contains Haskell datastructures for Genbank format and for contained
--   features, subfeatures
--   
--   <a>Bio.GenbankParser</a> - Parse Genbank format
--   
--   Contains Haskell functions to parse Genbank format from files or
--   internal Strings.
--   
--   <a>Bio.GenbankTools</a> - Tools for processing Genbank
--   
--   Contains Haskell functions to extract nucleotide sequences for
--   features
@package Genbank
@version 1.0.3


-- | This module contains data structures for genbank format For more
--   information on genbank consult:
--   <a>http://www.ncbi.nlm.nih.gov/genbank/</a> Genbank record sample:
--   <a>http://www.ncbi.nlm.nih.gov/Sitemap/samplerecord.html</a>
module Bio.GenbankData

-- | Genbank type representing the content of a genbank record
data Genbank
Genbank :: ByteString -> Int -> ByteString -> Maybe ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> Maybe ByteString -> ByteString -> ByteString -> ByteString -> [Reference] -> Maybe ByteString -> [Feature] -> Maybe String -> SeqData -> Genbank
[locus] :: Genbank -> ByteString
[genbankLength] :: Genbank -> Int
[moleculeType] :: Genbank -> ByteString
[circular] :: Genbank -> Maybe ByteString
[division] :: Genbank -> ByteString
[creationDate] :: Genbank -> ByteString
[definition] :: Genbank -> ByteString
[accession] :: Genbank -> ByteString
[version] :: Genbank -> ByteString
[geneIdentifier] :: Genbank -> ByteString
[dblink] :: Genbank -> Maybe ByteString
[keywords] :: Genbank -> ByteString
[source] :: Genbank -> ByteString
[organism] :: Genbank -> ByteString
[references] :: Genbank -> [Reference]
[comment] :: Genbank -> Maybe ByteString
[features] :: Genbank -> [Feature]
[contig] :: Genbank -> Maybe String
[origin] :: Genbank -> SeqData

-- | Genbank Feature - e.g gene, repeat region
data Feature
Feature :: ByteString -> CoordinateSet -> [Attribute] -> [SubFeature] -> Feature
[featureType] :: Feature -> ByteString
[featureCoordinates] :: Feature -> CoordinateSet
[attributes] :: Feature -> [Attribute]
[subFeatures] :: Feature -> [SubFeature]

-- | Genbank attribute of feature or subfeature, either a flag field or a
--   GO attribute
data Attribute
Flag :: ByteString -> Attribute
[flagType] :: Attribute -> ByteString
Field :: ByteString -> ByteString -> Attribute
[fieldType] :: Attribute -> ByteString
[fieldValue] :: Attribute -> ByteString
GOattribute :: ByteString -> ByteString -> ByteString -> Attribute
[gotype] :: Attribute -> ByteString
[goid] :: Attribute -> ByteString
[goname] :: Attribute -> ByteString

-- | Genbank subfeature, e.g. CDS, MiscFeature, NcRNA, Mobile Element, STS
--   rRNA, tRNA, tmRNA, reporigin
data SubFeature
SubFeature :: ByteString -> CoordinateSet -> [Attribute] -> Maybe SeqData -> SubFeature
[subFeatureType] :: SubFeature -> ByteString
[subFeatureCoordinates] :: SubFeature -> CoordinateSet
[subFeatureAttributes] :: SubFeature -> [Attribute]
[subFeatureTranslation] :: SubFeature -> Maybe SeqData

-- | Genbank reference associating record with publication
data Reference
Reference :: Int -> Maybe Int -> Maybe Int -> String -> String -> String -> Maybe String -> Maybe String -> Reference
[index] :: Reference -> Int
[baseFrom] :: Reference -> Maybe Int
[baseTo] :: Reference -> Maybe Int
[authors] :: Reference -> String
[title] :: Reference -> String
[journal] :: Reference -> String
[pubmedId] :: Reference -> Maybe String
[remark] :: Reference -> Maybe String

-- | Coordinate pair for a nucleotide sequence
data Coordinates
Coordinates :: Int -> Maybe Char -> Int -> Maybe Char -> Bool -> Coordinates
[coordinatesFrom] :: Coordinates -> Int
[coordinateFromEqualitySymbol] :: Coordinates -> Maybe Char
[coordinatesTo] :: Coordinates -> Int
[coordinateToEqualitySymbol] :: Coordinates -> Maybe Char
[complement] :: Coordinates -> Bool
data DbXRef
DbXRef :: ByteString -> ByteString -> DbXRef
[db] :: DbXRef -> ByteString
[ref] :: DbXRef -> ByteString

-- | Set of coordinates, with type order, join
data CoordinateSet
CoordinateSet :: [Coordinates] -> Maybe String -> CoordinateSet
[setCoordinates] :: CoordinateSet -> [Coordinates]
[setType] :: CoordinateSet -> Maybe String

-- | Slices of the nucleotide sequence contained in the Genbank record
data OriginSlice
OriginSlice :: Int -> String -> OriginSlice
[originIndex] :: OriginSlice -> Int
[originSequence] :: OriginSlice -> String

-- | Gene Onthology term
data GOterm
GOterm :: String -> String -> String -> GOterm
[goType] :: GOterm -> String
[goId] :: GOterm -> String
[goName] :: GOterm -> String
instance GHC.Classes.Eq Bio.GenbankData.GOterm
instance GHC.Show.Show Bio.GenbankData.GOterm
instance GHC.Classes.Eq Bio.GenbankData.OriginSlice
instance GHC.Show.Show Bio.GenbankData.OriginSlice
instance GHC.Classes.Eq Bio.GenbankData.Genbank
instance GHC.Show.Show Bio.GenbankData.Genbank
instance GHC.Classes.Eq Bio.GenbankData.Feature
instance GHC.Show.Show Bio.GenbankData.Feature
instance GHC.Classes.Eq Bio.GenbankData.SubFeature
instance GHC.Show.Show Bio.GenbankData.SubFeature
instance GHC.Classes.Eq Bio.GenbankData.CoordinateSet
instance GHC.Show.Show Bio.GenbankData.CoordinateSet
instance GHC.Classes.Eq Bio.GenbankData.DbXRef
instance GHC.Show.Show Bio.GenbankData.DbXRef
instance GHC.Classes.Eq Bio.GenbankData.Coordinates
instance GHC.Show.Show Bio.GenbankData.Coordinates
instance GHC.Classes.Eq Bio.GenbankData.Reference
instance GHC.Show.Show Bio.GenbankData.Reference
instance GHC.Classes.Eq Bio.GenbankData.Attribute
instance GHC.Show.Show Bio.GenbankData.Attribute


-- | Functions for parsing genebank format
module Bio.GenbankParser

-- | Parse the input as Genbank datatype
parseGenbank :: String -> Either ParseError Genbank

-- | Read the file as Genbank datatype
readGenbank :: String -> IO (Either ParseError Genbank)


-- | Functions for processing of genbank data Extraction of feature
--   sequences (header,sequencedata) or sequence data
module Bio.GenbankTools

-- | Extract nucleotide sequence data for all features of specified type,
--   Nothing as specific feature extracts all feature sequence seqdatas
extractSpecificFeatureSeqData :: Maybe String -> Genbank -> [SeqData]

-- | Extract header (locus identifier, locus tag) and nucleotide sequence
--   data for all features of specified type, Nothing as specific feature
--   extracts all feature sequences
extractSpecificFeatureSequence :: Maybe String -> Genbank -> [Sequence]
