| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Bio::Das::Request::Entry_points; | 
| 2 |  |  |  |  |  |  | # $Id: Entry_points.pm,v 1.5 2004/01/03 00:23:40 lstein Exp $ | 
| 3 |  |  |  |  |  |  | # this module issues and parses the entry_points command, with the ref argument | 
| 4 |  |  |  |  |  |  |  | 
| 5 |  |  |  |  |  |  | =head1 NAME | 
| 6 |  |  |  |  |  |  |  | 
| 7 |  |  |  |  |  |  | Bio::Das::Request::Entry_points - The DAS "entry_points" request | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | my @entry_points         = $request->results; | 
| 12 |  |  |  |  |  |  | my $das_command          = $request->command; | 
| 13 |  |  |  |  |  |  | my $successful           = $request->is_success; | 
| 14 |  |  |  |  |  |  | my $error_msg            = $request->error; | 
| 15 |  |  |  |  |  |  | my ($username,$password) = $request->auth; | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  | This is a subclass of L<Bio::Das::Request> specialized for the | 
| 20 |  |  |  |  |  |  | "entrypoints" command.  It is used to retrieve the entry points | 
| 21 |  |  |  |  |  |  | (landmarks) known to a set of DAS servers. | 
| 22 |  |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  | All methods are as described in L<Bio::Das::Request>. | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | =cut | 
| 26 |  |  |  |  |  |  |  | 
| 27 | 1 |  |  | 1 |  | 7 | use strict; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 31 |  | 
| 28 | 1 |  |  | 1 |  | 5 | use Bio::Das::DSN; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 20 |  | 
| 29 | 1 |  |  | 1 |  | 4 | use Bio::Das::Request; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 29 |  | 
| 30 | 1 |  |  | 1 |  | 5 | use Bio::Das::Util 'rearrange'; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 60 |  | 
| 31 |  |  |  |  |  |  |  | 
| 32 | 1 |  |  | 1 |  | 6 | use vars '@ISA'; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 341 |  | 
| 33 |  |  |  |  |  |  | @ISA = 'Bio::Das::Request'; | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | sub new { | 
| 36 | 0 |  |  | 0 | 1 |  | my $pack = shift; | 
| 37 | 0 |  |  |  |  |  | my ($dsn,$ref,$callback) = rearrange(['dsn', | 
| 38 |  |  |  |  |  |  | 'ref', | 
| 39 |  |  |  |  |  |  | 'callback', | 
| 40 |  |  |  |  |  |  | ],@_); | 
| 41 |  |  |  |  |  |  |  | 
| 42 | 0 |  |  |  |  |  | return $pack->SUPER::new(-dsn=>$dsn, | 
| 43 |  |  |  |  |  |  | -callback=>$callback, | 
| 44 |  |  |  |  |  |  | -args   => {ref => $ref} | 
| 45 |  |  |  |  |  |  | ); | 
| 46 |  |  |  |  |  |  | } | 
| 47 |  |  |  |  |  |  |  | 
| 48 | 0 |  |  | 0 | 1 |  | sub command { 'entry_points' } | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  | # top-level tag | 
| 51 |  |  |  |  |  |  | sub t_DASEP { | 
| 52 | 0 |  |  | 0 | 0 |  | my $self  = shift; | 
| 53 | 0 |  |  |  |  |  | my $attrs = shift; | 
| 54 | 0 | 0 |  |  |  |  | if ($attrs) {  # section is starting | 
| 55 | 0 |  |  |  |  |  | $self->clear_results; | 
| 56 |  |  |  |  |  |  | } | 
| 57 | 0 |  |  |  |  |  | $self->{current_ep} = undef; | 
| 58 |  |  |  |  |  |  | } | 
| 59 |  |  |  |  |  |  |  | 
| 60 | 0 |  |  | 0 | 0 |  | sub t_ENTRY_POINTS { | 
| 61 |  |  |  |  |  |  | # nothing to do there | 
| 62 |  |  |  |  |  |  | } | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | # segment is beginning | 
| 65 |  |  |  |  |  |  | sub t_SEGMENT { | 
| 66 | 0 |  |  | 0 | 0 |  | my $self  = shift; | 
| 67 | 0 |  |  |  |  |  | my $attrs = shift; | 
| 68 | 0 | 0 |  |  |  |  | if ($attrs) {    # segment section is starting | 
| 69 | 0 |  | 0 |  |  |  | $self->{current_ep} = Bio::Das::Segment->new($attrs->{id}, | 
|  |  |  | 0 |  |  |  |  | 
|  |  |  | 0 |  |  |  |  | 
| 70 |  |  |  |  |  |  | $attrs->{start}||1, | 
| 71 |  |  |  |  |  |  | $attrs->{stop}||$attrs->{size}, | 
| 72 |  |  |  |  |  |  | $attrs->{version}||'1.0'); | 
| 73 | 0 |  |  |  |  |  | $self->{current_ep}->size($attrs->{size}); | 
| 74 | 0 |  |  |  |  |  | $self->{current_ep}->class($attrs->{class}); | 
| 75 | 0 |  |  |  |  |  | $self->{current_ep}->orientation($attrs->{orientation}); | 
| 76 | 0 | 0 | 0 |  |  |  | $self->{current_ep}->subparts(1) if defined $attrs->{subparts} | 
| 77 |  |  |  |  |  |  | && $attrs->{subparts} eq 'yes'; | 
| 78 |  |  |  |  |  |  | } | 
| 79 |  |  |  |  |  |  | else {  # reached the end of the segment, so push result | 
| 80 | 0 |  |  |  |  |  | $self->add_object($self->{current_ep}); | 
| 81 |  |  |  |  |  |  | } | 
| 82 |  |  |  |  |  |  | } | 
| 83 |  |  |  |  |  |  |  | 
| 84 |  |  |  |  |  |  | =head1 AUTHOR | 
| 85 |  |  |  |  |  |  |  | 
| 86 |  |  |  |  |  |  | Lincoln Stein <lstein@cshl.org>. | 
| 87 |  |  |  |  |  |  |  | 
| 88 |  |  |  |  |  |  | Copyright (c) 2001 Cold Spring Harbor Laboratory | 
| 89 |  |  |  |  |  |  |  | 
| 90 |  |  |  |  |  |  | This library is free software; you can redistribute it and/or modify | 
| 91 |  |  |  |  |  |  | it under the same terms as Perl itself.  See DISCLAIMER.txt for | 
| 92 |  |  |  |  |  |  | disclaimers of warranty. | 
| 93 |  |  |  |  |  |  |  | 
| 94 |  |  |  |  |  |  | =head1 SEE ALSO | 
| 95 |  |  |  |  |  |  |  | 
| 96 |  |  |  |  |  |  | L<Bio::Das::Request>, L<Bio::Das::HTTP::Fetch>, | 
| 97 |  |  |  |  |  |  | L<Bio::Das::Segment>, L<Bio::Das::Type>, L<Bio::Das::Stylesheet>, | 
| 98 |  |  |  |  |  |  | L<Bio::Das::Source>, L<Bio::RangeI> | 
| 99 |  |  |  |  |  |  |  | 
| 100 |  |  |  |  |  |  | =cut | 
| 101 |  |  |  |  |  |  |  | 
| 102 |  |  |  |  |  |  | 1; | 
| 103 |  |  |  |  |  |  |  |