cljam.io.sequence

Functions to read and write formats representing sequences such as FASTA and
TwoBit.

fasta-reader

(fasta-reader f)
Returns an open cljam.io.fasta.reader.FASTAReader of f. Should be used inside
with-open to ensure the reader is properly closed.

fasta-writer

(fasta-writer f)(fasta-writer f options)
Returns an open cljam.io.fasta.writer.FASTAWriter of f with options:
  :cols - Maximum number of characters written in one row.
  :create-index? - If true, .fai will be created simultaneously.
Should be used inside with-open to ensure the writer is properly closed.

indexed?

(indexed? rdr)
Returns true if the reader can be randomly accessed, false if not. Note this
function immediately realizes a delayed index.

read-all-sequences

(read-all-sequences rdr)(read-all-sequences rdr option)
Reads all sequences of FASTA/TwoBit file.

read-indices

(read-indices rdr)
Reads metadata of indexed sequences. Returns a vector of maps containing
`:name`, `:len` and other format-specific keys. Forces loading all indices.

read-seq-summaries

(read-seq-summaries rdr)
Returns summaries of sequences in FASTA/TwoBit file. Returns a vector of maps
containing `:name` and `:len`.

read-sequence

(read-sequence rdr region)(read-sequence rdr region option)
Reads sequence in region of FASTA/TwoBit file.

reader

(reader f)
Selects suitable reader from f's extension, returning the open reader. Opens
a new reader if the arg represents a file such as String path, java.io.File,
or java.net.URL. If a reader is given, clones the reader. This function
supports FASTA and TwoBit formats.

twobit-reader

(twobit-reader f)
Returns an open cljam.io.twobit.reader.TwoBitReader of f. Should be used
inside with-open to ensure the reader is properly closed.

twobit-writer

(twobit-writer f)(twobit-writer f options)
Returns an open cljam.io.twobit.writer.TwoBitWriter of f with options:
  :index - metadata of indexed sequences. The amount of memory usage can be
    reduced if index is supplied.
Should be used inside with-open to ensure the writer is properly closed.

write-sequences

(write-sequences wtr seqs)
Writes all sequences to FASTA/TwoBit file.

writer

(writer f & options)
Selects suitable writer from f's extension, returning the open writer. This
function supports FASTA and TwoBit format.