FASTX

Latest Release MIT license DOI Pkg Status Chat

Read and write files in FASTA and FASTQ format, the most common biological sequence file format.

Installation

You can install FASTX from the julia REPL. Press ] to enter pkg mode again, and enter the following:

(v1.8) pkg> add FASTX

Quickstart

"FASTX" is a shorthand for the two related formats FASTA and FASTQ, which are handled by the two modules FASTX.FASTA and FASTX.FASTQ, respectively.

  • Construct records from raw parts
julia> record = FASTARecord("some header", dna"TAGAAGA");

julia> (identifier(record), description(record), sequence(record))
("some", "some header", "TAGAAGA")

julia> sequence(LongDNA{2}, record)
7nt DNA Sequence:
TAGAAGA
  • Validate files
julia> validate_fasta(IOBuffer(">ABC\nDEF")) === nothing
true

julia> validate_fastq(IOBuffer("@ABC\nTAG\n+\nDDD")) === nothing
true
  • Read FASTX files
record = FASTAReader(first, IOBuffer(">ABC\nDEF"))

sequence(record) == "DEF" # should be true

# Or with do-syntax
FASTAReader(GzipDecompressorStream(open(path))) do reader
    for record in reader
        # do something with record
    end
end
  • Write FASTX files
FASTQWriter(open(path, "w")) do writer
    for record in records
        write(writer, record)
    end
end

See more details in the sections in the sidebar.

Contributing

We appreciate contributions from users including reporting bugs, fixing issues, improving performance and adding new features.

Take a look at the contributing files detailed contributor and maintainer guidelines, and code of conduct.