BioGenerics
BioGenerics.Exceptions.MissingFieldException
BioGenerics.IO.AbstractFormattedIO
BioGenerics.IO.AbstractReader
BioGenerics.IO.AbstractWriter
Base.open
BioGenerics.IO.readertype
BioGenerics.IO.stream
BioGenerics.IO.tryread!
BioGenerics.IO.writertype
BioGenerics.Testing.intempdir
BioGenerics.Testing.random_aa
BioGenerics.Testing.random_array
BioGenerics.Testing.random_dna
BioGenerics.Testing.random_interval
BioGenerics.Testing.random_rna
BioGenerics.Testing.random_seq
Abstract formatted input/output type.
BioGenerics.IO.AbstractReader
— Type.Abstract data reader type.
See subtypes(AbstractReader)
for all available data readers.
BioGenerics.IO.AbstractWriter
— Type.Abstract data writer type.
See subtypes(AbstractWriter)
for all available data writers.
Base.open
— Method.Base.open(f, ios::Vararg{AbstractFormattedIO})
Execute f(ios...)
, then close
each io. close
is run even if f(ios...)
throws an exception.
Examples
julia> open(rdr"path/to/seqs.fna") do reader
# do something with reader
end
BioGenerics.IO.readertype
— Method.readertype(::Val{S}, arg)::T
Determine the type of reader that opens extension named by Symbol
S
. For example, readertype(::Val{:fa}, arg) = FASTA.Reader
. Should be extended by developers making new biological file format readers.
The extra argument arg
can be passed like so rdr"path.ext"arg
, and defaults to the empty string. This can be used to pass an additional argument that is specific to the person implementing the reader.
BioGenerics.IO.stream
— Function.stream(io::AbstractFormattedIO)
Return the underlying IO
object; subtypes of AbstractFormattedIO
must implement this method.
BioGenerics.IO.tryread!
— Method.tryread!(reader::AbstractReader, output)
Try to read the next element into output
from reader
.
If the result could not be read, then nothing
will be returned instead.
BioGenerics.IO.writertype
— Method.writertype(::Val{S}, arg)::T
Determine the type of reader that can write a file with an extension named by Symbol
S
. For example, writertype(::Val{:fa}, arg) = FASTA.Writer
. Should be extended by developers making new biological file format writers.
The extra argument arg
can be passed like so wtr"path.ext"arg
, and defaults to the empty string. This can be used to pass an additional argument that is specific to the person implementing the writer.
MissingFieldException <: Exception
An exception type thrown when a missing field of a record is accessed.
BioGenerics.Testing.intempdir
— Function.intempdir(fn::Function, parent = tempdir())
Execute some function fn
in a temporary directory. After the function is executed, the directory is cleaned by doing the equivalent of rm -r
.
BioGenerics.Testing.random_aa
— Method.random_aa(n, probs = [0.24, 0.24, 0.24, 0.24, 0.04])
Create a random amino acid sequence of length n
, by sampling the possible amino acid characters.
BioGenerics.Testing.random_array
— Method.random_array(n::Integer, elements, probs)
Create a random array of length n
, composed of possible elements
, which are selected according to their prob
.
BioGenerics.Testing.random_dna
— Function.random_dna(n, probs = [0.24, 0.24, 0.24, 0.24, 0.04])
Create a random DNA sequence of length n
, by sampling the nucleotides A, C, G, T, and N, according to their probability in probs
.
BioGenerics.Testing.random_interval
— Method.random_interval(minstart, maxstop)
Create a random interval between a minimum starting point, and a maximum stop point.
BioGenerics.Testing.random_rna
— Function.random_rna(n, probs = [0.24, 0.24, 0.24, 0.24, 0.04])
Create a random RNA sequence of length n
, by sampling the nucleotides A, C, G, U, and N, according to their probability in probs
.
BioGenerics.Testing.random_seq
— Method.random_seq(n::Integer, nts, probs)
Create a random sequence of length n
, composed of nts
, according to their prob
.