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)
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
FASTA.Record()

Create an unfilled FASTA record.

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.

FASTA.Record(str::AbstractString)

Create a FASTA record object from str.

This function verifies and indexes fields for accessors.

FASTA.Record(identifier, sequence)

Create a FASTA record object from identifier and sequence.

FASTA.Record(identifier, description, sequence)

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

hasidentifier(record::Record)

Checks whether or not the record has an identifier.

FASTX.identifierFunction.
identifier(record::Record)::Union{String, Nothing}

Get the sequence identifier of record.

Note

Returns nothing if the record has no identifier.

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

Get the sequence identifier of record.

Note

Returns nothing if the record has no identifier.

hasdescription(record::Record)

Checks whether or not the record has a description.

FASTX.descriptionFunction.
description(record::Record)::Union{String, Nothing}

Get the description of record.

Note

Returns nothing if record has no description.

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

Get the description of record.

Note

Returns nothing if record has no description.

hassequence(record::Record)

Checks whether or not a sequence record contains a sequence.

FASTX.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!.

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!.

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!.

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.

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!.

sequence(read::FASTQ.FASTQRead)

Get the sequence of a FASTQ read. Same as read.sequence

FASTX.FASTA.seqlenFunction.

Get the length of the fasta record's sequence.

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
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 '+'
FASTQ.Record()

Create an unfilled FASTQ record.

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.

FASTQ.Record(str::AbstractString)

Create a FASTQ record object from str.

This function verifies and indexes fields for accessors.

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

Create a FASTQ record from identifier, sequence and quality.

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

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

hasidentifier(record::Record)

Checks whether or not the record has an identifier.

Missing docstring.

Missing docstring for FASTQ.identifier. Check Documenter's build log for details.

hasdescription(record::Record)

Checks whether or not the record has a description.

Missing docstring.

Missing docstring for FASTQ.description. Check Documenter's build log for details.

hassequence(record::Record)

Checks whether or not a sequence record contains a sequence.

Note

Zero-length sequences are allowed in records.

Missing docstring.

Missing docstring for FASTQ.sequence. Check Documenter's build log for details.

FASTX.FASTQ.seqlenFunction.

Get the length of the fastq record's sequence.

hasquality(record::Record)

Check whether the given FASTQ record has a quality string.

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

Get the base quality of record.

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.

quality(read::FASTQ.FASTQRead)

Get the quality of a FASTQ read (Vector{UInt8}). Same as read.quality

Sanger (Phred+33) quality score encoding

Solexa (Solexa+64) quality score encoding

Illumina 1.3 (Phred+64) quality score encoding

Illumina 1.5 (Phred+64) quality score encoding

Illumina 1.8 (Phred+33) quality score encoding