Skip to content

Commit

Permalink
Add stats to codon tables (#350)
Browse files Browse the repository at this point in the history
* add stats to codon tables

* separate stats into its own codon analyzer struct

* stats struct

* turn codonTable into TranslationTable, which holds the required data for translation and optimisation

* generate translation and optimisation maps in constructors

* update the Compromise and Add funcs to copy the first table when merging (no risk of changing data through pointer)

* add gene count to stats

* DRY tests with new structures

* DRY examples with new structures

* update synthesis code to use the codontable's Optimize func

* update amino acid weights through setter

* bubble up table weight update errs

* make stats part of the table struct so we can track them across a table's lifetime, which is probably closer to what we want

* make translation table stats public rather than use a getter

* move stats below other interfaces

* add translate to table interface

* update changelog

* add weight update err test

* newAminoAcidChoosers test

* UpdateWeights test

* Compromise/Add codon table tests

* add an example for using manual codon weights

---------

Co-authored-by: Willow Carretero Chavez <sandiegobutterflies@gmail.com>
  • Loading branch information
cachemoi and carreter authored Nov 15, 2023
1 parent d87246c commit 96b5cff
Show file tree
Hide file tree
Showing 6 changed files with 664 additions and 431 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Alternative start codons can now be used in the `synthesis/codon` DNA -> protein translation package (#305)
- Added a parser and writer for the `pileup` sequence alignment format (#329)
- Added statistics to the `synthesis/codon` package (keeping track of the observed start codon occurrences in a translation table) (#350)

### Fixed
- `fastq` parser no longer becomes de-aligned when reading (#325)
Expand Down
Loading

0 comments on commit 96b5cff

Please sign in to comment.