cmd

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BufferSize = 65536 //os.Getpagesize()

BufferSize is size of buffer

View Source
var RootCmd = &cobra.Command{
	Use:   "unikmer",
	Short: "Toolkit for k-mer with taxonomic information",
	Long: fmt.Sprintf(`unikmer - Toolkit for k-mer with taxonomic information

unikmer is a toolkit for nucleic acid k-mer analysis, providing functions
including set operation on k-mers optional with TaxIds but without count
information.

K-mers are either encoded (k<=32) or hashed (arbitrary k) into 'uint64',
and serialized in binary file with extension '.unik'.

TaxIds can be assigned when counting k-mers from genome sequences,
and LCA (Lowest Common Ancestor) is computed during set opertions
including computing union, intersection, set difference, unique and
repeated k-mers.

Version: v%s

Author: Wei Shen <shenwei356@gmail.com>

Documents  : https://bioinf.shenwei.me/unikmer
Source code: https://github.com/shenwei356/unikmer

Dataset (optional):

  Manipulating k-mers with TaxIds needs taxonomy file from e.g., 
  NCBI Taxonomy database, please extract "nodes.dmp", "names.dmp",
  "delnodes.dmp" and "merged.dmp" from link below into ~/.unikmer/ ,
  ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz , 
  or some other directory, and later you can refer to using flag
  --data-dir or environment variable UNIKMER_DB.

  For GTDB, use 'taxonkit create-taxdump' to create NCBI-style
  taxonomy dump files, or download from:
    https://github.com/shenwei356/gtdb-taxonomy

  Note that TaxIds are represented using uint32 and stored in 4 or
  less bytes, all TaxIds should be in the range of [1, %d]

`, VERSION, maxUint32),
}

RootCmd represents the base command when called without any subcommands

View Source
var VERSION = "0.19.1"

VERSION is the version

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func ParseByteSize added in v0.7.0

func ParseByteSize(val string) (int, error)

ParseByteSize parses byte size from string.

Types

type CodeTaxid added in v0.19.0

type CodeTaxid struct {
	Code uint64
	// _     uint32 // needed? to test
	Taxid uint32
}

CodeTaxid is the code-taxid pair

type CodeTaxidSlice added in v0.19.0

type CodeTaxidSlice []CodeTaxid

CodeTaxidSlice is a list of CodeTaxid, just for sorting

func (CodeTaxidSlice) Len added in v0.19.0

func (pairs CodeTaxidSlice) Len() int

Len return length of the slice

func (CodeTaxidSlice) Less added in v0.19.0

func (pairs CodeTaxidSlice) Less(i, j int) bool

Less simply compare two KmerCode

func (CodeTaxidSlice) Swap added in v0.19.0

func (pairs CodeTaxidSlice) Swap(i, j int)

Swap swaps two elements

type Options

type Options struct {
	NumCPUs          int
	Verbose          bool
	Compress         bool
	Compact          bool
	CompressionLevel int
	MaxTaxid         uint32
	IgnoreTaxid      bool
	DataDir          string
	NodesFile        string
	CacheLCA         bool

	NoCheckFile bool
}

Options contains the global flags

Jump to

Keyboard shortcuts

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