|-source||The sequence source. This must be an Ace::Object of the Sequence class, or be a sequence-like object containing the SMap tag (see below).|
|-offset||An offset from the beginning of the source sequence. The retrieved Ace::Sequence will begin at this position. The offset can be any positive or negative integer. Offets are <B>0-basedB>.|
|-length||The length of the sequence to return. Either a positive or negative integer can be specified. If a negative length is given, the returned sequence will be complemented relative to the source sequence.|
|-refseq||The sequence to use to establish the coordinate system for the returned sequence. Normally the source sequence is used to establish the coordinate system, but this can be used to override that choice. You can provide either an Ace::Object or just a sequence name for this argument. The source and reference sequences must share a common ancestor, but do not have to be directly related. An attempt to use a disjunct reference sequence, such as one on a different chromosome, will fail.|
|-name||As an alternative to using an Ace::Object with the <B>-sourceB> argument, you may specify a source sequence using <B>-nameB> and <B>-dbB>. The Ace::Sequence module will use the provided database accessor to fetch a Sequence object with the specified name. new() will return undef is no Sequence by this name is known.|
|-db||This argument is required if the source sequence is specified by name rather than by object reference.|
When retrieving information from an Ace::Sequence, the coordinate system is based on the sequence segment selected at object creation time. That is, the +1 strand is the natural direction of the Ace::Sequence object, and base pair 1 is its first base pair. This behavior can be overridden by providing a reference sequence to the new() method, in which case the orientation and position of the reference sequence establishes the coordinate system for the object.
In addition to the reference sequence, there are two other sequences used by Ace::Sequence for internal bookeeping. The source sequence corresponds to the smallest ACeDB sequence object that completely encloses the selected sequence segment. The parent sequence is the smallest ACeDB sequence object that contains the source. The parent is used to derive the length and orientation of source sequences that are not directly associated with DNA objects.
In many cases, the source sequence will be identical to the sequence initially passed to the new() method. However, there are exceptions to this rule. One common exception occurs when the offset and/or length cross the boundaries of the passed-in sequence. In this case, the ACeDB database is searched for the smallest sequence that contains both endpoints of the Ace::Sequence object.
The other common exception occurs in Ace 4.8, where there is support for sequence-like objects that contain the SMap (Sequence Map) tag. The SMap tag provides genomic location information for arbitrary object not just those descended from the Sequence class. This allows ACeDB to perform genome map operations on objects that are not directly related to sequences, such as genetic loci that have been interpolated onto the physical map. When an SMap-containing object is passed to the Ace::Sequence new() method, the module will again choose the smallest ACeDB Sequence object that contains both end-points of the desired region.
Once an Ace::Sequence object is created, you can query it using the following methods:
asString()$name = $seq->asString;
Returns a human-readable identifier for the sequence in the form Source/start-end, where Source is the name of the source sequence, and start and end are the endpoints of the sequence relative to the source (using 1-based indexing). This method is called automatically when the Ace::Sequence is used in a string context.
source_seq()$source = $seq->source_seq;
Return the immediate ancestor of the sequence. The parent of the top-most sequence (such as the CHROMOSOME link) is itself. This method is used internally to ascertain the length of source sequences which are not associated with a DNA object.
NOTE: this procedure is a trifle funky and cannot reliably be used to traverse upwards to the top-most sequence. The reason for this is that it will return an Ace::Sequence in some cases, and an Ace::Object in others. Use get_parent() to traverse upwards through a uniform series of Ace::Sequence objects upwards.
$refseq = $seq->refseq;
Returns the reference sequence, if one is defined.
Set the reference sequence. The reference sequence must share the same ancestor with $seq.
start()$start = $seq->start;
Offset of the beginning of this sequence relative to the source sequence, using 0-based indexing. The offset may be negative if the beginning of the sequence is to the left of the beginning of the source sequence.
length()$length = $seq->length;
The length of this sequence, in base pairs. The length may be negative if the sequences orientation is reversed relative to the source sequence. Use abslength() to obtain the absolute value of the sequence length.
abslength()$length = $seq->abslength;
Return the absolute value of the length of the sequence.
strand()$strand = $seq->strand;
Returns +1 for a sequence oriented in the natural direction of the genomic reference sequence, or -1 otherwise.
reversed()Returns true if the segment is reversed relative to the canonical genomic direction. This is the same as $seq->strand < 0.
dna()$dna = $seq->dna;
Return the DNA corresponding to this sequence. If the sequence length is negative, the reverse complement of the appropriate segment will be returned.
ACeDB allows Sequences to exist without an associated DNA object (which typically happens during intermediate stages of a sequencing project. In such a case, the returned sequence will contain the correct number of - characters.
name()$name = $seq->name;
Return the immediate ancestor of this Ace::Sequence (i.e., the sequence that contains this one). The return value is a new Ace::Sequence or undef, if no parent sequence exists.
get_children()@children = $seq->get_children();
Returns all subsequences that exist as independent objects in the ACeDB database. What exactly is returned is dependent on the data model. In older ACeDB databases, the only subsequences are those under the catchall Subsequence tag. In newer ACeDB databases, the objects returned correspond to objects to the right of the S_Child subtag using a tag syntax, and may include Predicted_genes, Sequences, Links, or other objects. The return value is a list of Ace::Sequence objects.
features()@features = $seq->features; @features = $seq->features(exon,intron,Predicted_gene); @features = $seq->features(exon:GeneFinder,Predicted_gene:hand.*);
features() returns an array of Sequence::Feature objects. If called without arguments, features() returns all features that cross the sequence region. You may also provide a filter list to select a set of features by type and subtype. The format of the filter list is:
Where type is the class of the feature (the feature field of the GFF format), and subtype is a description of how the feature was derived (the source field of the GFF format). Either of these fields can be absent, and either can be a regular expression. More advanced filtering is not supported, but is provided by the Sanger Centres GFF module.
The order of the features in the returned list is not specified. To obtain features sorted by position, use this idiom:
This method returns a summary list of the features that cross the sequence in the form of a Ace::Feature::List object. From the Ace::Feature::List object you can obtain the list of feature names and the number of each type. The feature list is obtained from the ACeDB server with a single short transaction, and therefore has much less overhead than features().
See Ace::Feature::List for more details.
transcripts()This returns a list of Ace::Sequence::Transcript objects, which are specializations of Ace::Sequence::Feature. See Ace::Sequence::Transcript for details.
clones()This returns a list of Ace::Sequence::Feature objects containing reconstructed clones. This is a nasty hack, because ACEDB currently records clone ends, but not the clones themselves, meaning that we will not always know both ends of the clone. In this case the missing end has a synthetic position of -99,999,999 or +99,999,999. Sorry.
gff()$gff = $seq->gff(); $gff = $seq->gff(-abs => 1, -features => [exon,intron:GeneFinder]);
This method returns a GFF file as a scalar. The following arguments are optional:
See also the GFF() method described next.
-abs Ordinarily the feature entries in the GFF file will be returned in coordinates relative to the start of the Ace::Sequence object. Position 1 will be the start of the sequence object, and the + strand will be the sequence objects natural orientation. However if a true value is provided to <B>-absB>, the coordinate system used will be relative to the start of the source sequence, i.e. the native ACeDB Sequence object (usually a cosmid sequence or a link).
If a reference sequence was provided when the Ace::Sequence was created, it will be used by default to set the coordinate system. Relative coordinates can be reenabled by providing a false value to <B>-absB>.
Ordinarily the coordinate system manipulations automatically do what you want and you will not need to adjust them. See also the abs() method described below.
-features The <B>-featuresB> argument filters the features according to a list of types and subtypes. The format is identical to the one described for the features() method. A single filter may be provided as a scalar string. Multiple filters may be passed as an array reference.
GFF()$gff_object = $seq->gff; $gff_object = $seq->gff(-abs => 1, -features => [exon,intron:GeneFinder]);
The GFF() method takes the same arguments as gff() described above, but it returns a GFF::GeneFeatureSet object from the GFF.pm module. If the GFF module is not installed, this method will generate a fatal error.
absolute()$abs = $seq->absolute; $abs = $seq->absolute(1);
This method controls whether the coordinates of features are returned in absolute or relative coordinates. Absolute coordinates are relative to the underlying source or reference sequence. Relative coordinates are relative to the Ace::Sequence object. By default, coordinates are relative unless new() was provided with a reference sequence. This default can be examined and changed using absolute().
automerge()$merge = $seq->automerge; $seq->automerge(0);
This method controls whether groups of features will automatically be merged together by the features() call. If true (the default), then the left and right end of clones will be merged into clone features, introns, exons and CDS entries will be merged into Ace::Sequence::Transcript objects, and similarity entries will be merged into Ace::Sequence::GappedAlignment objects.
db()$db = $seq->db;
Returns the Ace database accessor associated with this sequence.
Ace, Ace::Object, Ace::Sequence::Feature, Ace::Sequence::FeatureList, GFF
Lincoln Stein <firstname.lastname@example.org> with extensive help from Jean Thierry-Mieg <email@example.com>
Many thanks to David Block <firstname.lastname@example.org> for finding and fixing the nasty off-by-one errors.
Copyright (c) 1999, Lincoln D. Stein
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.
|perl v5.20.3||ACE::SEQUENCE (3)||2004-12-01|