MCPcopy Create free account
hub / github.com/bebop/poly / TestCapitalizationRegression

Function TestCapitalizationRegression

synthesis/codon/codon_test.go:334–356  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

332}
333
334func 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
358func TestOptimizeSequence(t *testing.T) {
359 t.Parallel()

Callers

nothing calls this directly

Calls 6

OptimizeMethod · 0.95
TranslateMethod · 0.95
ReadFunction · 0.92
NewTranslationTableFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected