Bio::Das::Request::Sequences - The DAS "sequence" request


Bio-Das documentation Contained in the Bio-Das distribution.

Index


Code Index:

NAME

Top

Bio::Das::Request::Sequences - The DAS "sequence" request

SYNOPSIS

Top

 my @sequences            = $request->results;
 my $sequences            = $request->results;

 my $dsn                  = $request->dsn;
 my $das_command          = $request->command;
 my $successful           = $request->is_success;
 my $error_msg            = $request->error;
 my ($username,$password) = $request->auth;

DESCRIPTION

Top

This is a subclass of Bio::Das::Request::Dnas specialized for the "sequence" command. It is used to retrieve the sequence corresponding to a set of segments on a set of DAS servers.

AUTHOR

Top

Lincoln Stein <lstein@cshl.org>

Contributions from: Andreas Kahari <andreas.kahari@ebi.ac.uk>

Copyright (c) 2001 Cold Spring Harbor Laboratory

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty.

SEE ALSO

Top

Bio::Das::Request::Dnas, Bio::Das::Request, Bio::Das::Segment, Bio::Das::HTTP::Fetch Bio::Das::Source, Bio::Das::Type, Bio::Das::Stylesheet Bio::Das::RangeI


Bio-Das documentation Contained in the Bio-Das distribution.
package Bio::Das::Request::Sequences;
# $Id: Sequences.pm,v 1.2 2005/08/24 16:04:47 lstein Exp $
# this module issues and parses the types command, with arguments -dsn, -segment, -categories, -enumerate

use strict;
use Bio::Das::Segment;
use Bio::Das::Request::Dnas;
use Bio::Das::Util 'rearrange';

use vars '@ISA';
@ISA = 'Bio::Das::Request::Dnas';

sub command { 'sequence' }

sub t_DASSEQUENCE {
    my ($self, $attrs) = @_;
    if ($attrs) {
        $self->clear_results;
        $self->{tmp}{current_segment} =
            Bio::Das::Segment->new(
                $attrs->{id},
                $attrs->{start},
                $attrs->{stop},
                $attrs->{version}
            );
    } else {
        $self->{tmp}{current_sequence} =~ s/\s//g;
        $self->add_object(
            $self->{tmp}{current_segment},
            $self->{tmp}{current_sequence}
        );
        delete $self->{tmp};
    }
}

sub t_SEQUENCE {
    my ($self, $attrs) = @_;

    if ($attrs) {  # start of tag
        $self->{tmp}{current_sequence} = '';
    } else {
        my $sequence = $self->char_data;
        $self->{tmp}{current_sequence} .= $sequence;
    }
}

1;