megamash

package
v0.0.0-...-f005bc5 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package megamash is an implementation of the megamash algorithm.

Megamash is an algorithm developed by Keoni Gandall to find templates from sequencing reactions. For example, you may have a pool of amplicons, and need to get a count of how many times each amplicon shows up in a given sequencing reaction.

Megamash takes all unique kmers of a given sequence among all other sequences in a pool, and uses those to distinguish how close a given target is to that particular sequence. This does not work if there are no unique kmers within a sequence: this can often happen in combinatorial libraries. For sequences like that, it is better to look to a different algorithm.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultKmerSize         uint    = 16
	DefaultMinimalKmerCount int     = 10
	DefaultScoreThreshold   float64 = 0.5
)

Functions

func MatchesToJSON

func MatchesToJSON(matches []Match) (string, error)

MatchesToJSON converts a slice of Match structs to a JSON string.

func StandardizeDNA

func StandardizeDNA(sequence string) string

StandardizeDNA returns the alphabetically lesser strand of a double stranded DNA molecule.

Types

type Match

type Match struct {
	Identifier string  `json:"identifier"`
	Score      float64 `json:"score"`
}

Match contains the identifier and score of a potential match to the searched sequence.

func JSONToMatches

func JSONToMatches(jsonStr string) ([]Match, error)

JSONToMatches converts a JSON string to a slice of Match structs.

type MegamashMap

type MegamashMap struct {
	Kmers                 map[string]string
	IdentifierToKmerCount map[string]int
	KmerSize              uint
	KmerMinimalCount      int
	Threshold             float64
}

func NewMegamashMap

func NewMegamashMap(sequences []fasta.Record, kmerSize uint, kmerMinimalCount int, threshold float64) (MegamashMap, error)

NewMegamashMap creates a megamash map that can be searched against.

func (*MegamashMap) Match

func (m *MegamashMap) Match(sequence string) []Match

Match matches a sequence to all the sequences in a megamash map.

Jump to

Keyboard shortcuts

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