1Ace::Sequence(3) User Contributed Perl Documentation Ace::Sequence(3)
2
3
4
6 Ace::Sequence - Examine ACeDB Sequence Objects
7
9 # open database connection and get an Ace::Object sequence
10 use Ace::Sequence;
11
12 $db = Ace->connect(-host => 'stein.cshl.org',-port => 200005);
13 $obj = $db->fetch(Predicted_gene => 'ZK154.3');
14
15 # Wrap it in an Ace::Sequence object
16 $seq = Ace::Sequence->new($obj);
17
18 # Find all the exons
19 @exons = $seq->features('exon');
20
21 # Find all the exons predicted by various versions of "genefinder"
22 @exons = $seq->features('exon:genefinder.*');
23
24 # Iterate through the exons, printing their start, end and DNA
25 for my $exon (@exons) {
26 print join "\t",$exon->start,$exon->end,$exon->dna,"\n";
27 }
28
29 # Find the region 1000 kb upstream of the first exon
30 $sub = Ace::Sequence->new(-seq=>$exons[0],
31 -offset=>-1000,-length=>1000);
32
33 # Find all features in that area
34 @features = $sub->features;
35
36 # Print its DNA
37 print $sub->dna;
38
39 # Create a new Sequence object from the first 500 kb of chromosome 1
40 $seq = Ace::Sequence->new(-name=>'CHROMOSOME_I',-db=>$db,
41 -offset=>0,-length=>500_000);
42
43 # Get the GFF dump as a text string
44 $gff = $seq->gff;
45
46 # Limit dump to Predicted_genes
47 $gff_genes = $seq->gff(-features=>'Predicted_gene');
48
49 # Return a GFF object (using optional GFF.pm module from Sanger)
50 $gff_obj = $seq->GFF;
51
53 Ace::Sequence, and its allied classes Ace::Sequence::Feature and
54 Ace::Sequence::FeatureList, provide a convenient interface to the ACeDB
55 Sequence classes and the GFF sequence feature file format.
56
57 Using this class, you can define a region of the genome by using a
58 landmark (sequenced clone, link, superlink, predicted gene), an offset
59 from that landmark, and a distance. Offsets and distances can be
60 positive or negative. This will return an Ace::Sequence object. Once
61 a region is defined, you may retrieve its DNA sequence, or query the
62 database for any features that may be contained within this region.
63 Features can be returned as objects (using the Ace::Sequence::Feature
64 class), as GFF text-only dumps, or in the form of the GFF class defined
65 by the Sanger Centre's GFF.pm module.
66
67 This class builds on top of Ace and Ace::Object. Please see their
68 manual pages before consulting this one.
69
71 $seq = Ace::Sequence->new($object);
72
73 $seq = Ace::Sequence->new(-source => $object,
74 -offset => $offset,
75 -length => $length,
76 -refseq => $reference_sequence);
77
78 $seq = Ace::Sequence->new(-name => $name,
79 -db => $db,
80