package biocaml

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Entrez Utilities API

This modules provides a partial access to Entrez databases such as Pubmed, Gene or Protein. The API proposed by the NCBI is based on HTTP requests, and this modules contains a couple of functions to ease the construction of appropriate URLs. This module also offers a more high-level access, with parsers for the answers from Entrez.

Databases in Entrez can be seen as collections of records, each record representing an object of the database. The basic usage of the low-level API is first to search a database with the esearch utility. Given a query string, esearch will return a collection of identifiers. These identifiers are then used to fetch the actual records with the efetch utility. These two operations are done in one call with the high-level API.

type database = [
  1. | `gene
  2. | `genome
  3. | `geodatasets
  4. | `geoprofiles
  5. | `protein
  6. | `pubmed
  7. | `pubmedcentral
  8. | `sra
  9. | `unigene
  10. | `taxonomy
]

Represents available databases

Low level access

For a documentation of the parameters, see this reference

val esearch_url : ?retstart:int -> ?retmax:int -> ?rettype:[ `uilist | `count ] -> ?field:string -> ?datetype:[ `pdat | `mdat | `edat ] -> ?reldate:int -> ?mindate:string -> ?maxdate:string -> database -> string -> string

Construction of esearch URLs.

type esearch_answer = {
  1. count : int;
  2. retmax : int;
  3. retstart : int;
  4. ids : string list;
}

Represents the result of a request to esearch

val esearch_answer_of_string : string -> esearch_answer

Parses an answer of esearch under XML format

val esummary_url : ?retstart:int -> ?retmax:int -> database -> string list -> string

Construction of esummary URLs

val efetch_url : ?rettype:string -> ?retmode:[ `xml | `text | `asn_1 ] -> ?retstart:int -> ?retmax:int -> ?strand:[ `plus | `minus ] -> ?seq_start:int -> ?seq_stop:int -> database -> string list -> string

Construction of efetch URLs. Note that this access method does not support more than 200 ids. For legible values of rettype and retmode please consult the official specification.

High level access
module type Fetch = sig ... end

A signature for an HTTP request framework

module Make (F : Fetch) : sig ... end
OCaml

Innovation. Community. Security.