Bio-Das-Lite-2.04000755000765000024 011407221232 12624 5ustar00rmpstaff000000000000Bio-Das-Lite-2.04/Build.PL000444000765000024 300711407221227 14261 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-04-16 12:29:45 +0100 (Fri, 16 Apr 2010) $ # Id: $Id: Build.PL 32 2010-04-16 11:29:45Z andyjenkinson $ # Source: $Source$ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/Build.PL $ # use strict; use warnings; use Module::Build; use lib qw(lib); my $builder = Module::Build->new( module_name => 'Bio::Das::Lite', dist_author => 'Roger Pettett ', dist_abstract => q[Bio::Das::Lite is an implementation of the BioDas protocol, http://biodas.org/], license => 'perl', requires => { 'WWW::Curl' => '4.07', 'HTTP::Response' => '1.49', 'English' => '1.01', 'Carp' => '1.02', 'Readonly' => '1.03', }, recommends => { }, build_requires => { 'Test::More' => '0.8', }, build_recommends => { 'Test::Distribution' => '2.00', 'Test::Perl::Critic' => '1.01', }, sign => 1, ); $builder->create_build_script(); print q( ****************************************************************************** ** Some of the tests for this module need internet access ** ** Also remember to set your http_proxy environment variable if you need to ** ****************************************************************************** ); Bio-Das-Lite-2.04/Changes000444000765000024 1254011407221227 14302 0ustar00rmpstaff000000000000Revision history for Perl extension Bio::Das::Lite. 2.04 Patches to catch out-of-date versions of libcurl. Refactored some routines to reduce complexity. 2.01 Bugfix for authenticating proxies. No longer appends ? to DAS request URIs without query params. Supports links with no descriptions. 2.00 Switched to WWW::Curl::Simple (from LWP::Parallel::UserAgent) 1.61 Minor: Fixed prereq (for CPANTS prereq_matches_use) 1.60 Latest LWP has broken support for "parse_head" function. Das::Lite attempts to correct for this by squirting an ersatz version into the symbol table under LWP::Protocol, where it used to be. A particularly ugly hack! 1.58 Added 'no_proxy' configurable parameter. Added 'max_hosts' configurable parameter. Supports the X-DAS-Status header. Supports score-based stylesheets (see DAS 1.53E spec). Fixes for perlcritic. Fixed issues of failings tests caused by retired DAS servers. 1.53 kwalitee updates (Test::Pod::Coverage & LICENSE in Makefile.PL) 1.50 added 'sequence' patch for alignments, patch from jt6 1.49 new 'maxbins' parameter for feature requests: In recent months more and more das sources appeared that provide very condensed value based data. Sometimes it is a feature per every 50 basepairs or even a feature per amino acid. It causes two major problems: 1 - amount of XML being transferred is huge 2 - Ensembl can only do simple merge of the features, i.e just pick max or min value - and in some cases das sources providers want to use a completely different dataset for a different size and resolution of the viewed region. To solve these problems we have introduced a new `maxbins` parameter to the `features` das request. Using this parameter Ensembl tells all das sources what is the width in pixels of the image used to display the features. Then the das sources smart enough to understand the parameter will merge the features themselves and for the rest Ensembl will do the work. 1.48 'dna' request support. Minor refactorings and cleanups for perl-critic 1.47 Reworked tests, a couple of fixes for structure handling 1.44 Package namespace changed to Bio::Das::Lite -compat tests added for compatibility with deprecated DasLite.pm Codebase cleaned up to make Perl::Critic happy Protein structure support, patch from rdf 'sources' request support, patch from rdf 1.41 Protein alignment support, patch from rdf 1.40 Cleanup for Perl::Critic purposes 1.39 Minor typographical tidying up, some more tests 1.38 Minor tweaks to http_proxy - support for http://user:pass@proxy.example.com:nnnn/ format http_proxy 1.33 Minor tweaks to proxy_* methods; Addition of configurable user_agent 1.32 Bugfixes: Cache cleaning for performing multiple queries using persistent objects Regex fixes for group notes and links Initial support for authenticating proxies (proxy_user, proxy_pass) 1.27 Switched over to CVS version to make things easier for me to track Minor revisions. Some more tests 0.15 Includes registry support. See 'new_from_registry', 'registry' and 'registry_sources' methods. 0.14 Fix for entry_points structure and a new test for it Added a new way to use the constructor: my $das = Bio::DasLite->new("http://server/das/source"); Added a convenience side-effect - give segment data in responses for segments without features in 0.13 Absolutely minor change to include LWP::P::UA max_req connection throttling Upgrade strongly recommended 0.12 Reworked all the tests. Tweaked basename regex to allow more flexibility in specifying services rather than dsns, i.e. 'dsn' => 'http://das.mysite.com/das' rather than 'dsn' => 'http://das.mysite.com/das/dsn' 0.11 Added a little extra debug, some extra eval traps, improved url processing and a couple of new WTSI extensions to the spec 0.10 Fixed dsns DAS request (source basename) 0.09 Fixed broken 'types' request 0.08 Added multi-link, multi-note, multi-group-link and multi-group-note support Added X-Forwarded-For HTTP header for IP-based ACLs Added passthrough for HTTP header data 0.07 Internal development version 0.06 Fixes for the regex/stack problems in 0.05. Added callback support for stylesheet and features calls 0.05 Stylesheet support. Seems to tickle some perl regex/stack bugs on certain platforms (x86 Linux, Alpha Tru64). It works fine on my G4. 0.04 Internal version. Added duplication of segment data across features in the 'features' call. 0.03 Allowed for calls (namely 'features') with an arrayref of segments, i.e. $das->features(["1:1,1000", "2:1,1000"]); Minor modifications following some benchmarking and profiling. Results are now cached (per Bio::DasLite instance) against query URL by default. 0.02 Following feedback, data structures returned by: dsn, basename, dsns, entry_points, types, features, sequence have now been homogenised across the board. Results are now always hashed against the query which was made, regardless of how many sources are configured. Also added a few more tests including feature-by-id 0.01 Fri Aug 19 16:38:05 2005 - original version; created by h2xs 1.23 with options -cfn Bio::DasLite Bio-Das-Lite-2.04/MANIFEST000444000765000024 163711407221227 14125 0ustar00rmpstaff000000000000Changes MANIFEST README eg/callback_test eg/comparison eg/empty_segment eg/new_from_registry eg/regtest eg/stylesheet_test eg/uniprot-test lib/Bio/Das/Lite.pm t/00-critic.t t/00-distribution.t t/00-pod.t t/00-podcoverage.t t/01-general.t t/02-statuscodes.t t/05-singledsn.t t/06-singledsn-singleseg.t t/07-singledsn-multiseg.t t/10-multidsn.t t/20-authentication.t t/21-proxy.t t/40-dna.t t/45-sequence.t t/50-entry_points.t t/60-features.t t/60-features_chunked.t t/60-features_empty.t t/61-features_group.t t/70-alignment.t t/80-structure.t t/90-sources.t t/FileStub.pm t/FileStubChunked.pm t/FileStubCompat.pm t/alignment.xml t/dna.xml t/entry_points-ensembl1834.xml t/entry_points.xml t/features-empty.xml t/features-ensembl1834.xml t/features-group.xml t/features.xml t/sequence-ensembl1834.xml t/sequence.xml t/source.xml t/structure.xml t/types-ensembl1834.xml Build.PL META.yml SIGNATURE Added here by Module::Build Bio-Das-Lite-2.04/META.yml000444000765000024 120211407221227 14231 0ustar00rmpstaff000000000000--- abstract: 'Bio::Das::Lite is an implementation of the BioDas protocol, http://biodas.org/' author: - 'Roger Pettett ' build_requires: Test::More: 0.8 configure_requires: Module::Build: 0.36 generated_by: 'Module::Build version 0.3603' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Bio-Das-Lite provides: Bio::Das::Lite: file: lib/Bio/Das/Lite.pm version: 2.04 requires: Carp: 1.02 English: 1.01 HTTP::Response: 1.49 IO::Scalar: 2.110 Readonly: 1.03 WWW::Curl: 4.07 resources: license: http://dev.perl.org/licenses/ version: 2.04 Bio-Das-Lite-2.04/README000444000765000024 275611407221227 13657 0ustar00rmpstaff000000000000Bio::Das::Lite ============== Bio::Das::Lite is an implementation of the BioDas protocol, http://biodas.org/ for the retrieval of biological data from XML sources over HTTP. Bio::Das::Lite is designed as a lightweight and more forgiving alternative to the client/retrieval/parsing components of Bio::Das. Bio::Das::Lite itself is not a drop-in replacement for Bio::Das but it can be subclassed to do so. NOTE Results are returned hashed against the query URL which caused them. This means that sometimes you receive more results than you might expect (number of sources * number of segments) INSTALLATION To install this module type the following: perl Build.PL ./Build ./Build test ./Build install DEPENDENCIES This module requires these other modules and libraries: WWW::Curl HTTP::Response English Carp Readonly Please note that some elements of HTTP proxy support require that WWW::Curl has been built from a minimum version of the libcurl C library: authenticating proxies: 7.19.1 noproxy (proxy exclusion lists): 7.19.4 If you have an earlier version installed, you will not be able to use these features of Bio::Das::Lite. Regular proxy support should be unaffected. COPYRIGHT AND LICENCE Copyright (c) 2007 by Roger Pettett, Genome Research Ltd. http://www.sanger.ac.uk/ This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. Bio-Das-Lite-2.04/SIGNATURE000644000765000024 1076711407221232 14302 0ustar00rmpstaff000000000000This file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.64. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It will check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 SHA1 8fd0684566996beabcf8c7a5cc0156d120d33aaa Build.PL SHA1 c38ade5c88a5d42a180bb9dcc8e6c5ce3f6e9bbf Changes SHA1 640c25e8284118619a4643fc7af9288d0b46b721 MANIFEST SHA1 6138f0880613d638ad2b04bd5360e8e126eb62c8 META.yml SHA1 caba8581f435336284a57040ab22fdc3a2d53379 README SHA1 766ee472447381f216f5a8568cb14b31e26c9310 eg/callback_test SHA1 8ca2625e70ac5e97e6cb514887bf9001baa2b65a eg/comparison SHA1 87fa72d78044b332162b5f2d4738ef7a8d8c88f0 eg/empty_segment SHA1 9e14f1c3fe6abbc1fb690150845a78bc0ba49358 eg/new_from_registry SHA1 f0daf11fae56c32d6185f80bd82f74836b1e5c20 eg/regtest SHA1 2d197b31031842996e5263b8d8051d0691c140ec eg/stylesheet_test SHA1 b3452ef16aa222d32f05f5840d74d7e9661e9bd5 eg/uniprot-test SHA1 b8f2bdba9609c0f6a985d3ba9e8e3f78d82a2ef4 lib/Bio/Das/Lite.pm SHA1 568adefa11768a30d951071b0e6bdf1166a0bb46 t/00-critic.t SHA1 8f4d0a71e08516d797d578d24b29436076d5e5d6 t/00-distribution.t SHA1 8b6d86483f31129f7c64269838d44dfa46cb8bae t/00-pod.t SHA1 d27d6c01dee353ae57e633eb20679804432bbbfc t/00-podcoverage.t SHA1 938b480251f4a7c0ba3dd7da59fa487ece40f4b4 t/01-general.t SHA1 a03c0713033d6be0a1a6f0a21ff62486f2c602ef t/02-statuscodes.t SHA1 537649ceabb25c61967702f74be71b4519d839de t/05-singledsn.t SHA1 301741de994959b070a40021d7430c10fd940fbc t/06-singledsn-singleseg.t SHA1 5aed7ecab723bfc1c7f76d98869a5b7428df767e t/07-singledsn-multiseg.t SHA1 6d98c2cd16291e8ed71305eceebf6276fd9803af t/10-multidsn.t SHA1 430a517db9b7377a6ac68a763f825a0a74b86bae t/20-authentication.t SHA1 5ee037849a60cb66e6aca7c9b487f0504c2d1868 t/21-proxy.t SHA1 06eed20454a233831e48141b00744ff42d5c5604 t/40-dna.t SHA1 b174fc3d64318afbbc4cf4520e564458e3e865ba t/45-sequence.t SHA1 8c9167cb3f36408be5d1972da95bcb8c323fb79a t/50-entry_points.t SHA1 e4780f57ec2c75553053560dd0e70dcc8f541615 t/60-features.t SHA1 4ff22e650c7522636b1181c241a3c8faa8744288 t/60-features_chunked.t SHA1 76d8aea9b0347fd92ff0b5697c4592003a628bfd t/60-features_empty.t SHA1 5298442f15b4941a6a5f3325708a706071ac93fc t/61-features_group.t SHA1 4b7fe3af081ce2c8811528ec78f5c41f193839e6 t/70-alignment.t SHA1 9177f4d319159508ce32d841fadc245a7240717b t/80-structure.t SHA1 f53c99fcccdd8817e659f123f32ba8e3a9bf479e t/90-sources.t SHA1 2ed2ff7d136e802fb37a491151afb7599ef71bf7 t/FileStub.pm SHA1 8e72b851a95ac6fa5c0f029742e94271b58f98a1 t/FileStubChunked.pm SHA1 c8bc476a93d0ca69a7739b0a885c64d3c2a31b97 t/FileStubCompat.pm SHA1 b8ce1fb7c27e657c734bd93c7446b75659ce3428 t/alignment.xml SHA1 bcc696cc5f93712cf4dc53f4d482fb104f022542 t/dna.xml SHA1 48b1de5d21eef8ac2df0256e38ae1bbdc337970b t/entry_points-ensembl1834.xml SHA1 3b33ba4da52c32fe4c7aa5cb31c43076a65a3875 t/entry_points.xml SHA1 e25a2efe3429872e35227a143681e73c366b6736 t/features-empty.xml SHA1 c885de7b1b27a7ef87abe113a1532cf9844c4564 t/features-ensembl1834.xml SHA1 97737b94ec5ae2122c8f84f857b788398e271aa5 t/features-group.xml SHA1 dd01ca4322f625c84fb6150cf6c3e924ee0de149 t/features.xml SHA1 4187ecfe701c5fc3014db29977740f4dff991d4b t/sequence-ensembl1834.xml SHA1 4394fa0e0c067a3e33b47cb3f1e8ebd62183f711 t/sequence.xml SHA1 f4c02d7b9af1d019a4626e8676c7dc57e96662eb t/source.xml SHA1 4f44a6a90253e89e8fc12c211e7759cbb911b297 t/structure.xml SHA1 e186ead2aab9cf6628921a3c65d467f15f0f913b t/types-ensembl1834.xml -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) iQIcBAEBAgAGBQJMHSKXAAoJEKRiRxpY9zRJrXsP/3Td736WARhlGGx5AmOK8vDY tMXWULa/yoEyJMxYgSZJo5WYuk1/ChhxOQSHqnIhzCqj1OLckkn/YtsTEa/gw5vr gm+sZ4Z5MyXGmRyAAZG2Gpgeq4gzIs+H8DxUpEVRwz6aR9TXR54y+KgFN/iqMsHt BnOFT6vpXIbf2JeHI2uLilQwgovCR+TMtyEhei5wietGTJIa2T6GuCfVGRbGDxGV qgcMufSYShRmrd4jPlbChuewDH6To0MIMgE9WrxjS9/AfaUncBPeVLmt536L6NPY 4HT2uCgCPWyvNpD44iL1CoGB2Nr0I3CzwIYO5obFzyJlAS+KYjMCUUWOcptux4R7 zB6yMfhf7dTtcUpj7Uwu5C61dbp+DnxIjrT225zXoM3iOnqFk+mBdTShV28IoTjI rmmfOs3sOea1HzOdw1tvXZU6NQYvQiGYgB4z1uADc3+mXsn71/h4bjYOf+RY6OUe D4akQpQyHcaS5fICB1Mf8gD1uqF2xZHTEwNjYdtXuqfjANHjF7UT3IomQAiZLZ7/ NYwsPbnCguGVvQdzWHobvzGAE6ZQ0UaGCSJgEorwLu8+F7H6vX9NIvvptHX7YHZ9 o+eFhNN0gxgEH0PaTnnvWDSQfZmWMrDNyTYwO/efiKPmoux1opKW/MvtYPYb8SQt 2FREtDoZT74BVskkgtbl =rse7 -----END PGP SIGNATURE----- Bio-Das-Lite-2.04/eg000755000765000024 011407221227 13223 5ustar00rmpstaff000000000000Bio-Das-Lite-2.04/eg/callback_test000555000765000024 253211407221227 16103 0ustar00rmpstaff000000000000#!/usr/local/bin/perl -wT use strict; use lib "lib"; use Bio::DasLite; use Data::Dumper; my $counts = {}; my $cb = sub { my $struct = shift; $counts->{$struct->{'dsn'}}++; print STDERR Dumper($struct); }; my $das = Bio::DasLite->new({ 'timeout' => 30, 'dsn' => [qw( http://das.ensembl.org/das/hydraeuf_00000281 http://das.ensembl.org/das/hydraeuf_00000282 http://das.ensembl.org/das/hydraeuf_00000283 http://das.ensembl.org/das/hydraeuf_00000284 http://das.ensembl.org/das/hydraeuf_00000285 http://das.ensembl.org/das/hydraeuf_00000286 http://das.ensembl.org/das/hydraeuf_00000287 http://das.ensembl.org/das/hydraeuf_00000291 http://das.ensembl.org/das/hydraeuf_00000292 http://das.ensembl.org/das/hydraeuf_00000293 http://das.ensembl.org/das/hydraeuf_00000294 http://das.ensembl.org/das/hydraeuf_00000295 http://das.ensembl.org/das/hydraeuf_00000296 http://das.ensembl.org/das/hydraeuf_00000297 )], # 'callback' => $cb, }); #$das->features("1:1,1000000"); #$das->features("1:1,1000000", $cb); #$das->features([ # "1:1,1000000", # "2:1,1000000", # ], # $cb); $das->features("13:31787617,31871805",$cb); print map { "$_\t$counts->{$_}\n" } sort keys %{$counts}; Bio-Das-Lite-2.04/eg/comparison000555000765000024 160011407221227 15455 0ustar00rmpstaff000000000000#!/usr/local/bin/perl -wT ######### # This script needs to have Bio:Das and Bio::DasLite installed, or be started with: # perl -I/path/to/bio-das -I/path/to/bio-daslite # use strict; use Bio::Das; use Bio::DasLite; use Benchmark; use Data::Dumper; #$Bio::DasLite::DEBUG = 1; use vars qw($SOURCES); $SOURCES = [qw(http://servlet.sanger.ac.uk/das/ensembl1834 http://das.sanger.ac.uk/das/spectral35)]; ######### # Build some random segments # my @segments = (); for (my $chr=1;$chr<=20;$chr++) { my $rnd = int(rand(100000000)); push @segments, "$chr:$rnd,@{[$rnd+1000000]}"; } my $biodas = Bio::Das->new(); my $biodaslite = Bio::DasLite->new({'dsn' => $SOURCES, 'caching' => 0}); timethese( 5, { "Bio::Das" => sub { $biodas->features(-dsn => $SOURCES, -segment => \@segments); }, "Bio::DasLite" => sub { $biodaslite->features(\@segments); }, }, ); Bio-Das-Lite-2.04/eg/empty_segment000555000765000024 67111407221227 16152 0ustar00rmpstaff000000000000#!/usr/bin/perl -wT use strict; use lib qw(blib/lib lib ../blib/lib ../lib); use Bio::DasLite; use Data::Dumper; my $das = Bio::DasLite->new("http://servlet.sanger.ac.uk:8080/das/ensembl_Anopheles_gambiae_core_28_2c"); $das->timeout(60); print Dumper($das->features([ { 'segment' => "3R", 'category' => 'null', }, { 'segment' => '3L', 'category' => 'null', } ])); Bio-Das-Lite-2.04/eg/new_from_registry000555000765000024 63411407221227 17035 0ustar00rmpstaff000000000000#!/usr/bin/perl -wT use strict; use lib qw(lib ../lib); use Bio::DasLite; my $bdl = Bio::DasLite->new_from_registry({ 'http_proxy' => 'http://webcache.sanger.ac.uk:3128/', 'capability' => ['features'], 'category' => ['Protein Sequence'], }); print qq(Using Bio::DasLite v$Bio::DasLite::VERSION configured with registry DSN list:\n), join("\n", sort @{$bdl->dsn()}), "\n"; Bio-Das-Lite-2.04/eg/regtest000555000765000024 121311407221227 14760 0ustar00rmpstaff000000000000#!/usr/bin/perl -wT use strict; use lib qw(lib ../lib); use Bio::DasLite; use Data::Dumper; $Bio::DasLite::DEBUG = 1; my $das = Bio::DasLite->new(); my $sources = $das->registry_sources(); my $count_all = scalar @{$das->registry_sources()}; my $count_stylesheet = scalar @{$das->registry_sources({ 'capability' => ['stylesheet'] })}; my $count_protein = scalar @{$das->registry_sources({ 'category' => ['Protein Sequence'] })};; print Dumper($das->registry_sources()); print STDERR qq( all = $count_all stylesheet = $count_stylesheet protein = $count_protein \n); Bio-Das-Lite-2.04/eg/stylesheet_test000555000765000024 71711407221227 16523 0ustar00rmpstaff000000000000#!/usr/local/bin/perl -wT use lib "lib"; use Bio::DasLite; use Data::Dumper; $Bio::DasLite::DEBUG = 0; print STDERR "VERSION=",$Bio::DasLite::VERSION, "\n"; my $das = Bio::DasLite->new({ 'dsn' => 'http://das.ensembl.org/das', }); my $ref = $das->dsns(); my @all = map { "http://das.ensembl.org/das/$_->{'source'}" } map { @{$ref->{$_}} } keys %{$ref}; $das->dsn(\@all); print Dumper($das->stylesheet()); #print Dumper($bdl->features("1:1,50000000")); Bio-Das-Lite-2.04/eg/uniprot-test000555000765000024 147011407221227 15765 0ustar00rmpstaff000000000000#!/usr/local/bin/perl -wT use lib qw(./blib/lib ./lib ../blib/lib); use strict; use Bio::DasLite; use Data::Dumper; $Bio::DasLite::DEBUG = 0; my $bd = Bio::DasLite->new("http://www.ebi.ac.uk/das-srv/uniprot/das/aristotle"); #print Dumper($bd->features("P50225")); my $blks = []; my $res = $bd->features('P50225', sub { my ($a) = @_; my $rq_key = (keys %{$bd->{'data'}})[0]; push @{$blks}, $bd->{'data'}->{$rq_key}; # print STDERR "a=$a\n"; # print STDERR "CALLBACK a=".Dumper($a)."\n"; }, ); print "First block was: $blks->[0]\n"; print "Callback was called @{[scalar @$blks]} times\n"; my $key = (keys %$res)[0]; print "res=$res, key=$key, res->key = $res->{$key}\n"; if(ref($res->{$key}) eq "ARRAY") { print "Got @{[scalar @{$res->{$key}}]} sets back\n"; } else { print Dumper $res; } Bio-Das-Lite-2.04/lib000755000765000024 011407221227 13376 5ustar00rmpstaff000000000000Bio-Das-Lite-2.04/lib/Bio000755000765000024 011407221227 14107 5ustar00rmpstaff000000000000Bio-Das-Lite-2.04/lib/Bio/Das000755000765000024 011407221227 14616 5ustar00rmpstaff000000000000Bio-Das-Lite-2.04/lib/Bio/Das/Lite.pm000444000765000024 13641611407221227 16261 0ustar00rmpstaff000000000000######### # Author: rpettett@cpan.org # Maintainer: rpettett@cpan.org # Created: 2005-08-23 # Last Modified: $Date: 2010-06-19 20:57:00 +0100 (Sat, 19 Jun 2010) $ $Author: zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/lib/Bio/Das/Lite.pm,v $ # Id: $Id: Lite.pm 37 2010-06-19 19:57:00Z zerojinx $ # $HeadURL $ # package Bio::Das::Lite; use strict; use warnings; use WWW::Curl::Multi; use WWW::Curl::Easy; # CURLOPT imports use HTTP::Response; use Carp; use English qw(-no_match_vars); use Readonly; our $DEBUG = 0; our $VERSION = '2.04'; Readonly::Scalar our $TIMEOUT => 5; Readonly::Scalar our $REG_TIMEOUT => 15; Readonly::Scalar our $LINKRE => qr{]*?>([^<]*)|]*?/>}smix; Readonly::Scalar our $NOTERE => qr{]*>([^<]*)}smix; Readonly::Scalar our $DAS_STATUS_TEXT => { 200 => '200 OK', 400 => '400 Bad command (command not recognized)', 401 => '401 Bad data source (data source unknown)', 402 => '402 Bad command arguments (arguments invalid)', 403 => '403 Bad reference object', 404 => '404 Requested object unknown', 405 => '405 Coordinate error', 500 => '500 Server error', 501 => '501 Unimplemented feature', }; ######### # $ATTR contains information about document structure - tags, attributes and subparts # This is split up by call to reduce the number of tag passes for each response # our %COMMON_STYLE_ATTRS = ( yoffset => [], # WTSI extension (available in Ensembl) scorecolormin => [], # WTSI extension scorecolormax => [], # WTSI extension scoreheightmin => [], # WTSI extension scoreheightmax => [], # WTSI extension zindex => [], # WTSI extension (available in Ensembl) width => [], # WTSI extension (available in Ensembl) height => [], fgcolor => [], bgcolor => [], label => [], bump => [], ); our %SCORED_STYLE_ATTRS = ( min => [], max => [], steps => [], color1 => [], color2 => [], color3 => [], height => [], ); our $ATTR = { '_segment' => { 'segment' => [qw(id start stop version label)], }, # feature and group notes and links are special cases and taken care of elsewhere 'feature' => { 'feature' => [qw(id label)], 'method' => [qw(id)], 'type' => [qw(id category reference subparts superparts)], 'target' => [qw(id start stop)], 'start' => [], 'end' => [], 'orientation' => [], 'phase' => [], 'score' => [], 'group' => { 'group' => [qw(id label type)], 'target' => [qw(id start stop)], }, }, 'sequence' => { 'sequence' => [qw(id start stop moltype version)], }, 'dna' => { 'sequence' => { 'sequence' => [qw(id start stop version)], 'dna' => [qw(length)], }, }, 'entry_points' => { 'entry_points' => [qw(href version)], 'segment' => { 'segment' => [qw(id start stop type orientation size subparts)], }, }, 'dsn' => { 'dsn' => [], 'source' => [qw(id)], 'mapmaster' => [], 'description' => [], }, 'type' => { 'type' => [qw(id method category)], 'segment' => [qw(id start stop type orientation size subparts)], }, 'alignment' => { 'alignment' => [qw(name alignType max)], 'alignobject' => { 'alignobject' => [qw(objVersion intObjectId type dbSource dbVersion dbAccessionId dbCoordSys)], 'alignobjectdetail' => { 'alignobjectdetail' => [qw(dbSource property)], }, 'sequence' => [], }, 'score' => [qw(score)], 'block' => { 'block' => [qw(blockOrder)], 'segment' => { 'segment' => [qw(intObjectId start end orientation)], 'cigar' => [], }, }, }, 'structure' => { 'object' => [qw(dbAccessionId inObjectId objectVersion type dbSource dbVersion dbCoordSys)], 'chain' => { 'chain' => [qw(id SwissprotId model)], 'group' => { 'group' => [qw(name type groupID)], 'atom' => { 'atom' => [qw(atomID occupancy tempFactor altLoc atomName x y z)] }, }, }, 'het' => { 'group' => { 'group' => [qw(name type groupID)], 'atom' => { 'atom' => [qw(atomId occupancy tempFactor altLoc atomName x y z)] }, }, }, 'connect' => { 'connect' => [qw(atomSerial type)], 'atomID' => { 'atomID' => [qw(atomID)], }, }, }, 'sources' => { 'source' => { 'source' => [qw(uri title doc_href description)], 'maintainer' => { 'maintainer' => [qw(email)], }, 'version' => { 'version' => [qw(uri created)], 'coordinates' => { 'coordinates' => [qw(uri source authority taxid test_range version)], }, 'capability' => { 'capability' => [qw(type query_uri)], }, 'prop' => { 'prop' => [qw(name value)], }, }, }, }, 'stylesheet' => { 'stylesheet' => [qw(version)], 'category' => { 'category' => [qw(id)], 'type' => { 'type' => [qw(id)], 'glyph' => { 'glyph' => [qw(zoom)], 'arrow' => { 'parallel' => [], 'bar_style' => [], # WTSI extension %COMMON_STYLE_ATTRS, }, 'anchored_arrow' => { 'parallel' => [], 'orientation' => [], # WTSI extension 'no_anchor' => [], # WTSI extension 'bar_style' => [], # WTSI extension %COMMON_STYLE_ATTRS, }, 'box' => { 'linewidth' => [], 'pattern' => [], # WTSI extension %COMMON_STYLE_ATTRS, }, 'farrow' => { # WTSI extension 'orientation' => [], 'no_anchor' => [], 'bar_style' => [], # WTSI extension %COMMON_STYLE_ATTRS, }, 'rarrow' => { # WTSI extension 'orientation' => [], 'no_anchor' => [], 'bar_style' => [], # WTSI extension %COMMON_STYLE_ATTRS, }, 'cross' => { 'linewidth' => [], # WTSI extension %COMMON_STYLE_ATTRS, }, 'dot' => \%COMMON_STYLE_ATTRS, 'ex' => { 'linewidth' => [], # WTSI extension %COMMON_STYLE_ATTRS, }, 'hidden' => \%COMMON_STYLE_ATTRS, 'line' => { 'style' => [], %COMMON_STYLE_ATTRS, }, 'span' => { 'bar_style' => [], # WTSI extension %COMMON_STYLE_ATTRS, }, 'text' => { 'font' => [], 'fontsize' => [], 'string' => [], 'style' => [], %COMMON_STYLE_ATTRS, }, 'primers' => \%COMMON_STYLE_ATTRS, 'toomany' => { 'linewidth' => [], %COMMON_STYLE_ATTRS, }, 'triangle' => { 'linewidth' => [], 'direction' => [], 'orientation' => [], %COMMON_STYLE_ATTRS, }, 'gradient' => { %SCORED_STYLE_ATTRS, }, 'histogram' => { %SCORED_STYLE_ATTRS, }, 'tiling' => { %SCORED_STYLE_ATTRS, }, 'lineplot' => { %SCORED_STYLE_ATTRS, }, }, }, }, }, }; ######### # $OPTS contains information about parameters to use for queries # our $OPTS = { 'feature' => [qw(segment type category categorize feature_id group_id maxbins)], 'type' => [qw(segment type)], 'sequence' => [qw(segment)], 'dna' => [qw(segment)], 'entry_points' => [], 'dsn' => [], 'stylesheet' => [], 'alignment' => [qw(query rows subject subjectcoordsys)], 'structure' => [qw(query)], }; sub new { my ($class, $ref) = @_; $ref ||= {}; my $self = { 'dsn' => [], 'timeout' => $TIMEOUT, 'data' => {}, 'caching' => 1, 'registry' => [qw(http://www.dasregistry.org/das)], '_registry_sources' => [], }; bless $self, $class; if($ref && ref $ref) { for my $arg (qw(dsn timeout caching callback registry user_agent http_proxy proxy_user proxy_pass no_proxy)) { if(exists $ref->{$arg} && $self->can($arg)) { $self->$arg($ref->{$arg}); } } } elsif($ref) { $self->dsn($ref); } return $self; } sub new_from_registry { my ($class, $ref) = @_; my $user_timeout = defined $ref->{timeout} ? 1 : 0; my $self = $class->new($ref); # If the user specifies a timeout, use it. # But if not, temporarily increase the timeout for the registry request. if (!$user_timeout) { $self->timeout($REG_TIMEOUT); } my $sources = $self->registry_sources($ref); # And reset it back to the "normal" non-registry timeout. if (!$user_timeout) { $self->timeout($TIMEOUT); } $self->dsn([map { $_->{'url'} } @{$sources}]); return $self; } # We implement this method because LWP does not parse user/password sub http_proxy { my ($self, $proxy) = @_; if($proxy) { $self->{'http_proxy'} = $proxy; } if(!$self->{'_checked_http_proxy_env'}) { $self->{'http_proxy'} ||= $ENV{'http_proxy'} || q(); $self->{'_checked_http_proxy_env'} = 1; } if($self->{'http_proxy'} =~ m{^(https?://)(\S+):(.*?)\@(.*?)$}smx) { ######### # http_proxy contains username & password - we'll set them up here: # $self->proxy_user($2); $self->proxy_pass($3); $self->{'http_proxy'} = "$1$4"; } return $self->{'http_proxy'}; } sub no_proxy { my ($self, @args) = @_; if (scalar @args) { if ($args[0] && ref $args[0] && ref $args[0] eq 'ARRAY') { $self->{'no_proxy'} = $args[0]; } else { $self->{'no_proxy'} = \@args; } } if(!$self->{'_checked_no_proxy_env'}) { $self->{'no_proxy'} ||= [split /\s*,\s*/smx, $ENV{'no_proxy'} || q()]; $self->{'_checked_no_proxy_env'} = 1; } return $self->{'no_proxy'} || []; } sub _get_set { my ($self, $key, $value) = @_; if(defined $value) { $self->{$key} = $value; } return $self->{$key}; } sub proxy_user { my ($self, $val) = @_; return $self->_get_set('proxy_user', $val); } sub proxy_pass { my ($self, $val) = @_; return $self->_get_set('proxy_pass', $val); } sub user_agent { my ($self, $val) = @_; return $self->_get_set('user_agent', $val) || "Bio::Das::Lite v$VERSION"; } sub timeout { my ($self, $val) = @_; return $self->_get_set('timeout', $val); } sub caching { my ($self, $val) = @_; return $self->_get_set('caching', $val); } sub max_hosts { my ($self, $val) = @_; carp 'WARNING: max_hosts method is decprecated and has no effect'; return $self->_get_set('_max_hosts', $val); } sub max_req { my ($self, $val) = @_; carp 'WARNING: max_req method is decprecated and has no effect'; return $self->_get_set('_max_req', $val); } sub callback { my ($self, $val) = @_; return $self->_get_set('callback', $val); } sub basename { my ($self, $dsn) = @_; $dsn ||= $self->dsn(); my @dsns = (ref $dsn)?@{$dsn}:$dsn; my @res = (); for my $service (@dsns) { $service =~ m{(https?://.*/das)/?}smx; if($1) { push @res, $1; } } return \@res; } sub dsn { my ($self, $dsn) = @_; if($dsn) { if(ref $dsn eq 'ARRAY') { $self->{'dsn'} = $dsn; } else { $self->{'dsn'} = [$dsn]; } } return $self->{'dsn'}; } sub dsns { my ($self, $query, $opts) = @_; $opts ||= {}; $opts->{'use_basename'} = 1; return $self->_generic_request($query, 'dsn', $opts); } sub entry_points { my ($self, $query, $opts) = @_; return $self->_generic_request($query, 'entry_points', $opts); } sub types { my ($self, $query, $opts) = @_; return $self->_generic_request($query, 'type(s)', $opts); } sub features { my ($self, $query, $callback, $opts) = @_; if(ref $callback eq 'HASH' && !defined $opts) { $opts = $callback; undef $callback; } if($callback) { $self->{'callback'} = $callback; } return $self->_generic_request($query, 'feature(s)', $opts); } sub sequence { my ($self, $query, $opts) = @_; return $self->_generic_request($query, 'sequence', $opts); } sub dna { my ($self, $query, $opts) = @_; return $self->_generic_request($query, 'dna', $opts); } sub alignment { my ($self, $opts) = @_; return $self->_generic_request($opts, 'alignment'); } sub structure { my ($self, $opts) = @_; return $self->_generic_request($opts, 'structure'); } sub sources { my ($self, $opts) = @_; return $self->_generic_request($opts, 'sources'); } sub stylesheet { my ($self, $callback, $opts) = @_; if(ref $callback eq 'HASH' && !defined $opts) { $opts = $callback; undef $callback; } if($callback) { $self->{'callback'} = $callback; } return $self->_generic_request(undef, 'stylesheet', $opts); } ######### # Private methods # ######### # Build the query URL; perform an HTTP fetch; drop into the recursive parser; apply any post-processing # sub _generic_request { my ($self, $query, $fname, $opts) = @_; $opts ||= {}; delete $self->{'currentsegs'}; my $results = {}; my $reqname = $fname; $reqname =~ s/(?:[(]|[)])//smxg; ($fname) = $fname =~ /^([[:lower:]_]+)/smx; my $ref = $self->build_requests({ query => $query, fname => $fname, reqname => $reqname, opts => $opts, results => $results }); $self->_fetch($ref, $opts->{'headers'}); $DEBUG and print {*STDERR} qq(Content retrieved\n); $self->postprocess($fname, $results); ######### # deal with caching # if($self->{'caching'}) { $DEBUG and print {*STDERR} qq(Performing cache handling\n); for my $s (keys %{$results}) { if($DEBUG && !$results->{$s}) { print {*STDERR} qq(CACHE HIT for $s\n); ## no critic (InputOutput::RequireCheckedSyscalls) } $results->{$s} ||= $self->{'_cache'}->{$s}; $self->{'_cache'}->{$s} ||= $results->{$s}; } } return $results; } sub build_queries { my ($self, $query, $fname) = @_; my @queries; if($query) { if(ref $query eq 'HASH') { ######### # If the query param was a hashref, stitch the parts together # push @queries, join q(;), map { "$_=$query->{$_}" } grep { $query->{$_} } @{$OPTS->{$fname}}; } elsif(ref $query eq 'ARRAY') { ######### # If the query param was an arrayref # if(ref $query->[-1] eq 'CODE') { ######### # ... and the last arg is a code-block, set up the callback for this run and remove the arg # $self->callback($query->[-1]); pop @{$query}; } if(ref $query->[0] eq 'HASH') { ######### # ... or if the first array arg is a hash, stitch the series of queries together # push @queries, map { ## no critic (ProhibitComplexMappings) my $q = $_; join q(;), map { "$_=$q->{$_}" } grep { $q->{$_} } @{$OPTS->{$fname}}; } @{$query}; } else { ######### # ... but otherwise assume it's a plain segment string # push @queries, map { "segment=$_"; } @{$query}; } } else { ######### # and if it wasn't a hashref or an arrayref, then assume it's a plain segment string # push @queries, "segment=$query"; } } else { ######### # Otherwise we've no idea what you're trying to do # push @queries, q(); } return \@queries; } sub _hack_fname { my ($self, $fname) = @_; ######### # Sucky hacks # if($fname eq 'structure') { $fname = 'dasstructure'; } elsif($fname eq 'dna') { $fname = 'sequence'; } return $fname; } sub build_requests { my ($self, $args) = @_; my $query = $args->{query}; my $fname = $args->{fname}; my $reqname = $args->{reqname}; my $opts = $args->{opts}; my $results = $args->{results}; my $queries = $self->build_queries($query, $fname); my $attr = $ATTR->{$fname}; my $dsn = $opts->{'use_basename'}?$self->basename():$self->dsn(); my @bn = @{$dsn}; my $ref = {}; for my $bn (@bn) { ######### # loop over dsn basenames # $bn =~ s/\/+$//smx; for my $request (map { $_ ? "$bn/$reqname?$_" : "$bn/$reqname" } @{$queries}) { ######### # and for each dsn, loop over the query request # if($self->{'caching'} && $self->{'_cache'}->{$request}) { ######### # the key has to be present, but the '0' callback will be ignored by _fetch # $results->{$request} = 0; next; } $results->{$request} = []; $ref->{$request} = sub { my $data = shift || q(); $self->{'data'}->{$request} .= $data; if(!$self->{'currentsegs'}->{$request}) { ######### # If we haven't yet found segment information for this request # Then look for some. This one is a non-destructive scan. # my $matches = $self->{'data'}->{$request} =~ m{(]*>)}smix; if($matches) { my $seginfo = []; $self->_parse_branch({ request => $request, seginfo => $seginfo, attr => $ATTR->{'_segment'}, blk => $1, addseginfo => 0, }); $self->{'currentsegs'}->{$request} = $seginfo->[0]; } } if($DEBUG) { print {*STDERR} qq(invoking _parse_branch for $fname\n) or croak $ERRNO; } ######### # Sucky hacks # if($fname eq 'dna') { $attr = $attr->{'sequence'}; } $fname = $self->_hack_fname($fname); my $pat = qr{(<$fname.*?/$fname>|<$fname[^>]+/>)}smix; while($self->{'data'}->{$request} =~ s/$pat//smx) { $self->_parse_branch({ request => $request, seginfo => $results->{$request}, attr => $attr, blk => $1, addseginfo => 1, }); } if($DEBUG) { print {*STDERR} qq(completed _parse_branch\n) or croak $ERRNO; } return; }; } } return $ref; } sub postprocess { my ($self, $fname, $results) = @_; $fname = $self->_hack_fname($fname); ######### # Add in useful segment information for empty segments # In theory there should only ever be one element in @{$self->{'seginfo'}} # as requests are parallelised by segment # for my $req (keys %{$results}) { if(!$results->{$req} || scalar @{$results->{$req}} == 0) { $results->{$req} = $self->{'currentsegs'}->{$req}; } } ######### # fix ups # if($fname eq 'entry_points') { $DEBUG and print {*STDERR} qq(Running postprocessing for entry_points\n); for my $s (keys %{$results}) { my $res = $results->{$s} || []; for my $r (@{$res}) { delete $r->{'segment_id'}; } } } elsif($fname eq 'sequence') { $DEBUG and print {*STDERR} qq(Running postprocessing for dna\n); for my $s (keys %{$results}) { my $res = $results->{$s} || []; for my $r (@{$res}) { if(exists $r->{'dna'}) { $r->{'dna'} =~ s/\s+//smgx; } elsif(exists $r->{'sequence'}) { $r->{'sequence'} =~ s/\s+//smgx; } } } } return; } ######### # Set up the parallel HTTP fetching # This uses our LWP::Parallel::UserAgent subclass which handles DAS statuses # sub _fetch { my ($self, $url_ref, $headers) = @_; $self->{'statuscodes'} = {}; if(!$headers) { $headers = {}; } if($ENV{HTTP_X_FORWARDED_FOR}) { $headers->{'X-Forwarded-For'} ||= $ENV{'HTTP_X_FORWARDED_FOR'}; } # Convert header pairs to strings my @headers; for my $h (keys %{ $headers }) { push @headers, "$h: " . $headers->{$h}; } # We will now issue the actual requests. Due to insufficient support for error # handling and proxies, we can't use WWW::Curl::Simple. So we generate a # WWW::Curl::Easy object here, and register it with WWW::Curl::Multi. my $curlm = WWW::Curl::Multi->new(); my %reqs; my $i = 0; # First initiate the requests for my $url (keys %{$url_ref}) { if(ref $url_ref->{$url} ne 'CODE') { next; } $DEBUG and print {*STDERR} qq(Building WWW::Curl::Easy for $url [timeout=$self->{'timeout'}] via $url_ref->{$url}\n); $i++; my $curl = WWW::Curl::Easy->new(); $curl->setopt( CURLOPT_NOPROGRESS, 1 ); $curl->setopt( CURLOPT_USERAGENT, $self->user_agent ); $curl->setopt( CURLOPT_URL, $url ); if (scalar @headers) { $curl->setopt( CURLOPT_HTTPHEADER, \@headers ); } my ($body_ref, $head_ref); open my $fileb, q[>], \$body_ref or croak 'Error opening data handle'; ## no critic (RequireBriefOpen) $curl->setopt( CURLOPT_WRITEDATA, $fileb ); open my $fileh, q[>], \$head_ref or croak 'Error opening header handle'; ## no critic (RequireBriefOpen) $curl->setopt( CURLOPT_WRITEHEADER, $fileh ); # we set this so we have the ref later on $curl->setopt( CURLOPT_PRIVATE, $i ); $curl->setopt( CURLOPT_TIMEOUT, $self->timeout || $TIMEOUT ); #$curl->setopt( CURLOPT_CONNECTTIMEOUT, $self->connection_timeout || 2 ); $self->_fetch_proxy_setup($curl); $curlm->add_handle($curl); $reqs{$i} = { 'uri' => $url, 'easy' => $curl, 'head' => \$head_ref, 'body' => \$body_ref, }; } $DEBUG and print {*STDERR} qq(Requests submitted. Waiting for content\n); $self->_receive($url_ref, $curlm, \%reqs); return; } sub _fetch_proxy_setup { my ($self, $curl) = @_; if ( my $proxy = $self->http_proxy ) { if ( defined $Bio::Das::Lite::{CURLOPT_PROXY} ) { $curl->setopt( &CURLOPT_PROXY, $proxy ); ## no critic (ProhibitAmpersandSigils) } else { croak 'Trying to set a proxy, but your version of libcurl does not support this feature'; } } if ( my $proxy_user = $self->proxy_user ) { if ( defined $Bio::Das::Lite::{CURLOPT_PROXYUSERNAME} ) { $curl->setopt( &CURLOPT_PROXYUSERNAME, $proxy_user ); ## no critic (ProhibitAmpersandSigils) } else { croak 'Trying to set a proxy username, but your version of libcurl does not support this feature'; } } if ( my $proxy_pass = $self->proxy_pass ) { if ( defined $Bio::Das::Lite::{CURLOPT_PROXYPASSWORD} ) { $curl->setopt( &CURLOPT_PROXYPASSWORD, $proxy_pass ); ## no critic (ProhibitAmpersandSigils) } else { croak 'Trying to set a proxy password, but your version of libcurl does not support this feature'; } } my @no_proxy = @{ $self->no_proxy }; if ( scalar @no_proxy ) { if ( defined $Bio::Das::Lite::{CURLOPT_NOPROXY} ) { $curl->setopt( &CURLOPT_NOPROXY, join q(,), @no_proxy ); ## no critic (ProhibitAmpersandSigils) } else { croak 'Trying to set proxy exclusions, but your version of libcurl does not support this feature'; } } return; } sub _receive { my ($self, $url_ref, $curlm, $reqs) = @_; # Now check for results as they come back my $i = scalar keys %{ $reqs }; while ($i) { my $active_transfers = $curlm->perform; if ($active_transfers != $i) { while (my ($id,$retcode) = $curlm->info_read) { $id || next; $i--; my $req = $reqs->{$id}; my $uri = $req->{'uri'}; my $head = ${ $req->{'head'} } || q(); my $body = ${ $req->{'body'} } || q(); # We got a response from the server: if ($retcode == 0) { my $res = HTTP::Response->parse( $head . "\n" . $body ); my $msg; # Prefer X-DAS-Status my ($das_status) = ($res->header('X-DAS-Status') || q()) =~ m/^(\d+)/smx; if ($das_status) { $msg = $self->{statuscodes}->{$uri} = $DAS_STATUS_TEXT->{$das_status}; # just in case we get a status we don't understand: $msg ||= $das_status . q( ) . ($res->message || 'Unknown status'); } # Fall back to HTTP status else { $msg = $res->status_line; # workaround for bug in HTTP::Response parse method: $msg =~ s/\r//gsmx; } $self->{statuscodes}->{$uri} = $msg; $url_ref->{$uri}->($res->content); # run the content handling code } # A connection error, timeout etc (NOT an HTTP status): else { $self->{statuscodes}->{$uri} = '500 ' . $req->{'easy'}->strerror($retcode); } delete($reqs->{$id}); # put out of scope to free memory } } } return; } sub statuscodes { my ($self, $url) = @_; $self->{'statuscodes'} ||= {}; return $url?$self->{'statuscodes'}->{$url}:$self->{'statuscodes'}; } ######### # Using the $attr structure describing the structure of this branch, # recursively parse the XML blocks and build the corresponding response data structure # sub _parse_branch { my ($self, $args) = @_; my $dsn = $args->{request}; my $ar_ref = $args->{seginfo}; my $attr = $args->{attr}; my $blk = $args->{blk}; my $addseginfo = $args->{addseginfo}; my $depth = $args->{depth} || 0; my $ref = {}; my (@parts, @subparts); while(my ($k, $v) = each %{$attr}) { if(ref $v eq 'HASH') { push @subparts, $k; } else { push @parts, $k; } } ######### # recursive child-node handling, usually for s # for my $subpart (@subparts) { my $subpart_ref = []; my $pat = qr{(<$subpart[^>]*/>|<$subpart[^>]*?(?!/)>.*?/$subpart>)}smix; while($blk =~ s/$pat//smx) { $self->_parse_branch({ request => $dsn, seginfo => $subpart_ref, attr => $attr->{$subpart}, blk => $1, addseginfo => 0, depth => $depth+1, }); } if(scalar @{$subpart_ref}) { $ref->{$subpart} = $subpart_ref; } ######### # To-do: normalise group data across features here - mostly for 'group' tags in feature responses # i.e. merge links, use cached hashrefs (keyed on group id) describing groups to reduce the parsed tree footprint # } ######### # Attribute processing for tags in blocks # my $tmp; for my $tag (@parts) { my $opts = $attr->{$tag}||[]; for my $a (@{$opts}) { ($tmp) = $blk =~ m{<$tag[^>]+$a="([^"]+?)"}smix; if(defined $tmp) { $ref->{"${tag}_$a"} = $tmp; } } ($tmp) = $blk =~ m{<$tag[^>]*>([^<]+)}smix; if(defined $tmp) { $tmp =~ s/^\s+$//smgx; if(length $tmp) { $ref->{$tag} = $tmp; } } if($tmp && $DEBUG) { print {*STDERR} q( )x($depth*2), qq( $tag = $tmp\n); ## no critic (InputOutput::RequireCheckedSyscalls) } } $self->_parse_twig($dsn, $blk, $ref, $addseginfo); push @{$ar_ref}, $ref; $DEBUG and print {*STDERR} q( )x($depth*2), qq(leaving _parse_branch\n); ######### # only perform callbacks if we're at recursion depth zero # if($depth == 0 && $self->{'callback'}) { $DEBUG and print {*STDERR} q( )x($depth*2), qq(executing callback at depth $depth\n); $ref->{'dsn'} = $dsn; my $callback = $self->{'callback'}; &{$callback}($ref); } return q(); } sub _parse_twig { my ($self, $dsn, $blk, $ref, $addseginfo) = @_; ######### # handle multiples of twig elements here # $blk =~ s/$LINKRE/{ $ref->{'link'} ||= []; push @{$ref->{'link'}}, { 'href' => $1 || $3, 'txt' => $2, }; q() }/smegix; $blk =~ s/$NOTERE/{ $ref->{'note'} ||= []; push @{$ref->{'note'}}, $1; q() }/smegix; if($addseginfo && $self->{'currentsegs'}->{$dsn}) { while(my ($k, $v) = each %{$self->{'currentsegs'}->{$dsn}}) { $ref->{$k} = $v; } } return; } sub registry { my ($self, @reg) = @_; if((scalar @reg == 1) && (ref $reg[0]) && (ref$reg[0] eq 'ARRAY')) { push @{$self->{'registry'}}, @{$reg[0]}; } else { push @{$self->{'registry'}}, @reg; } return $self->{'registry'}; } sub registry_sources { my ($self, $filters, $flush) = @_; $filters ||= {}; my $category = $filters->{'category'} || []; my $capability = $filters->{'capability'} || $filters->{'capabilities'} || []; if(!ref $category) { $category = [$category]; } if(!ref $capability) { $capability = [$capability]; } $flush and $self->{'_registry_sources'} = []; ######### # Populate the list of sources if this is the first call or we're flushing # if (scalar @{$self->{'_registry_sources'}} == 0) { $self->_fetch_registry_sources() or return []; } ######### # Jump out if there's no filtering to be done # if(!scalar keys %{$filters}) { return $self->{'_registry_sources'}; } my $sources = $self->{'_registry_sources'}; ######### # Apply capability filter # if((ref $capability eq 'ARRAY') && (scalar @{$capability})) { my $str = join q(|), @{$capability}; my $match = qr/$str/smx; $sources = [grep { $self->_filter_capability($_, $match) } @{$sources}]; } ######### # Apply coordinatesystem/category filter # if((ref $category eq 'ARRAY') && (scalar @{$category})) { $sources = [grep { $self->_filter_category($_, $category) } @{$sources}]; } return $sources; } sub _fetch_registry_sources { my $self = shift; my $reg_urls = $self->registry(); if (!scalar @{ $reg_urls }) { return; } my $old_dsns = $self->dsn(); my $old_statuses = $self->{'statuscodes'}; $self->dsn($reg_urls); ######### # Run the DAS sources command # my $sources_ref = $self->sources(); my $statuses = $self->{'statuscodes'}; $self->dsn($old_dsns); $self->{'statuscodes'} = $old_statuses; for my $url (keys %{ $sources_ref || {} }) { my $status = $statuses->{$url} || 'Unknown status'; if ($status !~ m/^200/mxs) { carp "Error fetching sources from '$url' : $status"; next; } my $ref = $sources_ref->{$url} || []; ######### # Some basic checks # (ref $ref eq 'ARRAY') || return; $ref = $ref->[0] || {}; (ref $ref eq 'HASH') || return; $ref = $ref->{'source'} || []; (ref $ref eq 'ARRAY') || return; ######### # The sources command has sources (really groups of sources) and # versions (really individual sources). For compatibility with the # old SOAP way of doing things, we must: # 1. throw away this source grouping semantic # 2. convert the hash format to the old style # for my $sourcegroup (@{ $ref }) { $self->_fetch_registry_sources_sourcegroup($sourcegroup); } } return 1; } sub _fetch_registry_sources_sourcegroup { my ($self, $sourcegroup) = @_; my $versions = $sourcegroup->{'version'} || []; (ref $versions eq 'ARRAY') || next; for my $source (@{ $versions }) { my $caps = $source->{'capability'} || []; my $dsn; my $object = { capabilities => [], coordinateSystem => [], description => $sourcegroup->{source_description}, id => $source->{version_uri}, }; ######### # Some sources have 'more info' URLs # if ( my $doc_href = $sourcegroup->{source_doc_href} ) { $object->{helperurl} = $doc_href; } ######### # Add the capabilties # for my $cap (@{ $caps }) { ######### # Extract the DAS URL from one of the capabilities # NOTE: in DAS 1 we assume all capability query URLs for one # source are the same. Anything else would need the data # model to be redesigned. # if (!$dsn) { $dsn = $cap->{'capability_query_uri'} || q(); ($dsn) = $dsn =~ m{(.+/das\d?/[^/]+)}mxs; $object->{'url'} = $dsn; } my $cap_type = $cap->{'capability_type'} || q(); ($cap_type) = $cap_type =~ m/das\d:(.+)/mxs; $cap_type || next; push @{ $object->{'capabilities'} }, $cap_type; } ######### # If none of the capabilities have query URLs, we can't query them! # $object->{'url'} || next; ######### # Add the coordinates # my $coords = $source->{'coordinates'} || []; for my $coord (@{ $coords }) { ######### # All coordinates have a name and category # my $coord_ob = { name => $coord->{coordinates_authority}, category => $coord->{coordinates_source}, }; ######### # Some coordinates have a version # if ( my $version = $coord->{'coordinates_version'} ) { $coord_ob->{'version'} = $version; } ######### # Some coordinates have a species (taxonomy ID and name) # if ( my $taxid = $coord->{'coordinates_taxid'} ) { $coord_ob->{'NCBITaxId'} = $taxid; my $desc = $coord->{'coordinates'}; my ($species) = $desc =~ m/([^,]+)$/mxs; $coord_ob->{'organismName'} = $species; } ######### # Add the coordinate system # push @{ $object->{'coordinateSystem'} }, $coord_ob; } ######### # Add the actual source object # push @{ $self->{'_registry_sources'} }, $object; } return 1; } sub _filter_capability { my ($self, $src, $match) = @_; for my $scap (@{$src->{'capabilities'}}) { if($scap =~ $match) { return 1; } } return 0; }; sub _filter_category { my ($self, $src, $match) = @_; for my $scoord (@{$src->{'coordinateSystem'}}) { for my $m (@{$match}) { if ($m =~ m/,/mxs) { # regex REQUIRES "authority,type", and handles optional version (with proper underscore handling) and species my ($auth, $ver, $cat, $org) = $m =~ m/^ (.+?) (?:_([^_,]+))? ,([^,]+) (?:,(.+))? /mxs; if (lc $cat eq lc $scoord->{'category'} && $auth eq $scoord->{'name'} && (!$ver || lc $ver eq lc $scoord->{'version'}) && (!$org || lc $org eq lc $scoord->{'organismName'})) { return 1; } } else { return 1 if(lc $scoord->{'category'} eq lc $m); } } } return 0; } 1; __END__ =head1 NAME Bio::Das::Lite - Perl extension for the DAS (HTTP+XML) Protocol (http://biodas.org/) =head1 VERSION See $Bio::Das::Lite::VERSION =head1 SYNOPSIS use Bio::Das::Lite; my $bdl = Bio::Das::Lite->new_from_registry({'category' => 'GRCh_37,Chromosome,Homo sapiens'}); my $results = $bdl->features('22'); =head1 SUBROUTINES/METHODS =head2 new : Constructor my $das = Bio::Das::Lite->new('http://das.ensembl.org/das/ensembl1834'); my $das = Bio::Das::Lite->new({ 'timeout' => 60, 'dsn' => 'http://user:pass@das.ensembl.org/das/ensembl1834', 'http_proxy' => 'http://user:pass@webcache.local.com:3128/', }); Options can be: dsn (optional scalar or array ref, URLs of DAS services) timeout (optional int, HTTP fetch timeout in seconds) http_proxy (optional scalar, web cache or proxy if not set in %ENV) no_proxy (optional list/ref, non-proxiable domains if not set in %ENV) caching (optional bool, primitive caching on/off) callback (optional code ref, callback for processed XML blocks) registry (optional array ref containing DAS registry service URLs defaults to 'http://das.sanger.ac.uk/registry/services/das') proxy_user (optional scalar, username for authenticating forward-proxy) proxy_pass (optional scalar, password for authenticating forward-proxy) user_agent (optional scalar, User-Agent HTTP request header value) =head2 new_from_registry : Constructor Similar to 'new' above but supports 'capability' and 'category' in the given hashref, using them to query the DAS registry and configuring the DSNs accordingly. my $das = Bio::Das::Lite->new_from_registry({ 'capability' => ['features'], 'category' => ['Protein Sequence'], }); Options are as above, plus capability OR capabilities (optional arrayref of capabilities) category (optional arrayref of categories) For a complete list of capabilities and categories, see: http://das.sanger.ac.uk/registry/ The category can optionally be a full coordinate system name, allowing further restriction by authority, version and species. For example: 'Protein Sequence' OR 'UniProt,Protein Sequence' OR 'GRCh_37,Chromosome,Homo sapiens' =head2 http_proxy : Get/Set http_proxy $das->http_proxy('http://user:pass@squid.myco.com:3128/'); =head2 proxy_user : Get/Set proxy username for authenticating forward-proxies This is only required if the username wasn't specified when setting http_proxy $das->proxy_user('myusername'); =head2 proxy_pass : Get/Set proxy password for authenticating forward-proxies This is only required if the password wasn't specified when setting http_proxy $das->proxy_pass('secretpassword'); =head2 no_proxy : Get/Set domains to not use proxy for $das->no_proxy('ebi.ac.uk', 'localhost'); OR $das->no_proxy( ['ebi.ac.uk', 'localhost'] ); Always returns an arrayref =head2 user_agent : Get/Set user-agent for request headers $das->user_agent('GroovyDAS/1.0'); =head2 timeout : Get/Set timeout $das->timeout(30); =head2 caching : Get/Set caching $das->caching(1); =head2 callback : Get/Set callback code ref $das->callback(sub { }); =head2 basename : Get base URL(s) of service $das->basename(optional $dsn); =head2 dsn : Get/Set DSN $das->dsn('http://das.ensembl.org/das/ensembl1834/'); # give dsn (scalar or arrayref) here if not specified in new() Or, if you want to add to the existing dsn list and you're feeling sneaky... push @{$das->dsn}, 'http://my.server/das/additionalsource'; =head2 dsns : Retrieve information about other sources served from this server. Note this call is 'dsns', as differentiated from 'dsn' which is the current configured source my $src_data = $das->dsns(); =head2 entry_points : Retrieve the list of entry_points for this source e.g. chromosomes and associated information (e.g. sequence length and version) my $entry_points = $das->entry_points(); =head2 Types of argument for 'types', 'features', 'sequence' calls: Segment Id: '1' Segment Id with range: '1:1,1000' Segment Id with range and type: { 'segment' => '1:1,1000', 'type' => 'exon', } Multiple Ids with ranges and types: [ { 'segment' => '1:1,1000', 'type' => 'exon', }, { 'segment' => '2:1,1000', 'type' => 'exon', }, ] See DAS specifications for other parameters =head2 types : Find out about different data types available from this source my $types = $das->types(); # takes optional args - see DAS specs Retrieve the types of data available for this source e.g. 32k_cloneset, karyotype, swissprot =head2 features : Retrieve features from a segment e.g. clones on a chromosome ######### # Different ways to fetch features - # my $feature_data1 = $das->features('1:1,100000'); my $feature_data2 = $das->features(['1:1,100000', '2:20435000,21435000']); my $feature_data3 = $das->features({ 'segment' => '1:1,1000', 'type' => 'karyotype', # optional args - see DAS Spec }); my $feature_data4 = $das->features([ {'segment' => '1:1,1000000','type' => 'karyotype',}, {'segment' => '2:1,1000000',}, {'group_id' => 'OTTHUMG00000036084',}, ]); ######### # Feature fetch with callback # my $callback = sub { my $struct = shift; print {*STDERR} Dumper($struct); }; # then: $das->callback($callback); $das->features('1:1,1000000'); # or: $das->features('1:1,1000000', $callback); # or: $das->features(['1:1,1000000', '2:1,1000000', '3:1,1000000'], $callback); # or: $das->features([{'group_id' => 'OTTHUMG00000036084'}, '2:1,1000000', '3:1,1000000'], $callback); =head2 alignment : Retrieve protein alignment data for a query. This can be a multiple sequence alignment or pairwise alignment. Note - this has not been tested for structural alignments as there is currently no Das source avialable. my $alignment = $das->alignment({query => 'Q01234'}); =head2 structure : Retrieve known structure (i.e. PDB) for a query my $structure = $das->structure({ query => 'pdb_id'}); =head2 sources : Retrieves the list of sources form the DAS registry, via a DAS call. my $sources = $das->source; =head2 sequence : Retrieve sequence data for a segment (probably dna or protein) my $sequence = $das->sequence('2:1,1000'); # segment:start,stop (e.g. chromosome 2, bases 1 to 1000) =head2 stylesheet : Retrieve stylesheet data my $style_data = $das->stylesheet(); my $style_data2 = $das->stylesheet($callback); =head2 statuscodes : Retrieve HTTP status codes for request URLs my $code = $das->statuscodes($url); my $code_hashref = $das->statuscodes(); =head2 max_hosts set number of running concurrent host connections THIS METHOD IS NOW DEPRECATED AND HAS NO EFFECT $das->max_hosts(7); print $das->max_hosts(); =head2 max_req set number of running concurrent requests per host THIS METHOD IS NOW DEPRECATED AND HAS NO EFFECT $das->max_req(5); print $das->max_req(); =head2 registry : Get/Set accessor for DAS-Registry service URLs $biodaslite->registry('http://www.dasregistry.org/das'); my $registry_arrayref = $biodaslite->registry(); =head2 registry_sources : Arrayref of dassource objects from the configured registry services my $sources_ref = $biodaslite->registry_sources(); my $sources_ref = $biodaslite->registry_sources({ 'capability' => ['features','stylesheet'], }); my $sources_ref = $biodaslite->registry_sources({ 'category' => ['Protein Sequence'], }); =head2 build_queries Constructs an arrayref of DAS requests including parameters for each call =head2 build_requests Constructs the WWW::Curl callbacks =head2 postprocess Applies processing to the result set, e.g. removal of whitespace from sequence responses. =head1 DESCRIPTION This module is an implementation of a client for the DAS protocol (XML over HTTP primarily for biological-data). =head1 DEPENDENCIES =over =item strict =item warnings =item WWW::Curl =item HTTP::Response =item Carp =item English =item Readonly =back =head1 DIAGNOSTICS Set $Bio::Das::Lite::DEBUG = 1; =head1 CONFIGURATION AND ENVIRONMENT =head1 INCOMPATIBILITIES =head1 BUGS AND LIMITATIONS The max_req and max_hosts methods are now deprecated and have no effect. =head1 SEE ALSO DAS Specifications at: http://biodas.org/documents/spec.html ProServer (A DAS Server implementation also by the author) at: http://www.sanger.ac.uk/proserver/ The venerable Bio::Das suite (CPAN and http://www.biodas.org/download/Bio::Das/). The DAS Registry at: http://das.sanger.ac.uk/registry/ =head1 AUTHOR Roger Pettett, Erpettett@cpan.orgE =head1 LICENSE AND COPYRIGHT Copyright (C) 2007 GRL, by Roger Pettett This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available. =cut Bio-Das-Lite-2.04/t000755000765000024 011407221227 13073 5ustar00rmpstaff000000000000Bio-Das-Lite-2.04/t/00-critic.t000444000765000024 175111407221227 15113 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 00-critic.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/00-critic.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/00-critic.t $ # package critic; use strict; use warnings; use Test::More; use English qw(-no_match_vars); our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; if ( not $ENV{TEST_AUTHOR} ) { my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; plan( skip_all => $msg ); } eval { require Test::Perl::Critic; }; if($EVAL_ERROR) { plan skip_all => 'Test::Perl::Critic not installed'; } else { Test::Perl::Critic->import( -severity => 1, -exclude => [qw(tidy ValuesAndExpressions::RequireConstantVersion)], ); all_critic_ok(); } 1; Bio-Das-Lite-2.04/t/00-distribution.t000444000765000024 147711407221227 16362 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 00-distribution.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/00-distribution.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/00-distribution.t $ # package distribution; use strict; use warnings; use Test::More; use English qw(-no_match_vars); our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; eval { require Test::Distribution; }; if($EVAL_ERROR) { plan skip_all => 'Test::Distribution not installed'; } else { Test::Distribution->import('not' => 'prereq'); # Having issues with Test::Dist seeing my PREREQ_PM :( } 1; Bio-Das-Lite-2.04/t/00-pod.t000444000765000024 23411407221227 14373 0ustar00rmpstaff000000000000use strict; use warnings; use Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok(); Bio-Das-Lite-2.04/t/00-podcoverage.t000444000765000024 24211407221227 16106 0ustar00rmpstaff000000000000use Test::More; eval "use Test::Pod::Coverage 1.00"; plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if($@); all_pod_coverage_ok(); Bio-Das-Lite-2.04/t/01-general.t000444000765000024 330111407221227 15245 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 01-general.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/01-general.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/01-general.t $ # package general; use strict; use warnings; use Test::More tests => 7; use Bio::Das::Lite; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; { my $das = Bio::Das::Lite->new(); isa_ok($das, 'Bio::Das::Lite'); } { my $rnd = 1+int rand 60; is(Bio::Das::Lite->new({'timeout' => $rnd})->timeout(), $rnd, 'get/set timeout'); my $proxy = 'http://webcache.localnet:3128/'; is(Bio::Das::Lite->new({'http_proxy' => $proxy})->http_proxy(), $proxy, 'get/set http_proxy'); } { ######### # test single http fetch (on a non-DAS page!) # my $str = q(); my $urls = { 'http://www.google.com/' => sub { $str .= $_[0]; return; } }; my $das = Bio::Das::Lite->new(); $das->_fetch($urls); ok($str =~ m||smix, 'plain http fetch'); } { my $das = Bio::Das::Lite->new({ 'dsn' => 'http://das.sanger.ac.uk/das/spectral36', 'timeout' => 30, }); my $f_by_id = $das->features({'feature_id' => 'RP5-1119A7'}); ok(ref($f_by_id) eq 'HASH', 'feature-by-id returned a list'); my $key = (keys %{$f_by_id})[0]; ok(ref($f_by_id->{$key}) eq 'ARRAY' && scalar @{$f_by_id->{$key}} == 1, 'feature-by-id returned one element'); ok(ref($f_by_id->{$key}->[0]) eq 'HASH', 'feature-by-id element was a hash'); } 1; Bio-Das-Lite-2.04/t/02-statuscodes.t000444000765000024 234611407221227 16202 0ustar00rmpstaff000000000000######### # Author: Andy Jenkinson # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 02-statuscodes.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/02-statuscodes.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/02-statuscodes.t $ # use strict; use warnings; use Test::More tests => 6; use Bio::Das::Lite; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my @test = ( ['http://www.ebi.ac.uk/das-srv/genomicdas/das/batman_WB', 200, 'OK', 'HTTP OK, X-DAS OK'], ['http://www.ebi.ac.uk/das-srv/genomicdas/das/BioDasLite', 401, 'Bad data source (data source unknown)', 'HTTP OK, X-DAS-Status error'], ['http://doesnotexist.com/das/BioDasLite', 404, 'Not Found', 'HTTP error, no X-DAS-Status'], ); my $das = Bio::Das::Lite->new(); for (@test) { $das->dsn($_->[0]); my $tmp = $das->stylesheet; $tmp = (keys %$tmp)[0]; my $status = $das->statuscodes($tmp); is (substr($status, 0, 3), $_->[1], $_->[3].' (code)'); is (substr($status, 4), $_->[2], $_->[3].' (message)'); } Bio-Das-Lite-2.04/t/05-singledsn.t000444000765000024 342211407221227 15626 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-04-16 12:33:14 +0100 (Fri, 16 Apr 2010) $ $Author: andyjenkinson $ # Id: $Id: 05-singledsn.t 33 2010-04-16 11:33:14Z andyjenkinson $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/05-singledsn.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/05-singledsn.t $ # package singledsn; use strict; use warnings; use Test::More tests => 30; use Bio::Das::Lite; our $VERSION = do { my @r = (q$Revision: 33 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; $Bio::Das::Lite::DEBUG = 0; for my $service ('http://das.sanger.ac.uk/das', 'http://das.ensembl.org/das/dsn', 'http://das.ensembl.org/das/dsn#foo') { ######### # test single dsn from constructor # my $das = Bio::Das::Lite->new({'dsn' => $service, 'timeout' => 10}); ok(defined $das, 'new with a single dsn returned something'); ok(ref($das->dsn()) eq 'ARRAY', 'single service get gave an array ref'); ok(scalar (@{$das->dsn()}) == 1, 'single service get had length of one'); ok($das->dsn->[0] eq $service, 'single service get returned the same dsn'); my $dsns = $das->dsns(); ok(defined $dsns, 'dsns call returned something'); ok(ref($dsns) eq 'HASH', 'dsns call gave a hash'); my @keys = keys %{$dsns}; ok(scalar @keys == 1, 'dsns call gave one key'); my $key = $keys[0]; ok(ref($dsns->{$key}) eq 'ARRAY', 'dsns call gave a arrayref value for the one key'); my @sources = @{$dsns->{$key}}; ok(scalar @sources > 0, 'dsns call returned at least one source'); my @broken = grep { ref($_) ne 'HASH' } @sources; ok(scalar @broken == 0, 'all sources parsed correctly into hashes'); } 1; Bio-Das-Lite-2.04/t/06-singledsn-singleseg.t000444000765000024 302711407221227 17606 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 06-singledsn-singleseg.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/06-singledsn-singleseg.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/06-singledsn-singleseg.t $ # package singledsn_singleseg; use Test::More tests => 13; use strict; use warnings; use t::FileStub; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $req = '10:1,1000'; my $das; for my $call (qw(entry_points types features sequence)) { $das = t::FileStub->new({ 'dsn' => 'foo', 'filedata' => "t/${call}-ensembl1834.xml", }); my $res = $das->$call($req); ok(ref$res eq 'HASH', "$call returns a hash"); ok(scalar keys %{$res} == 1, "$call returns the same number of sources"); ok(ref((values %{$res})[0]) eq 'ARRAY', "$call hash contains an array"); ######### # check return codes # my $codes = $das->statuscodes(); my $code = 0; for my $u (keys %{$codes}) { if($u =~ /$call.*10:1,1000/mx) { $code = substr $codes->{$u}, 0, 3; last; } } } my $sequence = $das->sequence('1:1,1000'); my $key = (keys %{$sequence})[0]; my $seq = $sequence->{$key}->[0]->{'sequence'} || q(); $seq =~ s/\s+//smgx; is(length $seq, 1000, 'requesting 1Kb of sequence returns 1Kb'); 1; Bio-Das-Lite-2.04/t/07-singledsn-multiseg.t000444000765000024 307611407221227 17464 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 07-singledsn-multiseg.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/07-singledsn-multiseg.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/07-singledsn-multiseg.t $ # package singledsn_multiseg; use strict; use warnings; use Test::More tests => 10; use Bio::Das::Lite; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $src = [qw(http://www.ensembl.org/das/Homo_sapiens.NCBI36.reference)]; my $das = Bio::Das::Lite->new({ 'dsn' => $src, 'timeout' => 30, }); my $req = ['1:1,1000', '15:1,1000']; for my $call (qw(features sequence)) { my $res = $das->$call($req); is(ref($res), 'HASH', "$call returns a hash"); is(scalar keys %{$res}, (@{$src}*@{$req}), "$call returns data to the tune of (number of sources * number of segments)"); is(ref((values %{$res})[0]), 'ARRAY', "$call hash contains an array"); my $codes = $das->statuscodes(); for my $k (keys %{$res}) { my $code = (substr $codes->{$k}, 0, 3)||q(); if($code == 500) { diag("$call call failed due to server error"); pass('not failing on server error'); } elsif($code == 200) { ok(scalar @{$res->{$k}} > 0, "$call returns some data"); } else { fail("Unexpected response code: $code for $k"); } } } 1; Bio-Das-Lite-2.04/t/10-multidsn.t000444000765000024 324111407221227 15472 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-04-16 12:19:36 +0100 (Fri, 16 Apr 2010) $ $Author: andyjenkinson $ # Id: $Id: 10-multidsn.t 28 2010-04-16 11:19:36Z andyjenkinson $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/10-multidsn.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/10-multidsn.t $ # package multidsn; use strict; use warnings; use Test::More tests => 10; use Bio::Das::Lite; our $VERSION = do { my @r = (q$Revision: 28 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my @services = qw(http://das.ensembl.org/das/dsn http://das.sanger.ac.uk); my $das = Bio::Das::Lite->new({'dsn' => \@services, 'timeout' => 10}); ok(defined $das, 'new with a multi dsn returned something'); ok(ref($das->dsn()) eq 'ARRAY', 'multi service get gave an array ref'); ok(scalar (@{$das->dsn()}) == 2, 'multi service get had length of one'); ok($das->dsn->[0] eq $services[0] && $das->dsn->[1] eq $services[1], 'multi service get returned the same dsns in the same order'); my $dsns = $das->dsns(); ok(defined $dsns, 'dsns call returned something'); ok(ref $dsns eq 'HASH', 'dsns call gave a hash'); my @keys = keys %{$dsns}; ok(scalar @keys == 1, 'dsns call gave one key'); my $key = $keys[0]; ok(ref $dsns->{$key} eq 'ARRAY', 'dsns call gave a arrayref value for the one key'); my @sources = @{$dsns->{$key}}; ok(scalar @sources > 0, 'dsns call returned at least one source'); my @broken = grep { ref $_ ne 'HASH' } @sources; ok(scalar @broken == 0, 'all sources parsed correctly into hashes'); 1; Bio-Das-Lite-2.04/t/20-authentication.t000444000765000024 164511407221227 16661 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 20-authentication.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/20-authentication.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/20-authentication.t $ # package compat_multidsn; use strict; use warnings; use Test::More tests => 3; use Bio::Das::Lite; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $das = Bio::Das::Lite->new({ 'http_proxy' => 'https://foo:bar@webcache.example.com:3128/', }); is($das->http_proxy(), 'https://webcache.example.com:3128/', 'http_proxy processed ok'); is($das->proxy_user(), 'foo', 'proxy_user processed ok'); is($das->proxy_pass(), 'bar', 'proxy_pass processed ok'); 1; Bio-Das-Lite-2.04/t/21-proxy.t000444000765000024 1237511407221227 15046 0ustar00rmpstaff000000000000use strict; use warnings; use Bio::Das::Lite; use Test::More; use English qw(-no_match_vars); BEGIN { eval { require POE; require WWW::Curl::Simple; POE->import(qw(Component::Server::TCP Filter::HTTPD)); require HTTP::Response; }; if ($EVAL_ERROR) { plan skip_all => 'Proxy testing requires POE and WWW::Curl::Simple'; } else { plan tests => 11; } } my ($child_pid, $port) = &setup_server; if ($child_pid && $port) { pass("run test proxy server"); my $dsn = 'http://www.ensembl.org/das/Homo_sapiens.GRCh37.reference'; $ENV{http_proxy} = undef if $ENV{http_proxy}; my $dl = Bio::Das::Lite->new($dsn); $dl->features('1:1,2'); my $status = $dl->statuscodes("$dsn/features?segment=1:1,2"); unlike($status, qr/PROXY/smx, 'direct connection'); SKIP: { if (! defined $Bio::Das::Lite::{CURLOPT_NOPROXY} ) { skip 'proxy support DISABLED as unsupported by your version of libcurl', 9; } $dl = Bio::Das::Lite->new({dsn => $dsn, http_proxy => "http://127.0.0.1:$port"}); $dl->features('1:1,2'); $status = $dl->statuscodes("$dsn/features?segment=1:1,2"); is($status, '200 (OK) PROXY', 'basic proxy (constructor)'); $dl = Bio::Das::Lite->new($dsn); $dl->http_proxy("http://127.0.0.1:$port"); $dl->features('1:1,2'); $status = $dl->statuscodes("$dsn/features?segment=1:1,2"); is($status, '200 (OK) PROXY', 'basic proxy (method)'); if (! defined $Bio::Das::Lite::{CURLOPT_PROXYUSERNAME} || !defined $Bio::Das::Lite::{CURLOPT_PROXYPASSWORD} ) { skip 'authenticating proxy support DISABLED as unsupported by your version of libcurl', 1; } $dl = Bio::Das::Lite->new($dsn); $dl->http_proxy("http://user:pass\@127.0.0.1:$port"); $dl->features('1:1,2'); $status = $dl->statuscodes("$dsn/features?segment=1:1,2"); is($status, '200 (OK) PROXY user:pass', 'authenticated proxy (method)'); $ENV{http_proxy} = "http://127.0.0.1:$port"; $dl = Bio::Das::Lite->new($dsn); $dl->features('1:1,2'); $status = $dl->statuscodes("$dsn/features?segment=1:1,2"); is($status, '200 (OK) PROXY', 'basic proxy (environment)'); if (! defined $Bio::Das::Lite::{CURLOPT_NOPROXY} ) { skip 'no_proxy support DISABLED as unsupported by your version of libcurl', 5; } $dl = Bio::Das::Lite->new({dsn=>$dsn,no_proxy=>'ensembl.org'}); $dl->features('1:1,2'); $status = $dl->statuscodes("$dsn/features?segment=1:1,2"); unlike($status, qr/PROXY/smx, 'no-proxy (constructor) positive match'); $dl = Bio::Das::Lite->new($dsn); $dl->no_proxy('ensembl.org', 'another.com'); $dl->features('1:1,2'); $status = $dl->statuscodes("$dsn/features?segment=1:1,2"); unlike($status, qr/PROXY/smx, 'no-proxy (method list) positive match'); $dl = Bio::Das::Lite->new($dsn); $dl->no_proxy('wibble.com', 'another.com'); $dl->features('1:1,2'); $status = $dl->statuscodes("$dsn/features?segment=1:1,2"); is($status, '200 (OK) PROXY', 'no-proxy (method list) negative match'); $dl = Bio::Das::Lite->new($dsn); $dl->no_proxy(['ensembl.org', 'another.com']); $dl->features('1:1,2'); $status = $dl->statuscodes("$dsn/features?segment=1:1,2"); unlike($status, qr/PROXY/smx, 'no-proxy (method listref) positive match'); $ENV{no_proxy} = 'ensembl.org, another.com'; $dl = Bio::Das::Lite->new($dsn); $dl->features('1:1,2'); $status = $dl->statuscodes("$dsn/features?segment=1:1,2"); unlike($status, qr/PROXY/smx, 'no-proxy (environment) positive match'); }; } else { fail("run test proxy server"); } kill_child(); sub kill_child { $child_pid && kill 9, $child_pid; } $SIG{INT} = \&kill_child; sub setup_server { # Set up a server and check it is listening. my $port; my $child_pid; my $agent = WWW::Curl::Simple->new(timeout=>1); for my $test_port (10000 .. 10010) { $child_pid = fork_server($test_port); my $resp; eval { $resp = $agent->get("http://127.0.0.1:$test_port"); }; if ($@) { warn "Error from test server on port $test_port - ".$@; } elsif (!$resp) { warn "No response from test server on port $test_port"; } elsif ($resp->status_line() =~ m/^200 \(OK\) PROXY/) { $port = $test_port; last; } else { warn "Unexpected status from test server on port $test_port - ".$resp->status_line; } kill 9, $child_pid; wait; undef $child_pid; } return ($child_pid, $port); } sub fork_server { if (my $child_pid = fork) { return $child_pid; } my $listen_port = shift; eval { # Child process runs a server # (similar to http://poe.perl.org/?POE_Cookbook/Web_Server) POE::Component::Server::TCP->new( Port => $listen_port, ClientFilter => 'POE::Filter::HTTPD', ClientInput => sub { my ($kernel, $heap, $req_or_resp) = @_[KERNEL, HEAP, ARG0]; # Errors appear as HTTP::Response objects (via filter) if ($req_or_resp->isa(q[HTTP::Request])) { my $auth = $req_or_resp->proxy_authorization_basic; $req_or_resp = HTTP::Response->new(200, $auth ? 'PROXY ' . $auth : 'PROXY'); # OK $req_or_resp->content('FAKE CONTENT'); } $heap->{client}->put($req_or_resp); $kernel->yield(q[shutdown]); } ); $poe_kernel->run(); }; } Bio-Das-Lite-2.04/t/40-dna.t000444000765000024 371311407221227 14404 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 40-dna.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/40-dna.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/40-dna.t $ # package dna; use strict; use warnings; use Test::More tests => 1; use t::FileStub; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $das = t::FileStub->new({ 'dsn' => 'foo', 'filedata' => 't/dna.xml', }); my $result = $das->dna(); my $expected = { 'foo/dna' => [ { 'sequence_stop' => '2436345', 'sequence_start' => '2435345', 'dna' => 'atttcttggcgtaaataagagtctcaatgagactctcagaagaaaattgataaatattattaatgatataataataatcttgttgatccgttctatctccagacgattttcctagtctccagtcgattttgcgctgaaaatgggatatttaatggaattgtttttgtttttattaataaataggaataaatttacgaaaatcacaaaattttcaataaaaaacaccaaaaaaaagagaaaaaatgagaaaaatcgacgaaaatcggtataaaatcaaataaaaatagaaggaaaatattcagctcgtaaacccacacgtgcggcacggtttcgtgggcggggcgtctctgccgggaaaattttgcgtttaaaaactcacatataggcatccaatggattttcggattttaaaaattaatataaaatcagggaaatttttttaaattttttcacatcgatattcggtatcaggggcaaaattagagtcagaaacatatatttccccacaaactctactccccctttaaacaaagcaaagagcgatactcattgcctgtagcctctatattatgccttatgggaatgcatttgattgtttccgcatattgtttacaaccatttatacaacatgtgacgtagacgcactgggcggttgtaaaacctgacagaaagaattggtcccgtcatctactttctgattttttggaaaatatgtacaatgtcgtccagtattctattccttctcggcgatttggccaagttattcaaacacgtataaataaaaatcaataaagctaggaaaatattttcagccatcacaaagtttcgtcagccttgttatgtcaaccactttttatacaaattatataaccagaaatactattaaataagtatttgtatgaaacaatgaacactattataacattttcagaaaatgtagtatttaagcgaaggtagtgcacatcaaggccgtcaaacggaaaaatttttgcaagaatca', 'sequence_version' => '2.45', 'sequence_id' => 'XYZ123', 'dna_length' => '1000' } ] }; is_deeply($result, $expected, 'is_deeply'); 1; Bio-Das-Lite-2.04/t/45-sequence.t000444000765000024 401411407221227 15452 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 45-sequence.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/45-sequence.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/45-sequence.t $ # package sequence; use strict; use warnings; use Test::More tests => 1; use t::FileStub; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $das = t::FileStub->new({ 'dsn' => 'foo', 'filedata' => 't/sequence.xml', }); my $result = $das->sequence(); my $expected = { 'foo/sequence' => [ { 'sequence_stop' => '2436345', 'sequence_start' => '2435345', 'sequence' => 'atttcttggcgtaaataagagtctcaatgagactctcagaagaaaattgataaatattattaatgatataataataatcttgttgatccgttctatctccagacgattttcctagtctccagtcgattttgcgctgaaaatgggatatttaatggaattgtttttgtttttattaataaataggaataaatttacgaaaatcacaaaattttcaataaaaaacaccaaaaaaaagagaaaaaatgagaaaaatcgacgaaaatcggtataaaatcaaataaaaatagaaggaaaatattcagctcgtaaacccacacgtgcggcacggtttcgtgggcggggcgtctctgccgggaaaattttgcgtttaaaaactcacatataggcatccaatggattttcggattttaaaaattaatataaaatcagggaaatttttttaaattttttcacatcgatattcggtatcaggggcaaaattagagtcagaaacatatatttccccacaaactctactccccctttaaacaaagcaaagagcgatactcattgcctgtagcctctatattatgccttatgggaatgcatttgattgtttccgcatattgtttacaaccatttatacaacatgtgacgtagacgcactgggcggttgtaaaacctgacagaaagaattggtcccgtcatctactttctgattttttggaaaatatgtacaatgtcgtccagtattctattccttctcggcgatttggccaagttattcaaacacgtataaataaaaatcaataaagctaggaaaatattttcagccatcacaaagtttcgtcagccttgttatgtcaaccactttttatacaaattatataaccagaaatactattaaataagtatttgtatgaaacaatgaacactattataacattttcagaaaatgtagtatttaagcgaaggtagtgcacatcaaggccgtcaaacggaaaaatttttgcaagaatca', 'sequence_version' => '2.45', 'sequence_moltype' => 'DNA', 'sequence_id' => 'id' } ] }; is_deeply($result, $expected, 'is_deeply'); 1; Bio-Das-Lite-2.04/t/50-entry_points.t000444000765000024 154111407221227 16375 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 50-entry_points.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/50-entry_points.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/50-entry_points.t $ # package entry_points; use strict; use warnings; use Test::More tests => 1; use t::FileStub; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $das = t::FileStub->new({ 'dsn' => 'foo', 'filedata' => 't/entry_points.xml', }); my $ep = $das->entry_points(); my $results = (values %{$ep})[0]; is(scalar @{$results->[0]->{'segment'}}, 22, 'Correct number of segments returned'); 1; Bio-Das-Lite-2.04/t/60-features.t000444000765000024 152711407221227 15463 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 60-features.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/60-features.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/60-features.t $ # package features; use strict; use warnings; use Test::More tests => 1; use t::FileStub; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $das = t::FileStub->new({ 'dsn' => 'foo', 'filedata' => 't/features.xml', }); my $features = $das->features(); my $results = (values %{$features})[0]; is(scalar @{$results}, 102, 'Whole-response-mode gave correct number of features returned'); 1; Bio-Das-Lite-2.04/t/60-features_chunked.t000444000765000024 162511407221227 17163 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 60-features_chunked.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/60-features_chunked.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/60-features_chunked.t $ # package features_chunked; use strict; use warnings; use Test::More tests => 1; use t::FileStubChunked; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $das = t::FileStubChunked->new({ 'dsn' => 'http://foo/das/bar', 'filedata' => 't/features.xml', }); my $features = $das->features(); my $results = (values %{$features})[0]; is(scalar @{$results}, 102, 'Chunked-response-mode gave number of features returned'); 1; Bio-Das-Lite-2.04/t/60-features_empty.t000444000765000024 222211407221227 16672 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 60-features_empty.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/60-features_empty.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/60-features_empty.t $ # package features_empty; use strict; use warnings; use Test::More tests => 5; use t::FileStub; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $das = t::FileStub->new({ 'dsn' => 'http://foo/das/bar', 'filedata' => 't/features-empty.xml', }); my $features = $das->features(); my $results = (values %{$features})[0]; is(ref($results), 'HASH', 'Empty segment gives a hash with seginfo rather than an empty array of features'); is($results->{'segment_id'}, 10, 'segment_id'); is($results->{'segment_version'}, 18, 'segment_version'); is($results->{'segment_start'}, 1, 'segment_start'); is($results->{'segment_stop'}, 1000, 'segment_stop'); 1; Bio-Das-Lite-2.04/t/61-features_group.t000444000765000024 255011407221227 16675 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 61-features_group.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/61-features_group.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/61-features_group.t $ # package features_group; use strict; use warnings; use Test::More tests => 5; use t::FileStub; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $das = t::FileStub->new({ 'dsn' => 'foo', 'filedata' => 't/features-group.xml', }); my $features = $das->features(); my $results = (values %{$features})[0]; my $first_feature_group_data = $results->[0]->{'group'}->[0]; is(scalar @{$first_feature_group_data->{'link'}}, 2, 'Corrent number of links returned'); is(scalar @{$first_feature_group_data->{'note'}}, 2, 'Corrent number of notes returned'); is($first_feature_group_data->{'link'}->[1]->{'href'}, 'groupurl2', 'Correct link href'); is($first_feature_group_data->{'link'}->[1]->{'txt'}, ' group link text 2', 'Correct link text'); is($first_feature_group_data->{'note'}->[1], ' group note 2 text ', 'Correct note text'); 1; Bio-Das-Lite-2.04/t/70-alignment.t000444000765000024 231311407221227 15616 0ustar00rmpstaff000000000000######### # Author: rdf # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 70-alignment.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/70-alignment.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/70-alignment.t $ # package alignment; use strict; use warnings; use Test::More tests => 4; use t::FileStub; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $das = t::FileStub->new({ 'dsn' => 'foo', 'filedata' => 't/alignment.xml', }); my $alignment = $das->alignment(); my $results = (values %{$alignment})[0]; #Some simple test to see if the response is being parsed corretly. These are not complete. is(scalar @{$results}, 1, 'Whole-response-mode gave correct number of features returned'); is(scalar @{$results->[0]->{alignobject}}, 2, 'Got expected number of alignment objects'); is(scalar @{$results->[0]->{block}}, 1, 'Got expected number of alignment blocks'); is(scalar $results->[0]->{block}->[0]->{segment}->[0]->{cigar}, '515M', 'Got cigar string'); 1; Bio-Das-Lite-2.04/t/80-structure.t000444000765000024 320011407221227 15675 0ustar00rmpstaff000000000000######### # Author: rdf # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 80-structure.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/80-structure.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/80-structure.t $ # package structure; use strict; use warnings; use Test::More tests => 9; use t::FileStub; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $das = t::FileStub->new({ 'dsn' => 'foo', 'filedata' => 't/structure.xml', }); my $structure = $das->structure(); my $results = (values %{$structure})[0]; #Total is(scalar @{$results}, 1, 'Whole-response-mode gave correct structure'); #Chains is(scalar @{$results->[0]->{chain}}, 1, 'Got the correct number of chains'); is(scalar @{$results->[0]->{chain}->[0]->{group}}, 3, 'Got the correct number of groups for the chain'); is(scalar @{$results->[0]->{chain}->[0]->{group}->[0]->{atom}}, 26,'Got the correct number of atoms for the first group'); #Het Stuff is(scalar @{$results->[0]->{het}}, 1, 'Got the correct number of het'); is(scalar @{$results->[0]->{het}->[0]->{group}}, 1, 'Got the correct number of groups for the het'); is(scalar @{$results->[0]->{het}->[0]->{group}->[0]->{atom}}, 1,'Got the correct number of atoms for the first group'); #Connection Stuff is(scalar @{$results->[0]->{connect}}, 1, 'Got connection data'); is(scalar @{$results->[0]->{connect}->[0]->{atomID}}, 2, 'Got correct number of atoms in connection'); 1; Bio-Das-Lite-2.04/t/90-sources.t000444000765000024 175311407221227 15334 0ustar00rmpstaff000000000000######### # Author: rdf # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: 90-sources.t 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/90-sources.t,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/90-sources.t $ # package sources; use strict; use warnings; use Test::More tests => 2; use English qw(-no_match_vars); use t::FileStub; our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; my $das = t::FileStub->new({ 'dsn' => 'foo', 'filedata' => 't/source.xml', }); my $features = $das->sources(); my $results = (values %{$features})[0]; is(scalar @{$results}, 1, q(Whole-response-mode gave correct number of sources returned)); is($results->[0]->{source}->[0]->{maintainer}->[0]->{maintainer_email}, 'dasmaster@example.com', q(Got maintainers email)); 1; Bio-Das-Lite-2.04/t/FileStub.pm000444000765000024 201311407221227 15277 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: FileStub.pm 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/FileStub.pm,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/FileStub.pm $ # package t::FileStub; use base qw(Bio::Das::Lite); use strict; use warnings; use English qw(-no_match_vars); our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; sub new { my ($class, $ref) = @_; $ref ||= {}; my $self = $class->SUPER::new($ref); $self->{'filedata'} = $ref->{'filedata'}; return $self; } sub _fetch { my ($self, $url_ref, $headers) = @_; open my $fh, q(<), $self->{'filedata'} or die "Cannot open $self->{'filedata'}:[$ERRNO]\n"; local $RS = undef; my $xml = <$fh>; close $fh; for my $code_ref (values %{$url_ref}) { &{$code_ref}($xml); } return; } 1; Bio-Das-Lite-2.04/t/FileStubChunked.pm000444000765000024 146011407221227 16606 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: FileStubChunked.pm 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/FileStubChunked.pm,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/FileStubChunked.pm $ # package t::FileStubChunked; use strict; use warnings; use base qw(t::FileStub); our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; sub _fetch { my ($self, $url_ref, $headers) = @_; open my $fh, q(<), $self->{'filedata'}; while(my $xml = <$fh>) { for my $code_ref (values %{$url_ref}) { &{$code_ref}($xml); } } close $fh; return; } 1; Bio-Das-Lite-2.04/t/FileStubCompat.pm000444000765000024 204111407221227 16444 0ustar00rmpstaff000000000000######### # Author: rmp # Last Modified: $Date: 2010-03-24 19:29:46 +0000 (Wed, 24 Mar 2010) $ $Author: zerojinx $ # Id: $Id: FileStubCompat.pm 19 2010-03-24 19:29:46Z zerojinx $ # Source: $Source: /var/lib/cvsd/cvsroot/Bio-DasLite/Bio-DasLite/t/FileStubCompat.pm,v $ # $HeadURL: https://zerojinx@bio-das-lite.svn.sourceforge.net/svnroot/bio-das-lite/trunk/t/FileStubCompat.pm $ # package t::FileStubCompat; use base qw(Bio::DasLite); use strict; use warnings; use English qw(-no_match_vars); our $VERSION = do { my @r = (q$Revision: 19 $ =~ /\d+/mxg); sprintf '%d.'.'%03d' x $#r, @r }; sub new { my ($class, $ref) = @_; $ref ||= {}; my $self = $class->SUPER::new($ref); $self->{'filedata'} = $ref->{'filedata'}; return $self; } sub _fetch { my ($self, $url_ref, $headers) = @_; open my $fh, q(<), $self->{'filedata'} or die "Cannot open $self->{'filedata'}:[$ERRNO]\n"; local $RS = undef; my $xml = <$fh>; close $fh; for my $code_ref (values %{$url_ref}) { &{$code_ref}($xml); } return; } 1; Bio-Das-Lite-2.04/t/alignment.xml000444000765000024 271211407221227 15732 0ustar00rmpstaff000000000000 0-515 GENCODE reference protein "AP000295.6-002" from GENCODE Dataset v2.2 (Oct 2005) 0-515 515M Bio-Das-Lite-2.04/t/dna.xml000444000765000024 252011407221227 14513 0ustar00rmpstaff000000000000 atttcttggcgtaaataagagtctcaatgagactctcagaagaaaattgataaatattat taatgatataataataatcttgttgatccgttctatctccagacgattttcctagtctcc agtcgattttgcgctgaaaatgggatatttaatggaattgtttttgtttttattaataaa taggaataaatttacgaaaatcacaaaattttcaataaaaaacaccaaaaaaaagagaaa aaatgagaaaaatcgacgaaaatcggtataaaatcaaataaaaatagaaggaaaatattc agctcgtaaacccacacgtgcggcacggtttcgtgggcggggcgtctctgccgggaaaat tttgcgtttaaaaactcacatataggcatccaatggattttcggattttaaaaattaata taaaatcagggaaatttttttaaattttttcacatcgatattcggtatcaggggcaaaat tagagtcagaaacatatatttccccacaaactctactccccctttaaacaaagcaaagag cgatactcattgcctgtagcctctatattatgccttatgggaatgcatttgattgtttcc gcatattgtttacaaccatttatacaacatgtgacgtagacgcactgggcggttgtaaaa cctgacagaaagaattggtcccgtcatctactttctgattttttggaaaatatgtacaat gtcgtccagtattctattccttctcggcgatttggccaagttattcaaacacgtataaat aaaaatcaataaagctaggaaaatattttcagccatcacaaagtttcgtcagccttgtta tgtcaaccactttttatacaaattatataaccagaaatactattaaataagtatttgtat gaaacaatgaacactattataacattttcagaaaatgtagtatttaagcgaaggtagtgc acatcaaggccgtcaaacggaaaaatttttgcaagaatca Bio-Das-Lite-2.04/t/entry_points-ensembl1834.xml000444000765000024 306611407221227 20457 0ustar00rmpstaff000000000000 Bio-Das-Lite-2.04/t/entry_points.xml000444000765000024 263211407221227 16512 0ustar00rmpstaff000000000000 Bio-Das-Lite-2.04/t/features-empty.xml000444000765000024 43311407221227 16704 0ustar00rmpstaff000000000000 Bio-Das-Lite-2.04/t/features-ensembl1834.xml000444000765000024 107611407221227 17537 0ustar00rmpstaff000000000000 karyotype ensembl 0 3000000 - 0 - Bio-Das-Lite-2.04/t/features-group.xml000444000765000024 206111407221227 16721 0ustar00rmpstaff000000000000 type label method label start end [X.XX|-] [0|-|+] [0|1|2|-] note text link text target name group note 1 text group link text 1 group note 2 text group link text 2 target name Bio-Das-Lite-2.04/t/features.xml000444000765000024 13120311407221227 15630 0ustar00rmpstaff000000000000 description description 0 0 - 0 - Sulfotransferase 1A1 (EC 2.8.2.1) (Aryl sulfotransferase 1) (Phenol sulfotransferase 1) (Phenol-sulfating phenol sulfotransferase 1) (P-PST 1) (Thermostable phenol sulfotransferase) (Ts-PST) (HAST1/HAST2) (ST1A3). http://www.ebi.uniprot.org/uniprot-srv/uniProtView.do?proteinAc=P50225 CHAIN UniProt 1 295 - 0 - Sulfotransferase 1A1/FTId=PRO_0000085127 STRAND UniProt 13 15 - 0 - TURN UniProt 16 17 - 0 - STRAND UniProt 18 20 - 0 - HELIX UniProt 22 31 - 0 - TURN UniProt 32 33 - 0 - VARIANT UniProt 37 37 - 0 - R -> Q/FTId=VAR_009302 http://ca.expasy.org/cgi-bin/get-sprot-variant.pl?VAR_009302 TURN UniProt 38 39 - 0 - STRAND UniProt 41 46 - 0 - TURN UniProt 47 48 - 0 - NP_BIND UniProt 48 53 - 0 - PAPS STRAND UniProt 49 50 - 0 - HELIX UniProt 51 62 - 0 - TURN UniProt 63 65 - 0 - HELIX UniProt 67 70 - 0 - MUTAGEN UniProt 70 70 - 0 - C -> S Increased sensitivity of enzyme activity to heat inactivation TURN UniProt 71 72 - 0 - STRAND UniProt 73 73 - 0 - HELIX UniProt 75 78 - 0 - STRAND UniProt 79 79 - 0 - STRAND UniProt 81 81 - 0 - TURN UniProt 82 83 - 0 - STRAND UniProt 86 86 - 0 - TURN UniProt 87 88 - 0 - STRAND UniProt 89 89 - 0 - CONFLICT UniProt 90 90 - 0 - P -> L (in Ref. 3) HELIX UniProt 92 97 - 0 - TURN UniProt 98 98 - 0 - STRAND UniProt 101 102 - 0 - STRAND UniProt 104 107 - 0 - ACT_SITE UniProt 108 108 - 0 - Proton acceptor TURN UniProt 111 113 - 0 - STRAND UniProt 114 114 - 0 - HELIX UniProt 116 120 - 0 - TURN UniProt 121 122 - 0 - STRAND UniProt 124 129 - 0 - NP_BIND UniProt 130 138 - 0 - PAPS HELIX UniProt 132 145 - 0 - STRAND UniProt 146 146 - 0 - TURN UniProt 147 148 - 0 - STRAND UniProt 149 149 - 0 - HELIX UniProt 155 164 - 0 - TURN UniProt 165 165 - 0 - STRAND UniProt 167 167 - 0 - TURN UniProt 168 169 - 0 - HELIX UniProt 172 182 - 0 - CONFLICT UniProt 181 181 - 0 - E -> G (in Ref. 5) TURN UniProt 183 185 - 0 - STRAND UniProt 186 186 - 0 - STRAND UniProt 188 192 - 0 - NP_BIND UniProt 193 229 - 0 - PAPS HELIX UniProt 193 198 - 0 - HELIX UniProt 200 211 - 0 - TURN UniProt 212 212 - 0 - VARIANT UniProt 213 213 - 0 - R -> H (in allele SULT1A1*2; common polymorphism; has a lower activity; dbSNP:1042028)/FTId=VAR_007425 http://ca.expasy.org/cgi-bin/get-sprot-variant.pl?VAR_007425 HELIX UniProt 217 226 - 0 - VARIANT UniProt 223 223 - 0 - M -> V (in dbSNP:1801030)/FTId=VAR_009303 http://ca.expasy.org/cgi-bin/get-sprot-variant.pl?VAR_009303 TURN UniProt 227 227 - 0 - STRAND UniProt 228 228 - 0 - HELIX UniProt 229 234 - 0 - VARIANT UniProt 235 235 - 0 - N -> T (in dbSNP:1059491)/FTId=VAR_014889 http://ca.expasy.org/cgi-bin/get-sprot-variant.pl?VAR_014889 TURN UniProt 236 238 - 0 - STRAND UniProt 239 239 - 0 - TURN UniProt 241 242 - 0 - STRAND UniProt 243 243 - 0 - TURN UniProt 245 247 - 0 - STRAND UniProt 248 248 - 0 - TURN UniProt 250 252 - 0 - STRAND UniProt 255 256 - 0 - NP_BIND UniProt 257 259 - 0 - PAPS STRAND UniProt 261 262 - 0 - HELIX UniProt 263 266 - 0 - TURN UniProt 267 267 - 0 - STRAND UniProt 268 268 - 0 - HELIX UniProt 270 283 - 0 - CONFLICT UniProt 282 282 - 0 - E -> K (in Ref. 4 and 8) TURN UniProt 284 286 - 0 - CONFLICT UniProt 290 290 - 0 - S -> T (in Ref. 4 and 8) STRAND UniProt 293 293 - 0 - ProDom ProDom 6 181 - 0 - Description: Sulfotransferase Status: True Positive http://prodes.toulouse.inra.fr/prodom/current/cgi-bin/request.pl?question=DBEN&query=PD001218 Pfam Pfam 38 288 - 0 - Description: Sulfotransfer_1 Status: True Positive http://www.sanger.ac.uk/cgi-bin/Pfam/getacc?PF00685 reference reference 0 0 - 0 - Zhu X., Veronese M.E., Sansom L.N., McManus M.E. (1993). "Molecular characterisation of a human aryl sulfotransferase cDNA.", Biochem. Biophys. Res. Commun. 192:671-676 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=8484775 reference reference 0 0 - 0 - Zhu X., Veronese M.E., Bernard C.C., Sansom L.N., McManus M.E. (1993). "Identification of two human brain aryl sulfotransferase cDNAs.", Biochem. Biophys. Res. Commun. 195:120-127 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=8363592 reference reference 0 0 - 0 - Hwang S.-R., Kohn A.B., Hook V.Y.H. (1995). "Molecular cloning of an isoform of phenol sulfotransferase from human brain hippocampus.", Biochem. Biophys. Res. Commun. 207:701-707 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=7864863 reference reference 0 0 - 0 - Wilborn T.W., Comer K.A., Dooley T.P., Reardon I.M., Heinrikson R.L., Falany C.N. (1993). "Sequence analysis and expression of the cDNA for the phenol-sulfating form of human liver phenol sulfotransferase.", Mol. Pharmacol. 43:70-77 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=8423770 reference reference 0 0 - 0 - Jones A.L., Hagen M., Coughtrie M.W.H., Roberts R.C., Glatt H. (1995). "Human platelet phenolsulfotransferases: cDNA cloning, stable expression in V79 cells and identification of a novel allelic variant of the phenol-sulfating form.", Biochem. Biophys. Res. Commun. 208:855-862 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=7695643 reference reference 0 0 - 0 - Ozawa S., Nagata K., Shimada M., Ueda M., Tsuzuki T., Yamazoe Y., Kato R. (1995). "Primary structures and properties of two related forms of aryl sulfotransferases in human liver.", Pharmacogenetics 5:S135-S140 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=7581483 reference reference 0 0 - 0 - Yamazoe Y., Nagata K., Ozawa S., Kato R. (1994). "Structural similarity and diversity of sulfotransferases.", Chem. Biol. Interact. 92:107-117 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=8033246 reference reference 0 0 - 0 - Bernier F., Soucy P., Luu-The V. (1996). "Human phenol sulfotransferase gene contains two alternative promoters: structure and expression of the gene.", DNA Cell Biol. 15:367-375 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=8924211 reference reference 0 0 - 0 - Dooley T.P., Huang Z. (1996). "Genomic organization and DNA sequences of two human phenol sulfotransferase genes (STP1 and STP2) on the short arm of chromosome 16.", Biochem. Biophys. Res. Commun. 228:134-140 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=8912648 reference reference 0 0 - 0 - Raftogianis R.B., Her C., Weinshilboum R.M. (1997). Submitted to database EMBL/GenBank/DDBJ databases reference reference 0 0 - 0 - Dajani R., Hood A.M., Coughtrie M.W. (1998). "A single amino acid, Glu146, governs the substrate specificity of a human dopamine sulfotransferase, SULT1A3.", Mol. Pharmacol. 54:942-948 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=9855620 reference reference 0 0 - 0 - Shichijo S., Itoh K. (2001). "Identification of immuno-peptidmics that are recognized by tumor-reactive CTL generated from TIL of colon cancer patients.", Submitted to database EMBL/GenBank/DDBJ databases reference reference 0 0 - 0 - Kalnine N., Chen X., Rolfs A., Halleck A., Hines L., Eisenstein S., Koundinya M., Raphael J., Moreira D., Kelley T., LaBaer J., Lin Y., Phelan M., Farmer A. (2003). "Cloning of human full-length CDSs in BD Creator(TM) system donor vector.", Submitted to database EMBL/GenBank/DDBJ databases reference reference 0 0 - 0 - Strausberg R.L., Feingold E.A., Grouse L.H., Derge J.G., Klausner R.D., Collins F.S., Wagner L., Shenmen C.M., Schuler G.D., Altschul S.F., Zeeberg B., Buetow K.H., Schaefer C.F., Bhat N.K., Hopkins R.F., Jordan H., Moore T., Max S.I., Wang J., Hsieh F., Diatchenko L., Marusina K., Farmer A.A., Rubin G.M., Hong L., Stapleton M., Soares M.B., Bonaldo M.F., Casavant T.L., Scheetz T.E., Brownstein M.J., Usdin T.B., Toshiyuki S., Carninci P., Prange C., Raha S.S., Loquellano N.A., Peters G.J., Abramson R.D., Mullahy S.J., Bosak S.A., McEwan P.J., McKernan K.J., Malek J.A., Gunaratne P.H., Richards S., Worley K.C., Hale S., Garcia A.M., Gay L.J., Hulyk S.W., Villalon D.K., Muzny D.M., Sodergren E.J., Lu X., Gibbs R.A., Fahey J., Helton E., Ketteman M., Madan A., Rodrigues S., Sanchez A., Whiting M., Madan A., Young A.C., Shevchenko Y., Bouffard G.G., Blakesley R.W., Touchman J.W., Green E.D., Dickson M.C., Rodriguez A.C., Grimwood J., Schmutz J., Myers R.M., Butterfield Y.S.N., Krzywinski M.I., Skalska U., Smailus D.E., Schnerch A., Schein J.E., Jones S.J.M., Marra M.A. (2002). "Generation and initial analysis of more than 15,000 full-length human and mouse cDNA sequences.", Proc. Natl. Acad. Sci. U.S.A. 99:16899-16903 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=12477932 reference reference 0 0 - 0 - Dooley T.P., Obermoeller R.D., Leiter E.H., Chapman H.D., Falany C.N., Deng Z., Siciliano M.J. (1993). "Mapping of the phenol sulfotransferase gene (STP) to human chromosome 16p12.1-p11.2 and to mouse chromosome 7.", Genomics 18:440-443 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=8288252 reference reference 0 0 - 0 - Veronese M.E., Burgess W., Zhu X., McManus M.E. (1994). "Functional characterization of two human sulphotransferase cDNAs that encode monoamine- and phenol-sulphating forms of phenol sulphotransferase: substrate kinetics, thermal-stability and inhibitor-sensitivity studies.", Biochem. J. 302:497-502 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=8093002 reference reference 0 0 - 0 - Falany C.N., Zhuang W., Falany J.L. (1994). "Characterization of expressed human phenol-sulfating phenol sulfotransferase: effect of mutating cys70 on activity and thermostability.", Chem. Biol. Interact. 92:57-66 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=8033270 reference reference 0 0 - 0 - Raftogianis R.B., Wood T.C., Otterness D.M., Van Loon J.A., Weinshilboum R.M. (1997). "Phenol sulfotransferase pharmacogenetics in humans: association of common SULT1A1 alleles with TS PST phenotype.", Biochem. Biophys. Res. Commun. 239:298-304 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=9345314 reference reference 0 0 - 0 - Engelke C.E., Meinl W., Boeing H., Glatt H. (2000). "Association between functional genetic polymorphisms of human sulfotransferases 1A1 and 1A2.", Pharmacogenetics 10:163-169 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=10762004 reference reference 0 0 - 0 - Gamage N.U., Duggleby R.G., Barnett A.C., Tresillian M., Latham C.F., Liyou N.E., McManus M.E., Martin J.L. (2003). "Structure of a human carcinogen-converting enzyme, SULT1A1. Structural and kinetic implications of substrate inhibition.", J. Biol. Chem. 278:7655-7662 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&dopt=Citation&list_uids=12471039 Bio-Das-Lite-2.04/t/sequence-ensembl1834.xml000444000765000024 230211407221227 17522 0ustar00rmpstaff000000000000 nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn Bio-Das-Lite-2.04/t/sequence.xml000444000765000024 252511407221227 15566 0ustar00rmpstaff000000000000 atttcttggcgtaaataagagtctcaatgagactctcagaagaaaattgataaatattat taatgatataataataatcttgttgatccgttctatctccagacgattttcctagtctcc agtcgattttgcgctgaaaatgggatatttaatggaattgtttttgtttttattaataaa taggaataaatttacgaaaatcacaaaattttcaataaaaaacaccaaaaaaaagagaaa aaatgagaaaaatcgacgaaaatcggtataaaatcaaataaaaatagaaggaaaatattc agctcgtaaacccacacgtgcggcacggtttcgtgggcggggcgtctctgccgggaaaat tttgcgtttaaaaactcacatataggcatccaatggattttcggattttaaaaattaata taaaatcagggaaatttttttaaattttttcacatcgatattcggtatcaggggcaaaat tagagtcagaaacatatatttccccacaaactctactccccctttaaacaaagcaaagag cgatactcattgcctgtagcctctatattatgccttatgggaatgcatttgattgtttcc gcatattgtttacaaccatttatacaacatgtgacgtagacgcactgggcggttgtaaaa cctgacagaaagaattggtcccgtcatctactttctgattttttggaaaatatgtacaat gtcgtccagtattctattccttctcggcgatttggccaagttattcaaacacgtataaat aaaaatcaataaagctaggaaaatattttcagccatcacaaagtttcgtcagccttgtta tgtcaaccactttttatacaaattatataaccagaaatactattaaataagtatttgtat gaaacaatgaacactattataacattttcagaaaatgtagtatttaagcgaaggtagtgc acatcaaggccgtcaaacggaaaaatttttgcaagaatca Bio-Das-Lite-2.04/t/source.xml000444000765000024 172711407221227 15261 0ustar00rmpstaff000000000000 PDBresnum,Protein Structure Bio-Das-Lite-2.04/t/structure.xml000444000765000024 1055411407221227 16037 0ustar00rmpstaff000000000000 Bio-Das-Lite-2.04/t/types-ensembl1834.xml000444000765000024 67311407221227 17047 0ustar00rmpstaff000000000000