bebop / poly

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

JCVI codon table generation is flat-out-wrong #306

Closed Koeng101 closed 1 year ago

Koeng101 commented 1 year ago

It returns:

* has the following weights:
[  "TAA: 4680",  "TAG: 1369"]

This is impossible, as JCVI has <500 genes.

TimothyStiles commented 1 year ago

Are you passing the whole sequence or just the CDS sequences?

On Sat, May 6, 2023, 11:21 PM Koeng101 @.***> wrote:

It returns:

  • has the following weights: [ "TAA: 4680", "TAG: 1369"]

This is impossible, as JCVI has <500 genes.

— Reply to this email directly, view it on GitHub https://github.com/TimothyStiles/poly/issues/306, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVXJVCFGF6G2KZSIQ6TM3DXE45OLANCNFSM6AAAAAAXYUS2MU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Koeng101 commented 1 year ago

Turns out, some genes were noted to be pseudo genes, but still had feature type of CDS. This caused the entire thing to fail. I think docs should be updated with this. Adding another pr.

for _, feature := range sequence.Features {
        if feature.Type == "CDS" {
            if _, ok := feature.Attributes["pseudo"]; ok {
                continue
            }
            seq, _ := feature.GetSequence()
            codingRegionsBuilder.WriteString(seq)
            genes++
        }
    }