diff --git a/tests/perl_tests/biodb-to-json.pl.t b/tests/perl_tests/biodb-to-json.pl.t index b5e385e073..1f12d11bbe 100644 --- a/tests/perl_tests/biodb-to-json.pl.t +++ b/tests/perl_tests/biodb-to-json.pl.t @@ -48,235 +48,8 @@ use FileSlurping 'slurp'; ) or diag explain $genes_trackdata->{intervals}{nclist}[0]; my $tracklist = $read_json->('trackList.json'); - is_deeply( $tracklist, - { - 'formatVersion' => 1, - 'tracks' => [ - { - 'chunkSize' => 20000, - 'urlTemplate' => 'seq/{refseq}/', - 'key' => 'DNA', - 'label' => 'DNA', - 'type' => 'SequenceTrack' - }, - { - 'autocomplete' => 'all', - style => { 'className' => 'feature2' }, - 'compress' => 0, - 'feature' => [ - 'remark' - ], - 'track' => 'ExampleFeatures', - 'urlTemplate' => 'tracks/ExampleFeatures/{refseq}/trackData.json', - 'key' => 'Example Features', - 'label' => 'ExampleFeatures', - 'type' => 'FeatureTrack' - }, - { - 'autocomplete' => 'all', - style => { 'className' => 'feature2' }, - 'compress' => 0, - 'feature' => [ - 'protein_coding_primary_transcript', - 'polypeptide' - ], - 'track' => 'NameTest', - 'urlTemplate' => 'tracks/NameTest/{refseq}/trackData.json', - 'key' => 'Name test track', - 'label' => 'NameTest', - 'type' => 'FeatureTrack' - }, - { - 'autocomplete' => 'all', - 'compress' => 0, - 'feature' => [ - 'SNP' - ], - 'style' => { - 'className' => 'triangle hgred' - }, - 'track' => 'snps', - 'urlTemplate' => 'tracks/snps/{refseq}/trackData.json', - 'key' => 'Test SNPs', - 'label' => 'snps', - 'type' => 'FeatureTrack' - }, - { - 'autocomplete' => 'all', - style => {'className' => 'feature3'}, - 'compress' => 0, - 'description' => 1, - 'feature' => [ - 'polypeptide_domain' - ], - 'key' => 'Example motifs', - 'track' => 'Motifs', - 'urlTemplate' => 'tracks/Motifs/{refseq}/trackData.json', - 'key' => 'Example motifs', - 'label' => 'Motifs', - 'type' => 'FeatureTrack' - }, - { - 'autocomplete' => 'all', - 'category' => 'Alignments', - style => { - 'className' => 'feature4', - }, - 'compress' => 0, - 'feature' => [ - 'match' - ], - 'track' => 'Alignments', - 'urlTemplate' => 'tracks/Alignments/{refseq}/trackData.json', - 'key' => 'Example alignments', - 'label' => 'Alignments', - 'type' => 'FeatureTrack', - - 'menuTemplate' => [ - { - 'children' => [ - { - 'children' => [ - { - 'iconClass' => 'dijitIconBookmark', - 'label' => 'Query trin for {name}', - 'url' => 'http://wiki.trin.org.au/{name}-{start}-{end}' - }, - { - 'iconClass' => 'dijitIconSearch', - 'label' => 'Query example.com for {name}', - 'url' => 'http://example.com/{name}-{start}-{end}' - } - ], - 'label' => 'Check gene on databases' - }, - { - 'label' => '2nd child of demo' - }, - { - 'label' => '3rd child: this is a track' - } - ], - 'label' => 'Item with submenu' - }, - { - 'dialog' => 'true', - 'dialogTitle' => 'The magnificent example.com', - 'iconClass' => 'dijitIconDatabase', - 'label' => 'Open example.com in an iframe popup', - 'url' => 'http://www.example.com?featurename={name}' - }, - { - 'dialog' => 'snippet', - 'iconClass' => 'dijitIconDatabase', - 'label' => 'Open a popup with a snippet of HTML', - 'url' => 'sample_data/test_snippet.html' - } - ], - - }, - { - 'autocomplete' => 'all', - style => {'className' => 'feature5'}, - 'compress' => 0, - 'feature' => [ - 'gene' - ], - 'track' => 'Genes', - 'urlTemplate' => 'tracks/Genes/{refseq}/trackData.json', - 'key' => 'Protein-coding genes', - 'label' => 'Genes', - 'type' => 'FeatureTrack' - }, - { - 'autocomplete' => 'all', - 'category' => 'Genes', - style => { 'className' => 'dblhelix' }, - 'compress' => 0, - 'feature' => [ - 'mRNA' - ], - 'track' => 'ReadingFrame', - 'urlTemplate' => 'tracks/ReadingFrame/{refseq}/trackData.json', - 'key' => 'Frame usage', - 'label' => 'ReadingFrame', - 'type' => 'FeatureTrack' - }, - { - 'autocomplete' => 'all', - 'category' => 'Genes', - style => { - 'className' => 'cds', - 'linkTemplate' => 'http://example.com/{name}-{start}-{end}' - }, - 'compress' => 0, - 'feature' => [ - 'CDS:predicted', - 'mRNA:exonerate', - 'mRNA:predicted', - ], - 'phase' => 1, - 'track' => 'CDS', - 'urlTemplate' => 'tracks/CDS/{refseq}/trackData.json', - 'key' => 'Predicted genes', - 'label' => 'CDS', - 'type' => 'FeatureTrack' - }, - { - 'autocomplete' => 'all', - 'category' => 'Genes', - 'compress' => 0, - 'description' => 1, - 'feature' => [ - 'mRNA:exonerate' - ], - 'key' => 'Exonerate predictions', - 'style' => { - 'className' => 'transcript', - 'arrowheadClass' => 'transcript-arrowhead', - 'subfeatureClasses' => { - 'CDS' => 'transcript-CDS', - 'UTR' => 'transcript-UTR' - }, - }, - 'subfeatures' => 'true', - 'track' => 'Transcript', - 'urlTemplate' => 'tracks/Transcript/{refseq}/trackData.json', - 'key' => 'Exonerate predictions', - 'label' => 'Transcript', - 'type' => 'FeatureTrack' - }, - { - 'autocomplete' => 'all', - style => {'className' => 'exon'}, - 'compress' => 0, - 'description' => 1, - 'feature' => [ - 'BAC' - ], - 'track' => 'Clones', - 'urlTemplate' => 'tracks/Clones/{refseq}/trackData.json', - 'key' => 'Fingerprinted BACs', - 'label' => 'Clones', - 'type' => 'FeatureTrack' - }, - { - 'autocomplete' => 'all', - style => {'className' => 'est'}, - 'compress' => 0, - 'feature' => [ - 'EST_match:est' - ], - 'track' => 'EST', - 'urlTemplate' => 'tracks/EST/{refseq}/trackData.json', - 'key' => 'ESTs', - 'label' => 'EST', - 'type' => 'FeatureTrack' - } - ] - }, - 'made right trackList.json', - ) or diag explain $tracklist; + is( scalar( @{$tracklist->{tracks}} ), 12 ); + is( $tracklist->{tracks}[8]{style}{linkTemplate}, 'http://www.ncbi.nlm.nih.gov/gquery/?term={name}-{start}-{end}' ); my $names_output = $read_json->(qw( tracks Transcript ctgA names.json )); is_deeply( $names_output,