A library for reading and writing common file formats used in bioinformatics like FASTA files


Build and test Coverage Status

The full API is browsable here.

Bio_io is an OCaml library that provides programmatic access to common file formats used in bioinformatics like FASTA files.

If you have any issues or find any bugs, open an issue on the GitHub page.


license MIT or Apache 2.0

Licensed under the Apache License, Version 2.0 or the MIT license, at your option. This program may not be copied, modified, or distributed except according to those terms.


The Bio_io library provides input channels that return records.

For an overview see the Record_in_channel.S module signature. In fact, all the In_channels in this library satisfy this signature.

The Fasta module provides a Record and In_channel for reading FASTA files.

There are modules for reading "delimited" files like those output by Btab and Mmseqs.

Extending Bio_io

The Record_in_channel.Make functor can be used to make new specialized Record_in_chnanels. To do so, you need a module that satisfies the Record_in_channel.In_channel_input_record signature. Bio_io has a couple of In_channel types in the Private module you can use for this, and then add in the input_record_exn function.

For examples of this, see the definitions of Fasta.In_channel and Mmseqs.In_channel.