Public

Public API Reference

Contents

FASTA API

The following methods and types are provided by the FASTA submodule for public use. They are not exported as in general using FASTX requires qualifying the submodule (FASTA or FASTQ) that you are using.

FASTA.Reader(input::IO; index = nothing)

Create a data reader of the FASTA file format.

Arguments

  • input: data source
  • index=nothing: filepath to a random access index (currently fai is supported)
source
FASTA.Writer(output::IO; width=70)

Create a data writer of the FASTA file format.

Arguments

  • output: data sink
  • width=70: wrapping width of sequence characters
source
FASTA.Record()

Create an unfilled FASTA record.

source
FASTA.Record(data::Vector{UInt8})

Create a FASTA record object from data.

This function verifies and indexes fields for accessors.

Warning

Note that the ownership of data is transferred to a new record object. Editing the input data will edit the record, and is not advised after construction of the record.

source
FASTA.Record(str::AbstractString)

Create a FASTA record object from str.

This function verifies and indexes fields for accessors.

source
FASTA.Record(identifier, sequence)

Create a FASTA record object from identifier and sequence.

source
FASTA.Record(identifier, description, sequence)

Create a FASTA record object from identifier, description and sequence.

source
hasidentifier(record::Record)

Checks whether or not the record has an identifier.

source
identifier(record::Record)::Union{String, Nothing}

Get the sequence identifier of record.

Note

Returns nothing if the record has no identifier.

source
hasdescription(record::Record)

Checks whether or not the record has a description.

source
description(record::Record)::Union{String, Nothing}

Get the description of record.

Note

Returns nothing if record has no description.

source
hassequence(record::Record)

Checks whether or not a sequence record contains a sequence.

source
FASTX.FASTA.sequenceFunction.
sequence(::Type{S}, record::Record, [part::UnitRange{Int}])::S

Get the sequence of record.

S can be either a subtype of BioSequences.BioSequence or String. If part argument is given, it returns the specified part of the sequence.

Note

This method makes a new sequence object every time. If you have a sequence already and want to fill it with the sequence data contained in a fasta record, you can use Base.copyto!.

source
sequence(record::Record, [part::UnitRange{Int}])

Get the sequence of record.

This function infers the sequence type from the data. When it is wrong or unreliable, use sequence(::Type{S}, record::Record). If part argument is given, it returns the specified part of the sequence.

Note

This method makes a new sequence object every time. If you have a sequence already and want to fill it with the sequence data contained in a fasta record, you can use Base.copyto!.

source
FASTX.FASTA.seqlenFunction.

Get the length of the fasta record's sequence.

source

FASTQ API

The following methods and types are provided by the FASTQ submodule for public use. They are not exported as in general using FASTX requires qualifying the submodule (FASTA or FASTQ) that you are using.

FASTQ.Reader(input::IO; fill_ambiguous=nothing)

Create a data reader of the FASTQ file format.

Arguments

  • input: data source
  • fill_ambiguous=nothing: fill ambiguous symbols with the given symbol
source
FASTQ.Writer(output::IO; quality_header=false)

Create a data writer of the FASTQ file format.

Arguments

  • output: data sink
  • quality_header=false: output the title line at the third line just after '+'
source
FASTQ.Record()

Create an unfilled FASTQ record.

source
FASTQ.Record(data::Vector{UInt8})

Create a FASTQ record object from data.

This function verifies and indexes fields for accessors.

Warning

Note that the ownership of data is transferred to a new record object. Editing the input data will edit the record, and is not advised after construction of the record.

source
FASTQ.Record(str::AbstractString)

Create a FASTQ record object from str.

This function verifies and indexes fields for accessors.

source
FASTQ.Record(identifier, sequence, quality; offset=33)

Create a FASTQ record from identifier, sequence and quality.

source
FASTQ.Record(identifier, description, sequence, quality; offset=33)

Create a FASTQ record from identifier, description, sequence and quality.

source
hasidentifier(record::Record)

Checks whether or not the record has an identifier.

source
identifier(record::Record)::Union{String,Nothing}

Get the sequence identifier of record.

Note

Returns nothing if the record has no identifier.

source
hasdescription(record::Record)

Checks whether or not the record has a description.

source
description(record::Record)::Union{String, Nothing}

Get the description of record.

Note

Returns nothing if record has no description.

source
hassequence(record::Record)

Checks whether or not a sequence record contains a sequence.

Note

Zero-length sequences are allowed in records.

source
FASTX.FASTQ.sequenceFunction.
sequence(::Type{S}, record::Record, [part::UnitRange{Int}])

Get the sequence of record.

S can be either a subtype of BioSequences.LongSequence or String. If part argument is given, it returns the specified part of the sequence.

Note

This method makes a new sequence object every time. If you have a sequence already and want to fill it with the sequence data contained in a fastq record, you can use Base.copyto!.

source
sequence(::Type{String}, record::Record, [part::UnitRange{Int}])::String

Get the sequence of record as a String. If part argument is given, it returns the specified part of the sequence.

source
sequence(record::Record, [part::UnitRange{Int}])::BioSequences.DNASequence

Get the sequence of record.

Note

This method makes a new sequence object every time. If you have a sequence already and want to fill it with the sequence data contained in a fastq record, you can use Base.copyto!.

source
FASTX.FASTQ.seqlenFunction.

Get the length of the fastq record's sequence.

source
hasquality(record::Record)

Check whether the given FASTQ record has a quality string.

source
FASTX.FASTQ.qualityFunction.
quality(record::Record, [offset::Integer=33, [part::UnitRange]])::Vector{UInt8}

Get the base quality of record.

source
quality(record::Record, encoding_name::Symbol, [part::UnitRange])::Vector{UInt8}

Get the base quality of record by decoding with encoding_name.

The encoding_name can be either :sanger, :solexa, :illumina13, :illumina15, or :illumina18.

Note

Returns nothing if the record has no quality string.

source

Sanger (Phred+33) quality score encoding

source

Solexa (Solexa+64) quality score encoding

source

Illumina 1.3 (Phred+64) quality score encoding

source

Illumina 1.5 (Phred+64) quality score encoding

source

Illumina 1.8 (Phred+33) quality score encoding

source