(t *testing.T)
| 332 | } |
| 333 | |
| 334 | func TestCapitalizationRegression(t *testing.T) { |
| 335 | // Tests to make sure that amino acids are capitalized |
| 336 | gfpTranslation := "MaSKGEELFTGVVPILVELDGDVNGHKFSVSGEGEGDATYGKLTLKFICTTGKLPVPWPTLVTTFSYGVQCFSRYPDHMKRHDFFKSAMPEGYVQERTISFKDDGNYKTRAEVKFEGDTLVNRIELKGIDFKEDGNILGHKLEYNYNSHNVYITADKQKNGIKANFKIRHNIEDGSVQLADHYQQNTPIGDGPVLLPDNHYLSTQSALSKDPNEKRDHMVLLEFVTAAGITHGMDELYK*" |
| 337 | |
| 338 | sequence, _ := genbank.Read("../../data/puc19.gbk") |
| 339 | |
| 340 | optimizationTable, err := NewTranslationTable(11) |
| 341 | if err != nil { |
| 342 | t.Fatalf("failed to initialise codon table: %s", err) |
| 343 | } |
| 344 | |
| 345 | err = optimizationTable.UpdateWeightsWithSequence(sequence) |
| 346 | if err != nil { |
| 347 | t.Error(err) |
| 348 | } |
| 349 | |
| 350 | optimizedSequence, _ := optimizationTable.Optimize(gfpTranslation, 1) |
| 351 | optimizedSequenceTranslation, _ := optimizationTable.Translate(optimizedSequence) |
| 352 | |
| 353 | if optimizedSequenceTranslation != strings.ToUpper(gfpTranslation) { |
| 354 | t.Errorf("TestOptimize has failed. Translate has returned %q, want %q", optimizedSequenceTranslation, gfpTranslation) |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | func TestOptimizeSequence(t *testing.T) { |
| 359 | t.Parallel() |
nothing calls this directly
no test coverage detected