lib

package
v0.0.0-...-32ad967 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLineage

func AddLineage[K any](taxids map[string]K, data_dir string, format string) map[string]*Lineage

func Confidence

func Confidence(abundances map[string]uint32, classification string) float64

func Entropy

func Entropy(abundances map[string]uint32) float64

func FilterReads

func FilterReads(k2path string, out string, data_dir string,
	format string, min_consistency float64, max_entropy float64, max_multiplicity uint32) error

func GetFormat

func GetFormat(filename string) (string, bool)

func GetLeaf

func GetLeaf(lin *Lineage) (int, string)

func GetRanks

func GetRanks(format string) []string

func HasTaxonkit

func HasTaxonkit() (string, bool)

func Multiplicity

func Multiplicity(abundances map[string]uint32) uint32

func ParseMapping

func ParseMapping(k2map Mapping, line string) error

func SampleAppend

func SampleAppend(files []string, out string, sep rune) error

func SaveMapping

func SaveMapping(k2map Mapping, filepath string, sample_id string) error

func ScoreReadsToFile

func ScoreReadsToFile(k2path string, out string, data_dir string, format string) error

func SimpleAppend

func SimpleAppend(files []string, out string) error

func TaxonDB

func TaxonDB(filepath string, data_dir string, format string) (map[string]*Lineage, int)

func UpdateMapping

func UpdateMapping(entry *Taxon, kmer_taxid string, count int)

Types

type Lineage

type Lineage struct {
	Names  []string
	Taxids []string
}

type Mapping

type Mapping map[string]*Taxon

func CollapseRanks

func CollapseRanks(k2map Mapping, data_dir string, format string) Mapping

func SummarizeKmers

func SummarizeKmers(filepath string) (Mapping, error)

Summarize combines

type ReadScore

type ReadScore struct {
	TaxonName    string
	TaxonID      uint32
	ID           string
	Kmers        uint32
	Consistency  float64
	Confidence   float64
	Multiplicity uint32
	Entropy      float64
}

func ScoreRead

func ScoreRead(line string, taxondb map[string]*Lineage) *ReadScore

type Taxon

type Taxon struct {
	Lineage string
	Reads   int
	Classes map[string]int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL