Skip to content

Commit

Permalink
torture test
Browse files Browse the repository at this point in the history
  • Loading branch information
cjfields committed Sep 11, 2014
1 parent 840c581 commit d06e67c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Bio/Tools/FTLocationParser.pm6
Expand Up @@ -37,19 +37,20 @@ grammar Bio::Grammar::Location {
token location_list { <location> [','<location_list> ]* }

#functional_operator ::= <symbol>
token functional_operator { 'join' | 'order' | 'complement' }
token functional_operator { 'join' | 'order' | 'complement' | 'gap' }

#base_position ::= <integer> | <low_base_bound> | <high_base_bound> | <two_base_bound>
token base_position { <abs_base_position> | <low_base_bound> | <high_base_bound> | <uncertain_bound> | <two_base_bound> }

# my addition
# my addition :)
token abs_base_position { \d+ }

# low_base_bound ::= > <integer>
token low_base_bound { '>' <abs_base_position> }

token high_base_bound { '<' <abs_base_position> }

# Added, for swissprot seqs
token uncertain_bound { '?' <abs_base_position>? }

# two_base_bound ::= <base_position>.<base_position>
Expand Down
34 changes: 34 additions & 0 deletions t/Tools/FTLocationParser.t
Expand Up @@ -112,6 +112,40 @@ my %testcases =
# not passing completely yet, working out 'order' semantics
'order(S67862.1:72..75,1..788,S67864.1:1..19)'
=> [0, Nil, Nil, 'EXACT', Nil, Nil, 'EXACT', 'ORDER', 3, 0, Nil],

# WGS contig-based 'locations'
'join(GL002586.1:1..34478191,gap(100000),GL002587.1:1..43354415)'
=> [0, Nil, Nil, 'EXACT', Nil, Nil, 'EXACT', 'ORDER', 3, 0, Nil],

# really put it through the ringer. Contig assembly file GG704824.1, lots of
# gaps w/ different contigs
'join(ACZS01000113.1:1..31090,gap(50),ACZS01000114.1:1..32367,gap(300),ACZS01000115.1:1..23926,gap(50),' ~
'ACZS01000116.1:1..37939,gap(50),ACZS01000117.1:1..2415,gap(498),ACZS01000118.1:1..90824,gap(249),' ~
'ACZS01000119.1:1..20094,gap(1288),ACZS01000120.1:1..7526,gap(50),ACZS01000121.1:1..8396,gap(916),' ~
'ACZS01000122.1:1..4711,gap(50),ACZS01000123.1:1..7610,gap(50),ACZS01000124.1:1..13068,gap(471),' ~
'ACZS01000125.1:1..2062,gap(274),ACZS01000126.1:1..36253,gap(50),ACZS01000127.1:1..17718,gap(50),' ~
'ACZS01000128.1:1..56336,gap(355),ACZS01000129.1:1..14298,gap(328),ACZS01000130.1:1..16632,gap(360),' ~
'ACZS01000131.1:1..29485,gap(1163),ACZS01000132.1:1..61637,gap(50),ACZS01000133.1:1..2189,gap(415),' ~
'ACZS01000134.1:1..2638,gap(268),ACZS01000135.1:1..3234,gap(399),ACZS01000136.1:1..36276,gap(50),' ~
'ACZS01000137.1:1..37251,gap(320),ACZS01000138.1:1..23265,gap(226),ACZS01000139.1:1..1945,gap(330),' ~
'ACZS01000140.1:1..3783,gap(165),ACZS01000141.1:1..41750,gap(226),ACZS01000142.1:1..3866,gap(220),' ~
'ACZS01000143.1:1..8883,gap(161),ACZS01000144.1:1..4681,gap(50),ACZS01000145.1:1..23948,gap(228),' ~
'ACZS01000146.1:1..2990,gap(388),ACZS01000147.1:1..9633,gap(259),ACZS01000148.1:1..9932,gap(261),' ~
'ACZS01000149.1:1..1565,gap(1288),ACZS01000150.1:1..60690,gap(425),ACZS01000151.1:1..65167,gap(50),' ~
'ACZS01000152.1:1..46726,gap(50),ACZS01000153.1:1..18917,gap(510),ACZS01000154.1:1..22264,gap(50),' ~
'ACZS01000155.1:1..37797,gap(729),ACZS01000156.1:1..9564,gap(569),ACZS01000157.1:1..2030,gap(362),' ~
'ACZS01000158.1:1..5937,gap(287),ACZS01000159.1:1..28478,gap(267),ACZS01000160.1:1..12114,gap(218),' ~
'ACZS01000161.1:1..26732,gap(616),ACZS01000162.1:1..11090,gap(330),ACZS01000163.1:1..26447,gap(224),' ~
'ACZS01000164.1:1..2114,gap(225),ACZS01000165.1:1..75967,gap(96),ACZS01000166.1:1..67895,gap(1838),' ~
'ACZS01000167.1:1..10047,gap(634),ACZS01000168.1:1..28315,gap(50),ACZS01000169.1:1..25678,gap(309),' ~
'ACZS01000170.1:1..2746,gap(439),ACZS01000171.1:1..13328,gap(2838),ACZS01000172.1:1..567,gap(627),' ~
'ACZS01000173.1:1..1451,gap(544),ACZS01000174.1:1..2654,gap(572),ACZS01000175.1:1..1758,gap(1463),' ~
'ACZS01000176.1:1..1978,gap(613),ACZS01000177.1:1..8076,gap(1120),ACZS01000178.1:1..5510,gap(275),' ~
'ACZS01000179.1:1..3481,gap(159),ACZS01000180.1:1..35889,gap(50),ACZS01000181.1:1..27693,gap(50),' ~
'ACZS01000182.1:1..21337,gap(261),ACZS01000183.1:1..9546,gap(324),ACZS01000184.1:1..16424,gap(158),' ~
'ACZS01000185.1:1..44270,gap(1288),ACZS01000186.1:1..12351,gap(143),ACZS01000187.1:1..3169,gap(50),' ~
'ACZS01000188.1:1..13970)'
=> [0, Nil, Nil, 'EXACT', Nil, Nil, 'EXACT', 'ORDER', 3, 0, Nil],
;

my $p = Bio::Tools::FTLocationParser.new();
Expand Down

0 comments on commit d06e67c

Please sign in to comment.