Skip to content

Commit

Permalink
Updates megamash to use int instead of uint for minimal count in case…
Browse files Browse the repository at this point in the history
… of -1 (#73)

* Updates megamash to use int instead of uint for minimal count in case of -1
  • Loading branch information
Koeng101 committed Apr 1, 2024
1 parent ce0f18e commit 0fa147f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Updated megamash to use int instead of uint for minimal Kmer counts (so you can use -1) [#73](https://github.com/Koeng101/dnadesign/pull/73)
- Added bcftools to external [#72](https://github.com/Koeng101/dnadesign/pull/72)
- Fixed bug in PCR where certain matching primers wouldn't create any amplicons [#71](https://github.com/Koeng101/dnadesign/pull/71)
- Updated seqhash2 to use base58 rather than base64 [#69](https://github.com/Koeng101/dnadesign/pull/69)
Expand Down
10 changes: 5 additions & 5 deletions lib/align/megamash/megamash.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ func StandardizedDNA(sequence string) string {

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

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

// NewMegamashMap creates a megamash map that can be searched against.
func NewMegamashMap(sequences []fasta.Record, kmerSize uint, kmerMinimalCount uint, threshold float64) (MegamashMap, error) {
func NewMegamashMap(sequences []fasta.Record, kmerSize uint, kmerMinimalCount int, threshold float64) (MegamashMap, error) {
var megamashMap MegamashMap
megamashMap.KmerSize = kmerSize
megamashMap.KmerMinimalCount = kmerMinimalCount
Expand Down Expand Up @@ -81,7 +81,7 @@ func NewMegamashMap(sequences []fasta.Record, kmerSize uint, kmerMinimalCount ui
}
}
// Check for minimal kmerCount
identifierToCount := make(map[string]uint)
identifierToCount := make(map[string]int)
for _, fastaRecord := range sequences {
identifierToCount[fastaRecord.Identifier] = 0
}
Expand Down

0 comments on commit 0fa147f

Please sign in to comment.