BioJulia / Kmers.jl

In development: Kmer types and methods for julia
MIT License
21 stars 7 forks source link

Add reverse translation #20

Closed jakobnissen closed 2 years ago

jakobnissen commented 2 years ago

Implement reverse translation

This PR implements reverse translation. That is, given an AminoAcid and a reverse translation table (defaulting to the standard genetic code), return the set of possible RNACodon that codes for that amino acid. Alternatively, given an AASeq, return a vector of these sets, one seq per amino acid.

Implements #19

Based on #24 . Review and merge/close that one before reviewing this.

Types of changes

This PR implements the following changes:

:clipboard: Additional detail

The sets are implemented as a new type, CodonSet, which is a lightweight AbstractSet{RNACodon} with just a few basic methods implemented.

Reverse translation is dependent on the creation of ReverseGeneticCode objects, which are tables, similar to GeneticCode objects. The PR defines const rev_standard_genetic_code. In order not to bloat the package, no other genetic codes are defined by default, but the user can create one using e.g. my_rev_code = ReverseGeneticCode(my_genetic_code).

Discussion points

:ballot_box_with_check: TODO

codecov[bot] commented 2 years ago

Codecov Report

Merging #20 (320439b) into master (320439b) will not change coverage. The diff coverage is n/a.

:exclamation: Current head 320439b differs from pull request most recent head f7c6337. Consider uploading reports for the commit f7c6337 to get more accurate results

@@           Coverage Diff           @@
##           master      #20   +/-   ##
=======================================
  Coverage   86.52%   86.52%           
=======================================
  Files          12       12           
  Lines         527      527           
=======================================
  Hits          456      456           
  Misses         71       71           
Flag Coverage Δ
unittests 86.52% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 320439b...f7c6337. Read the comment docs.

jakobnissen commented 2 years ago

Rebased on #24 - do not merge this until #24 has been decided for or against. @SabrinaJaye for ease of reviewing, review #24 first. If it's merged, this PR will be smaller.

jakobnissen commented 2 years ago

Now rebased on master