File: sequence.pl

package info (click to toggle)
libace-perl 1.92-12
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,012 kB
  • sloc: perl: 7,763; ansic: 7,420; makefile: 81
file content (35 lines) | stat: -rwxr-xr-x 1,108 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/local/bin/perl

# This example will pull some information on a sequence
# from the C. Elegans ACEDB.

use lib '../blib/lib','../blib/arch';
use Ace;
use strict vars;

use constant HOST => $ENV{ACEDB_HOST} || 'stein.cshl.org';
use constant PORT => $ENV{ACEDB_PORT} || 200005;

$|=1;

print "Opening the database....";
my $db = Ace->connect(-host=>HOST,-port=>PORT) || die "Connection failure: ",Ace->error;
print "done.\n";

my @sequences = $db->list('Sequence','S*');
print "There are ",scalar(@sequences)," Sequence objects starting with the letter \"S\".\n";
print "The first one's name is ",$sequences[0],"\n";
print "It contains the following top level tags:\n";
foreach ($sequences[0]->tags) {
  print "\t$_\n";
}
print "The following homology types have been identified:\n";
my @homol = $sequences[0]->Homol;
foreach (@homol) {
  my @hits=$_->col;
  print "\t$_ (",scalar(@hits)," hits)\n";
}

print "The DNA homology hits are: ",join(', ',$sequences[0]->DNA_homol),"\n";
my $homol = $sequences[0]->DNA_homol;
print "The sequence of the homologous sequence $homol is: ",$homol->DNA->right,"\n";