Documentation
¶
Index ¶
- Constants
- func Build(dataDir string, logf func(string, ...any)) error
- func Exists(dataDir string) bool
- type DB
- func (d *DB) Close() error
- func (d *DB) InfoRow(sampleAccession string) (map[string]string, error)
- func (d *DB) MLSTForSample(sampleAccession string) (map[string]string, error)
- func (d *DB) Query(params QueryParams) ([]map[string]string, error)
- func (d *DB) QueryStats(species string, hqOnly bool) (Stats, error)
- func (d *DB) SpeciesList(limit int) ([]SpeciesCount, error)
- type QueryParams
- type SpeciesCount
- type Stats
Constants ¶
const IndexFileName = "atb_index.sqlite"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps a read-only SQLite connection to the index.
func (*DB) MLSTForSample ¶
MLSTForSample returns MLST fields for a single sample, or nil if not indexed.
func (*DB) Query ¶
func (d *DB) Query(params QueryParams) ([]map[string]string, error)
Query runs a filtered query returning result rows as map[string]string.
func (*DB) QueryStats ¶
QueryStats returns summary statistics, optionally filtered by species and/or HQ. Stats always exclude samples that aren't published on OSF (asm_fasta_on_osf == 0), so the four numbers match what users see in the published release tables.
func (*DB) SpeciesList ¶
func (d *DB) SpeciesList(limit int) ([]SpeciesCount, error)
SpeciesList returns species sorted by descending sample count. Only samples with an assembly actually published on OSF (asm_fasta_on_osf == 1) are counted, matching the published-release semantics used by atb summarise.
type QueryParams ¶
type QueryParams struct {
Species string
SpeciesLike string
Genus string
HQOnly bool
MinCompleteness float64
MaxContamination float64
MinN50 int64
Dataset string
HasAssembly bool
Samples []string
Columns []string
SortBy string
SortDesc bool
Limit int
Offset int
SequenceType string // filter by mlst_st
Scheme string // filter by mlst_scheme
MLSTStatus string // filter by mlst_status
MLSTOnly bool // exclude samples with no MLST scheme (empty or "-")
}
QueryParams controls what the Query method returns.
type SpeciesCount ¶
SpeciesCount holds a species name and its sample count.