This object is derived from SNPSQL::DBAdaptor.
Method get_Ensembl_SeqFeatures_clone_web() is there only to speed up
Web work. It loads only minimal set of sequence features into
Variation objects . To get a fullset of Variation attributes method
get_SeqFeature_by_id() is call on select objects, only. Additionally
it needs an attribute determined by the display resolution on how far
apart the features have to be to be drawn.
sub get_Ensembl_SeqFeatures_clone_web
{ my ($self,$glob,@acc) = @_;
if (! defined $glob) {
$self->throw("Need to call get_Ensembl_SeqFeatures_clone_web with a globbing parameter and a list of clones");
}
if (scalar(@acc) == 0) {
$self->throw("Calling get_Ensembl_SeqFeatures_clone_web with empty list of clones!\n");
}
my @variations;
my %hash;
my $string;
foreach my $a (@acc) {
$a =~ /(\S+)\.(\d+)/;
$string .= "'$1',";
$hash{$1}=$2;
}
$string =~ s/,$//;
my $inlist = "($string)";
my $query = qq{
SELECT start, end, strand,
acc, version, refsnpid,
tcsid, hgbaseid
FROM GPHit
WHERE acc in $inlist
ORDER BY acc,start
};
&eprof_start('snp-sql-query');
my $sth = $self->prepare($query);
my $res = $sth->execute();
&eprof_end('snp-sql-query');
my $snp;
my $cl;
&eprof_start('snp-sql-object');
SNP:
while( (my $arr = $sth->fetchrow_arrayref()) ) {
my ($begin, $end, $strand,
$acc, $ver, $snpuid,
$tscid, $hgbaseid
) = @{$arr};
my $acc_version="$acc.$ver";
if ( defined $snp && $snp->end+$glob >= $begin && $acc_version eq $cl) {
next SNP;
}
next SNP if $hash{$acc} != $ver;
my $key=$snpuid.$acc; my %seen;
if ( ! $seen{$key} ) {
$seen{$key}++;
$snp = new Bio::EnsEMBL::ExternalData::Variation
(-start => $begin,
-end => $end,
-strand => $strand,
-original_strand => $strand,
-score => 1,
-source_tag => 'dbSNP',
);
my $link = new Bio::Annotation::DBLink;
$link->database('dbSNP');
$link->primary_id($snpuid);
$link->optional_id($acc_version);
$snp->add_DBLink($link);
if ($hgbaseid) {
my $link2 = new Bio::Annotation::DBLink;
$link2->database('HGBASE');
$link2->primary_id($hgbaseid);
$link2->optional_id($acc_version);
$snp->add_DBLink($link2);
}
if ($tscid) {
my $link3 = new Bio::Annotation::DBLink;
$link3->database('TSC-CSHL');
$link3->primary_id($tscid);
$link3->optional_id($acc_version);
$snp->add_DBLink($link3);
}
$cl=$acc_version;
$snp->seqname($acc_version);
push(@variations, $snp);
} }
&eprof_end('snp-sql-object');
return @variations; } |
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _