View Source Bio.IO.FastQ (bio_ex_io v0.1.0)

Allow the input of FASTQ formatted files.

This implementation references the documentation from NCBI and uses the Phred scoring 33 offset by default when reading quality scores.

Summary

Functions

Read a FASTQ formatted file into memory

Read a FASTQ formatted file

Types

@type quality_encoding() :: :phred_33 | :phred_64 | :decimal
@type read_opts() :: {:quality_encoding, quality_encoding()} | {:type, module()}

Functions

Link to this function

read(filename, opts \\ [])

View Source
@spec read(filename :: Path.t(), opts :: [read_opts()]) ::
  {:ok, [{struct(), struct()}]} | {:error, File.posix()}

Read a FASTQ formatted file into memory

The read/2 function returns an error tuple of the content or error code from File.read. You can use :file.format_error/1 to get a descriptive string of the error.

Content is returned as a list of tuples where the first element is a struct of the type from the type option, and the second element is a Bio.QualityScore.

Options

  • type - The module for the Sequence type that you want the returned value in. Defaults to Bio.IO.SequenceTuple. Module should implement the Bio.Sequential behaviour or minimally expose a new/2 function which is parametrically isomorphic.
  • quality_encoding - Determines the encoding of the quality scores.
Link to this function

read!(filename, opts \\ [])

View Source
@spec read!(filename :: Path.t(), opts :: [read_opts()]) :: any() | no_return()

Read a FASTQ formatted file

The same as read/2, but will raise a File.Error on failure.