View Source Bio.IO.FastQ (bio_elixir v0.3.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.
Link to this section Summary
Link to this section Types
@type quality_encoding() :: :phred_33 | :phred_64 | :decimal
@type read_opts() :: {:quality_encoding, quality_encoding()} | {:type, module()}
Link to this section Functions
@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
Options
type
- The module for the Sequence type that you want the returned value in. Defaults toBio.Sequence.DnaStrand
. Module should implement theBio.Sequential
behaviour.quality_encoding
- Determines the encoding of the quality scores.
Read a FASTQ formatted file
The same as read/2
, but will raise a File.Error
on failure.