EntrezHTTP-1.0.3: Libary to interface with the NCBI Entrez REST service.

Safe HaskellNone
LanguageHaskell98

Bio.EntrezHTTP

Contents

Description

Interface for the NCBI Entrez REST webservice.

The entrezHTTP function provides a interface to the NCBI Entrez REST service.

A series of different eutilites and databases are provided by the REST interface. Response depends on the combination of eutil and database, as well requested returntype. Specific combinations have wrapper functions with corresponding parsing functions included (see Usage example).

If you use this libary in a tool, please read A General Introduction to the E-utilities carefully and register your tool at eutilities@ncbi.nlm.nih.gov. You can append your registration info generated with the included buildRegistration function to your query.

Usage example:

Retrieve a nucleotide sequence for Escherichia coli

 nucleotideFasta <- fetchNucleotideString "NC_000913.3" 50 1000 "+" Nothing

Synopsis

Datatypes

Retrieval function

entrezHTTP :: EntrezHTTPQuery -> IO String Source #

Function for querying the NCBI entrez REST interface. Input EntrezHTTPQuery datatype is used to select database, program of interest and contains the query string. Please note that query strings containing whitespace or special characters need to be urlencoded. The response format and content depends on the query type, the output therefore provided as String.

retrieveGeneSymbolFasta :: String -> String -> Maybe (String, String) -> IO String Source #

Retrieve sequence for gene symbol (e.g. yhfA) from accession number (e.g. NC_000913.3) and if available entrez registration (toolname,devemail)

fetchNucleotideString :: String -> Int -> Int -> Int -> Maybe (String, String) -> IO String Source #

Fetches sequence strings from the nucleotide database. nucleotideId can be a NCBI accession number or gene id. Strand is 1 in case of plus strand (forward) or 2 minus (reverse) strand, the setStrand function can be used for conversion.

retrieveElementsEntrez :: [a] -> ([a] -> IO b) -> IO [b] Source #

Wrapper function for eutils that accept a list of querys (e.g. a list of gene ids) that ensures that only chunks of 20 queries are sent per request. Sending to long queries otherwise results in a serverside exception.

portionListElements :: [a] -> Int -> [[a]] Source #

Parsing functions

readEntrezTaxonSet :: String -> [Taxon] Source #

Read entrez fetch for taxonomy database into a simplyfied datatype Result of e.g: http://eutils.ncbi.nlm.nih.

readEntrezSimpleTaxons :: String -> [SimpleTaxon] Source #

Read entrez fetch for taxonomy database into a simplyfied datatype Result of e.g: http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=taxonomy&id=1406860

readEntrezSummaries :: String -> [EntrezSummary] Source #

Read entrez summary from internal haskell string

readEntrezSearch :: String -> [EntrezSearch] Source #

Read entrez summary from internal haskell string

auxiliary functions

buildRegistration :: String -> String -> String Source #

Builds Entrez registration String that has to be appended to query key

maybeBuildRegistration :: Maybe (String, String) -> String Source #

Builds Entrez registration String if present