Documentation
¶
Overview ¶
Package agc reads Assembled Genomes Compressor (AGC) v3 archives.
Archives are decoded lazily from an io.ReaderAt. The package is read-only.
Index ¶
- Variables
- type Archive
- func (a *Archive) Close() error
- func (a *Archive) Contig(sample Sample, name string) (Contig, error)
- func (a *Archive) Contigs(sample Sample) ([]ContigInfo, error)
- func (a *Archive) IterateAll(yield func(Contig) error) error
- func (a *Archive) IterateSample(sample Sample, yield func(Contig) error) error
- func (a *Archive) ReferenceSample() (Sample, error)
- func (a *Archive) Samples() ([]Sample, error)
- func (a *Archive) Version() Version
- type Contig
- type ContigInfo
- type Sample
- type Version
Constants ¶
This section is empty.
Variables ¶
var ( // ErrClosed is returned when an operation uses a closed archive. ErrClosed = errors.New("agc: archive is closed") // ErrCorruptArchive marks malformed, truncated, or inconsistent input. ErrCorruptArchive = errors.New("agc: corrupt archive") // ErrUnsupportedVersion marks an AGC archive whose file-format major version is not 3. ErrUnsupportedVersion = errors.New("agc: unsupported file-format version") // ErrSampleNotFound marks a lookup for a sample not present in the archive. ErrSampleNotFound = errors.New("agc: sample not found") // ErrContigNotFound marks a lookup for a contig not present in the selected sample. ErrContigNotFound = errors.New("agc: contig not found") )
Functions ¶
This section is empty.
Types ¶
type Archive ¶
type Archive struct {
// contains filtered or unexported fields
}
Archive is an open, read-only AGC v3 archive.
func OpenReaderAt ¶
OpenReaderAt opens an AGC v3 archive from a ReaderAt and its exact size. The caller retains ownership of r; Archive.Close does not close it.
func (*Archive) Contig ¶
Contig retrieves and decodes a named contig from a sample. Name matching follows AGC: the query and stored header are compared up to the first ASCII whitespace, while the returned Contig.Name retains the full stored header.
func (*Archive) Contigs ¶
func (a *Archive) Contigs(sample Sample) ([]ContigInfo, error)
Contigs returns a sample's contigs in archive order. Each result retains its sample identity separately from its stored contig name.
func (*Archive) IterateAll ¶
IterateAll decodes every contig in archive sample order and contig order, stopping on the first error returned by yield.
func (*Archive) IterateSample ¶
IterateSample decodes a sample's contigs in archive order, holding at most one yielded contig's sequence at a time. Iteration stops on the first error returned by yield.
func (*Archive) ReferenceSample ¶
ReferenceSample returns the first sample stored in the v3 collection.
type ContigInfo ¶
ContigInfo identifies a contig and its owning sample separately.