()
| 139 | } |
| 140 | |
| 141 | func ExampleCompromiseCodonTable() { |
| 142 | sequence, _ := genbank.Read("../../data/puc19.gbk") |
| 143 | |
| 144 | // weight our codon optimization table using the regions we collected from the genbank file above |
| 145 | optimizationTable, err := codon.NewTranslationTable(11) |
| 146 | if err != nil { |
| 147 | fmt.Printf("error running example: %s\n", err) |
| 148 | return |
| 149 | } |
| 150 | |
| 151 | err = optimizationTable.UpdateWeightsWithSequence(sequence) |
| 152 | if err != nil { |
| 153 | panic(fmt.Errorf("got unexpected error in an example: %w", err)) |
| 154 | } |
| 155 | |
| 156 | sequence2, _ := genbank.Read("../../data/phix174.gb") |
| 157 | optimizationTable2, err := codon.NewTranslationTable(11) |
| 158 | if err != nil { |
| 159 | fmt.Printf("error running example: %s\n", err) |
| 160 | return |
| 161 | } |
| 162 | |
| 163 | err = optimizationTable2.UpdateWeightsWithSequence(sequence2) |
| 164 | if err != nil { |
| 165 | panic(fmt.Errorf("got unexpected error in an example: %w", err)) |
| 166 | } |
| 167 | |
| 168 | finalTable, _ := codon.CompromiseCodonTable(optimizationTable, optimizationTable2, 0.1) |
| 169 | for _, aa := range finalTable.GetWeightedAminoAcids() { |
| 170 | for _, codon := range aa.Codons { |
| 171 | if codon.Triplet == "TAA" { |
| 172 | fmt.Println(codon.Weight) |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | //output: 3863 |
| 177 | } |
| 178 | |
| 179 | func ExampleAddCodonTable() { |
| 180 | sequence, _ := genbank.Read("../../data/puc19.gbk") |
nothing calls this directly
no test coverage detected