The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DAS::GUS::Segment - DAS-style access to a GUS database

SYNOPSIS

  # Get a Bio::Das::SegmentI object from a DAS::GUS database
  
  $segment = $das->segment( -name  => 'Landmark',
                                                    -start => $start,
                                                        -stop  => $stop );

DESCRIPTION

AUTHOR

Name: Haiming Wang Email: hwang@uga.edu

new

        Title   : new
        Usage   : $segment = $db->segment(-name  => 'AAEL01000015',
                                                                          -start => $start,
                                                                          -stop  => $stop );
        Function: Create a segment object 
        Returns : a new DAS::GUS::Segment object 
        Args    : see below

This method creates a new DAS::GUS::Segment object accoring to a segment name, such as contig 'AAEL0100015'. Generally this is called automatically by the DAS::GUS module.

There are five positional arguments:

  $factory              a DAS::GUS adaptor to use for database access
  $start                start of the desired segment relative to source sequence
  $stop                 stop of the desired segment relative to source sequence
  $srcfeature_id        ID of the source sequence
  $class                type of the sequence, i.e. chromosome, contig
  $name                 name of the segment 
  $atts                 attributes of the segment

name

  Title         : name
  Usage         : $segname = $seg->name();
  Function      : Return the name of the segment
  Returns       : see avove
  Args          : none
  Status        : public

class

        Title   : class
        Usage   : $obj->class($newval)
        Function: Return the segment class
        Returns : value of class (a scalar)
        Args    : on set, new value (a scalar or undef, optional)

attributes

        Title   : attributes
        Usage   : $obj->attributes($newval)
        Function: Return the segment attributes
        Returns : attributes string for gff3 dump
        Args    : 

seq_id

        Title   : seq_id
        Usage   : $ref = $s->seq_id
        Function: return the ID of the landmark, aliased to name() for 
                          backward compatibility
        Return  : a string
        Args    : none
        Status  : public

start

        Title   : start
        Usage   : $s->start
        Function: start of segment
        Returns : integer
        Args    : none
        Status  : Public

low

        Title   : low
        Usage   : $s->low
        Function: start of segment; 
                          Alias of start for backward compatibility
        Returns : integer
        Args    : none
        Status  : Public

end

        Title   : end
        Usage   : $s->end
        Function: end of segment; 
        Returns : integer
        Args    : none
        Status  : Public

high

        Title   : high
        Usage   : $s->high
        Function: end of segment; 
                          Alias of end for backward compatibility.
        Returns : integer
        Args    : none
        Status  : Public

stop

        Title   : stop
        Usage   : $s->stop
        Function: end of segment; 
                          Alias of end for backward compatibility.
        Returns : integer
        Args    : none
        Status  : Public

length

        Title   : length
        Usage   : $s->length
        Function: length of segment; 
        Returns : integer
        Args    : none
        Status  : Public

features

        Title   : features
        Usage   : @features = $s->features(@args)
        Function: get features that overlap this segment
        Returns : a list of Bio::SeqFeatureI objects
        Args    : see below
        Status  : public

This method will find all features that intersect the segment in a variety of ways and returns a list of Bio::SeqFeatureI objects. The feature locations will use coordinates relative to the reference sequence in effect at the time that features() was called.

The returned list can be limited to certain types, attributes or range intersection modes. Types of range intersection are one of:

        "overlaps"              the default
        "contains"              return features completely contained within the segment
        "contained_in"  retunr features that completely contain the segment

Two types of argument lists are accepts. In the positional argument form, the arguments are treated as a list of feature types. In the named parameter form, the arguments are a series of -name=>value pairs.

        Argument                Description
   -------------------------------------
        -types                  An array reference to type names in the format "method:source"
        
        -attributes             A hashref containing a set of attributes to match

        -rangetype              One of "overlaps", "contains", or "contained_in".

        -iterator               Return an iterator across the features.

        -callback               A callback to invoke on each feature

The -attributes argument is a hashref containing one or more attributes to match against:

        -attributes => { Gene => 'abc-1',
                                         Note => 'confirmed' }

Attribute matching is simple string matching, and multiple attributes are ANDed together. More complex filtering can be performed using the -callback option (see below)

If -iterator is true, then the method returns an object reference that implements the next_seq() method. Each call to next_seq() returns a new Bio::SeqFeatureI object.

If -callback is passed a code reference, the code reference will be invoked on each feture returned. The code will be passed two arguments consisting of the current feature and the segment object itself, and must return a true value. If the code returns a false value, feature retrieval will be aborted.

-callback and -iterator are mutually exclusive options. If -iterator is defined, then -callback is ignored.

_getUniqueTypes

    Title   : _getUniqueTypes
    Usage   : $segment->_getUniqueTypes()
    Function: filter out the duplicate types and return an array of
              unique feature types in 'type_source' format
    Returns : an array of feature types
    Args    : array ref
    Status  : Private

For example, in the config file

[Gene] feature = gene:Genbank

[BLASTX] feature = match:WU_BLASTX

_getUniqeTypes will subsitute ':' with '_' and return [ gene_Genbank, match_WU_BLASTX ], the latter can be used to find the corresponding element in SQL xml files.

get_all_SeqFeature, get_SeqFeatures, top_SeqFeatures, all_SeqFeatures

        Title   : get_all_SeqFeature, get_SeqFeatures, top_SeqFeatures, 
                          all_SeqFeatures
        Usage   : $s->get_all_SeqFeature()
        Function: get the sequence string fro this segment
                          Several aliases of features() for backword compatibility
        Returns : a string
        Args    : none
        Status  : Public

seq

        Title   : seq
        Usage   : $s->seq
        Function: get the sequence string for this segment
        Returns : a string
        Args    : none
        Status  : Public

secondary_structure_encodings

        Title   : secondary_structure_encodings
        Usage   : $s->secondary_structure_encodings
        Function: get the secondary structure prediction scores for segment
        Returns : hash ref { secondary_structure_type => string of 0-9 one digit per base }
        Args    : none
        Status  : Public

factory

        Title   : factory
        Usage   : $factory = $s->factory
        Function: return the segment factory
        Returns : a Bio::DasI object
        Args    : see below
        Status  : Public

This method returns a Bio::DasI object that can be used to fetch more segments. This is typically the Bio::DasI object from which the segments was originally generated.

srcfeature_id

        Title   : srcfeature_id
        Usage   : $obj->srcfeature_id($newval)
        Function:
        Returns : value of srcfeature_id (a scalar)
        Args    : on set, new value (a scalar or undef, optional)

alphabet

        Title   : alphabet
        Usage   : $obj->alphabet($newval)
        Function:
        Returns : scalar 'dna'
        Args    : on set, new value ( a scalar or undef, optional )
        Status  : Public

display_id, display_name, accession_number, desc

        Title   : display_id, display_name, accession_number, desc
        Usage   : $s->display_name()
        Function: Alias of name()
                          Several aliases for name; it may be that these could do something
                          better than just giving back the name.
        Returns : string
        Args    : none
        Status  : Public

get_feature_stream

        Title   : get_feature_stream
        Usage   :
        Function:
        Returns :
        Args    :
        Status  :

clone

        Title   : clone
        Usage   : $copy = $s->clone
        Function: make a copy of this segment
        Returns : a Bio::DB::GFF::Segment object
        Args    : none
        Status  : Public

sourceseq

        Title   : sourceseq
        Usage   : $obj->sourceseq($newval)
        Function: get feature name according to a feature_id
        Returns : value of sourceseq(a scalar)
        Args    : on set, new value ( a scalar or undef, optional )
        Status  : Public

abs_ref

        Title   : abs_ref
        Usage   : $obj->abs_ref()
        Function: Alisas of sourceseq
                          Alias of sourceseq for backward compatibility
        Returns : value of sourceseq ( a scalar )
        Args    : none
        Status  : Public

abs_start

        Title   : abs_start
        Usage   : $obj->abs_start()
        Function: Alias of start
        Returns : value of start ( a scalar )
        Args    : none
        Status  : Public

abs_end

        Title   : abs_end
        Usage   : $obj->abs_end()
        Function: Alias of end
        Returns : value of end ( a scalar )
        Args    : none
        Status  : Public

asString

        Title   : asString
        Usage   : $s->asString
        Function: human-readable string for segment
                          Returns a human-readable string representing this sequence. 
                          Format is: sourceseq:start,stop
        Returns : a string
        Args    : none
        Status  : Public