bebop / poly

A Go package for engineering organisms.
https://pkg.go.dev/github.com/bebop/poly
MIT License
671 stars 71 forks source link

Simplifying codon table interface #392

Closed cachemoi closed 11 months ago

cachemoi commented 11 months ago

this is an issue suggested as a follow up to this PR, we have a table interface which exposes a potentially superflous GetWeightedAminoAcids function. The function is used to get a weighted amino acid sequence in the fix DNA optimisation package.

The fix package seems to be updating the weights with more data, we should consider putting all the functions which updates those amino acid weights in the same struct for a less leaky abstraction.

Koeng101 commented 11 months ago

The fix package seems to be updating the weights with more data, we should consider putting all the functions which updates those amino acid weights in the same struct for a less leaky abstraction

Could you be more specific on the line? I don't recall it updating the weight table with more data, just getting out which new codon it should use based on the data, then applies biases.

Agreed it should be updated though.

cachemoi commented 11 months ago

I assumed it was updating the weights with some other heuristics but after reading more carefully I see it's not, I thought it would be a duplicate of the codon picking mechanism in optimize

If I understand well the package is using the weighted AAs to get the highest weighted codon in a set of potential codon replacements gotten with other methods (gc bias ect...) here.

I don't really see a straightforward way to get rid of this in a way that make things noticably better since it's using the fix.Change struct so I think it's best to leave things as is 👍