Commits

Sarah Richardson  committed 6b4778b

test exception for duplicate names

  • Participants
  • Parent commits 9eed785

Comments (0)

Files changed (1)

File t/25-annotate.t

 #! /usr/bin/perl
 
-use Test::More tests => 2;
+use Test::More tests => 3;
 use Test::Deep;
 
 use Bio::BioStudio;
 
 my $cchr = $bchr->iterate;
 
-#Testing add_feature, new seq
+#Testing add_feature, same name, new seq
 my $yname = 'test_tag';
 my $yfeat = Bio::SeqFeature::Generic->new(
   -start         => 2680,
 'TATGGGTACCACAAAGCGAGGTCGCTTTTGAAGAGCCCTCGGTAGCATAACATTTTTAATTATTACGACTGTTTTTTTTATTCATTATGTAGAGATAATTAAATGTTATAGATGCTCTATACTCAAACGGTGGAAGAAAAACAGCGAAAAAAAATAACCGATACCCCCTTTTCGAATACAAATGCTTGTATATTCAATTATGAATTATTTTTTTTTTTTTTCATTTCTTATATTATTTTTTGTTCGAGAATCACTTTTTCAAGATGGTAACAACATCTTCGTCTTCCAAAATGTGACTCAACCCCACGTATTGAGGTTGATGTTTGACACTGCTACCGTAAACCAGAGCATTTCTAAAGTCGTCCACTAAAGATTTATGAATTTGGTTACAAAAATCCTTGACACTGCAACGGTCTGATCTTAGCACCACAGGGTCGGTAAAATCTGGTATTTGGCCCTTTGGTTTAGTGTAAATACGGACTAGATTTAGTCTATCCCACATGACTTGCAACAGCTCGTCCAAGTTCCAATCTTGACCAGACGAAATAGGCACGGCATTAGGAATTCGGTAAAGTAATTCCAATTCCTCTATTGACAGAGAATCAATCTTGTTTAACACATAGATGGCAGGCATGTATCTTCTTGACGAAGCTTCCAAAACATCAATCAAATCATCCACAGTGGCATCACACCTGAAGGCAATCTCAGCGCTATTTATTCTGTACTCGCTCATAACGGCTCTGATTTCGTCATTCCCCAGATGGGTCAATGGGACTGTGTTTGTGATGGAAATACCACCTTTCTCTTTTTTTTTGATCAAGATATCTGGCGGAGTTTTATTCAGACGAATCCCCACACCTTCCAGTTCCTTCTCAATGATTTGCTTATGATGCAAGGGTTTGTTCACATCTAGGATGATAAATAACAGGTTACAGGTTCTTGCCACGGCAATAACTTGCTTACCTCTACCTCTACCATCCTTAGCACCATCGATAATACCAGGTAAATCCAACATTTGGATCTTGGCACCTTTATAACGAATGACACCGGGGACGGTAACCAGGGTGGTAAACTCGTACTCAGCTGCTTCAGACTCAGTACCAGTCAACTTGGACAGTAATGTAGATTTCCCCACCGACGGGAACCCGACAAACCCCACACTGGCCACACCAGTTCTAGCCACATCAAAACCAATACCAGCACCACCACCGCTGCCGGATGAAGCACTGGTCAACAATTCTCTTCTCAGTTTGGCCAGCTTGGCCTTCAGTTGACCCAAATGGAAAGATGTGGCCTTGTTCTTTTGGGTACGGGCCATTTCATCTTCGATAGCTTTGATTTTTTCAACTGTAGTAGACATTTTTGCTCAATCAACAACTCTACGCTTGCACCTACTGCATCTAGCTTCAAACACTTCCTATCATTGCGCCCTCATCACACCGTAATATCCCATCTTAAAAGTGGAAAACTCTTATAGCTCATCGATGAAAAAAACGGGCCCTCGTCGCTTGTGATGTGAAAAAATTTTTCAAGCTTTAAGCCCATTGAAAGCAAGAGATCTTGCACTAGAATAAGTGGCAAAGGTGAACTTTGAGGGGATAAGAAGGGCATCTCCTCCGGAGTCATTGCCATCTGCGTTGAGTACCAAAGCTTTGAGCCCGTCAGAATCCTTGGCCACCGGACATGCTTCACAGATATAGAACGTAGCATGGTCTGTGGGAGCTTCATTTCTATGTTTTACCTTCTCTTTTCGCTTTTATGGTTCTCAGTGACCAAATAAAGAAACTTATATATGTTCCGGAATGACGAATCAAAAAGAGAATAGCATCGTTAGCAGCAAACGAAAGTGGAAAGAGAATAATGTTCAAGAGAGCAATGAGCACAGATGGTCCCGTGGCACGTACCATCCTGAAGAGACTGGAATGCGGCTTTCCAGATTACAAGAACTTTGCGTTTGGCCTCTACAACGATTCTCACAAGCATAAGGGCCATGCTGGTGTACAGGGAAATGTCTCTGCTGAGACACATTTCCGGATTGAGATGGTCAGTAAAAAGTTCGAAGGCCTGAAACTTCCACAACGCCATCGTATGGTTTATTCCCTCTTGCAAGACGAGATGGCTCAGGCGAACGGTATCCATGCTTTACAATTGTCACTAAAGACCCCACAGGAGTATGAATCCAAAGCGAAATAGGAATGCATAAGCATAAGTGTACACGTTGAGTTTATTGTTTTATTTCCCCTACATATATATACATATATATGAAATTACTTTACGTACGTATAAGCTTTGTTCAGTCATCATGAACCAGTGTCTTTTCGTACTGTTCTAAGGACATTAGACCCTCGACCTGTTCCACATTAACGCCCTCACCAAGCTTCATTTTGACTAGCCAGCCGTCACCCATAGGATCTTCGTTCACCACACCTGGATTTTCCTCAAGTATTATATATTTTGCTTTATGATCCTCGGCTTGATGCTCGCCAACGTGAGATAGCTGGTCATCACAATAGATCAGCCGGGACGCTTTTCGATCACATCGAATCCCTTCGGGACGTTGCAACAATACGTGAAAAATGCCTCAAAAATAATAAATACAATGGTGAACAACGTTAAAAAAGCATAAAACAGCTGGCTATTTTGATCAGGATAACATCTATAAGTGCCATATTAAGGCAAGATATCAATTGACCATGCATACACCTTCAGAAAATACCGACGTAAAGATGGATACTCTCGACGAACCCAGTGCACATTTAATCGAAGAGAATGTAGCTCTTCCCGAAGACACATTCAGTTCACATCTGAGTTATGTACTTTATGAAATTGCTCATTGTAAACCGATCATGTTTATGATCATCATAATCGTGAGTTTGATCTCATTGATTGTGCTTTTTCATGATAACGACGGGTGCACTGTGATCTTAGTGATGTCCCTTATAGTAGCCTCCATGGCTTTAATGGTGGTTGCAGCATTCACATTCGGGAAAGCGATCACTGAACAGGAGTTCATGATAAAGCTTTTAGTGGAGGTGATCGCACGCAAGCCTGCGGGGAAGGAATGGGGTACTGTCGCATATAATATGAACCAATATCTATTCATGAAGAGACTATGGTATACCCCGTACTATTTCTATAGCGGCAAGAAGTGCCATGAGTTCTTCACCACTCTTATCAAGGAAGTGAATTCTGGTTCGCACTCGGATTCCTCATCGAATAGTGCCGAGGATACACAATCACCTGTCTCAGCAGGGAAGACTTCAAATGGTCTAAACAACTTTTATAGTATTAGATCAGACCCTATTTTGATGGCATATGTTTTGAAGGCAACACAAATAGAAAAGGAGGCTCAAAGTGAATACTGGAGAAAGCAATATCCTGACGCTGATTTACCTTGAAAGCGGAAGCATTTTATTCACCAAGTATACTTACTTTTCTTTAAAACGAGAACAAGAATCGAATTCAAGAACATCTCGAAGCCAGAATTGAGCATCATATATTCGAGCTGTACAAACATCATGGCCTACAACTATCGTATTTGTAAGTTTTTTTAGAGGTTTTCATATTTGTTTAATAAGGGTTCTGTCAGTTTTTGTCACATTCTATTGTTGCGCTTCGCATAATGCAGCCAAGAAAATCCAAACAATACCTTTCTACATACTACTACATAATATATATATATAGTATAGAAATTGGTATATCACTACTTGTACAAATATCATATTGTACGATAATCGCGAAGAACGACGCACTGGTGGGAAGAAGTGGAAAACAGAAGCTTTAAGGTAGAAACAGAACAAGAATGTGGCTATGGTAGGATAGCAAAAGAGTACCATTGCTGTTATCATTTGTTGCCTAGCCCTATCAAGACCTGTCTGCTAATCCAACCCGAGAGATCATGGCGATCCAAACCCGTTTTGCCTCGGGCACATCTTTATCCGATTTGAAACCAAAACCAAGTGCAACTTCCATCTCCATACCCATGCAAAATGTCATGAACAAGCCTGTCACGGAACAGGACTCACTGTTCCATATATGCGCAAACATCCGGAAAAGACTGGAGGTGTTACCTCAACTCAAACCTTTTTTACAATTGGCCTACCAATCGAGCGAGGTTTTGAGTGAAAGGCAATCTCTTTTGCTATCCCAAAAGCAGCATCAGGAACTGCTCAAGTCCAATGGCGCTAACCGGGACAGTAGCGACTTGGCACCAACTTTAAGGTCTAGCTCTATCTCCACAGCTACCAGTCTCATGTCGATGGAAGGTATATCATACACGAATTCGAATCCCTCGGCCACCCCAAATATGGAGGACACTTTACTGACTTTTAGTATGGGTATTTTGCCCATTACCATGGATTGCGACCCTGTGACACAACTATCACAGCTGTTTCAACAAGGTGCGCCCCTCTGTATACTTTTCAACTCTGTGAAGCCGCAATTTAAATTACCGGTAATAGCATCTGACGATTTGAAAGTCTGTAAAAAATCCATTTATGACTTTATATTGGGCTGCAAGAAACACTTTGCATTTAACGATGAGGAGCTTTTCACTATATCCGACGTTTTTGCCAACTCTACTTCCCAGCTGGTCAAAGTGCTAGAAGTAGTAGAAACGCTAATGAATTCCAGCCCTACTATTTTCCCCTCTAAGAGTAAGACACAGCAAATCATGAACGCAGAAAACCAACACCGACATCAGCCTCAGCAGTCTTCGAAGAAGCATAACGAGTATGTTAAAATTATCAAGGAATTCGTTGCAACGGAAAGAAAATATGTTCACGATTTGGAAATTTTGGATAAATATAGACAGCAGTTATTAGACAGCAATCTAATAACGTCTGAAGAGTTGTACATGTTGTTCCCTAATTTGGGTGATGCTATAGATTTTCAAAGAAGATTTCTAATATCCTTGGAAATAAATGCTTTAGTAGAACCTTCCAAGCAAAGAATCGGGGCTCTTTTCATGCATTCCAAACATTTTTTTAAGTTGTATGAGCCTTGGTCTATTGGCCAAAATGCAGCCATCGAATTTCTCTCTTCAACTTTGCACAAGATGAGGGTTGATGAATCGCAGCGGTTCATAATTAACAATAAACTGGAATTGCAATCCTTCCTTTATAAACCCGTGCAAAGGCTTTGTAGATATCCCCTGTTGGTCAAAGAATTGCTTGCTGAATCGAGTGACGATAATAATACGAAAGAACTTGAAGCTGCTTTAGATATTTCTAAAAATATTGCGAGAAGTATCAACGAAAATCAAAGAAGAACAGAAAATCATCAAGTGGTGAAGAAACTTTATGGTAGAGTGGTCAACTGGAAGGGTTATAGAATTTCCAAGTTCGGTGAGTTATTATATTTCGATAAAGTGTTCATTTCAACAACAAATAGCTCCTCGGAACCTGAAAGAGAATTTGAGGTTTATCTTTTTGAAAAAATCATCATCCTTTTTTCAGAGGTAGTGACTAAGAAATCTGCATCATCACTAATCCTTAAGAAGAAATCCTCAACCTCAGCATCAATCTCCGCCTCGAACATAACGGACAACAATGGCAGCCCTCACCACAGTTACCATAAGAGGCATAGCAATAGTAGTAGCAGTAATAATATCCATTTATCTTCGTCTTCAGCAGCGGCGATAATACATTCCAGTACCAATAGTAGTGACAACAATTCCAACAATTCATCATCATCCTCATTATTCAAGCTGTCCGCTAACGAACCTAAGCTGGATCTAAGAGGTCGAATTATGATAATGAATCTGAATCAAATCATACCGCAAAACAACCGGTCATTAAATATAACATGGGAATCCATAAAAGAGCAAGGTAATTTCCTTTTGAAATTCAAAAATGAGGAAACAAGAGATAATTGGTCATCGTGTTTACAACAGTTGATTCATGATCTGAAAAATGAGCAGTTTAAGGCAAGACATCACTCTTCAACATCGACGACTTCATCGACAGCCAAATCATCTTCAATGATGTCACCCACCACAACTATGAATACACCGAATCATCACAACAGCCGCCAGACACACGATAGTATGGCTTCTTTCTCAAGTTCTCATATGAAAAGGGTTTCGGATGTCCTGCCTAAACGGAGGACCACTTCATCAAGTTTCGAAAGTGAAATTAAATCCATTTCAGAAAATTTCAAGAACTCTATTCCAGAATCTTCCATACTCTTCAGGATATCATATAATAACAACTCTAATAATACCTCTAGTAGCGAGATCTTCACACTTTTGGTAGAAAAAGTTTGGAATTTTGACGACTTGATAATGGCGATCAATTCTAAAATTTCGAATACACATAATAACAACATTTCACCAATCACCAAGATCAAATATCAGGACGAAGATGGGGATTTTGTTGTGTTAGGTAGCGATGAAGATTGGAATGTTGCTAAAGAAATGTTGGCGGAAAACAATGAGAAATTCTTGAACATTCGTCTGTATTGAATAAATAAAACTAGTATACAGCAAATACTAAATAATTCAAGAAAAAAACATTAGATAGAGAGGGGCAGATGTTCAAGCTATACCCATTATATTGATCCACACTTAGTATTAAGATACGTCTGTGAAGGATGAAAAAAAATGTATAATGTGACTAGAGGAAGTAAGGAGAAAAAACGATAGTAATCGTATTTTAGGTTGTGCGTTTTTATAATTTTTTTTTTTTTGTAATTCTATGCAAATGTAATATAAGGGTCAGTAAAAAGTTCGAAGGCCTGAAACTTCCACAACGCCATCGTATGGTTTATTCCCTCTTGCAAGACGAGATGGCTCAGGCGAACGGTATCCATGCTTTACAATTGTCACTAAAGACCCCACAGGAGTATGAATCCAAAGCGAAATAGAATGCATAAGCATAAGTGTACACGTTGAGTTTATTGTTTTATTTCCCCTACATATATATACATATATATGAAATTACTTTACGTACGTATAAGCTTTGTTCAGTCATCATGAACCAGTGTCTTTTCGTACTGTTCTAAGGACATTAGACCCTCGACCTGTTCCACATTAACGCCCTCACCAAGCTTCATTTTGACTAGCCAGCCGTCACCCATAGGATCTTCGTTCACCACACCTGGATTTTCCTCAAGATTAGTGTTAATTTCCTCTACGGTACCATCGGCAGGCTGGTAGATCTCGGAGGCTGACTTGACGGACTCAATGGACCCTAGCGACTCACCTTGGGAAATCTCAGTGCCCACTTCTGGCAACTCAACATAGGTAGCGTCCCCTAAGGAATCAGTGGCGTATTTTGTAATTCCGACAAAGGCAGTCTTGTCCTGATGCACAGCTATCCACTCATGTTGGGAAGTGTACCTCACGGCTTGAGGTCCTTGGGATGAGTACAAAAATGGTAGTTTATTCTTGTTTAGGGCATTGCCGGAGCTGTTTCTCAAAAACAATTTGCTCACAGCGGGCATGCGGGTGGTCCATAGTCTAGTAGTGCGTAACATTTGTCGATGTGGTATGCTTCATGTGGAGATTCCCTTTCCCATTAGATACTTGTTTGTTGGTCTGTATATATAGAAGAAAGAGTTAGCGAAAGTGACTCCGCCGCTGAATGACTCCTTACGGAAGTGTCAAAATTGCGAGGTCCCTATAGCACAGAATGATAGATAAAACATTGATTTGCAAGTTGAAGGAAGACCCTACACATGCGTATATATGATGTATGTAATGGTTGTGATCATTTTAGCCTGTCAA',
         'chromosome_version' => '02',
         'comments'           => [
-            'test_tag added
+            'test_tag2 added
 ',
             '# test_tag added
 '
                                 '2' => undef
                             },
                             'test_tag' => {
-                                '4' => undef,
                                 '5' => undef
                             },
+                            'test_tag2' => {
+                                '4' => undef
+                            },
                             'yar028w' => {
                                 '6' => undef
                             },
                         'yal036c' => {
                             '2' => 1
                         },
+                        'test_tag2' => {
+                            '4' => 1
+                        },
                         'test_tag' => {
-                            '4' => 1,
                             '5' => 1
                         },
                         'cdc24' => {
                             'stop'        => 2700,
                             'ref'         => 'chr01',
                             'is_circular' => 0,
-                            'name'        => 'test_tag',
+                            'name'        => 'test_tag2',
                             'score'       => undef,
                             'phase'       => undef,
                             'strand'      => 0,
                                 'newseq'  => [ 'GATATCAATTGACCATGCATA' ],
                                 'version' => [ '1' ],
                                 'intro'   => [ '0_02' ],
-                                'load_id' => [ 'test_tag' ],
+                                'load_id' => [ 'test_tag2' ],
                                 'wtpos'   => [ '2680' ]
                             },
                             'start' => 2680
     'Bio::BioStudio::Chromosome'
 );
 
+my $adddfeat = eval
+{
+  $cchr->add_feature(
+      -feature => $yfeat
+  );
+};
+my $ep1 = Bio::BioStudio::Exception::PreserveUniqueNames->caught();
+isa_ok($ep1, 'Bio::BioStudio::Exception::PreserveUniqueNames', 'duplicate name');
+
+$yname = 'test_tag2';
+$yfeat->display_name($yname);
+
 $cchr->add_feature(
     -feature => $yfeat
 );