[ensembl-dev] variation api
Andrea Edwards
edwardsa at cs.man.ac.uk
Fri Nov 26 14:02:46 GMT 2010
Hi
Given a novel variation feature i was wondering how to find out if a
dbSNP record existed for it. In other words, i was wondering if any
known snps were colocated with it. I saw this code in wll mclaren's snp
predictor program
# find any co-located existing VFs
my $existing_vf = "-";
if(defined($new_vf->adaptor->db) && $check_existing == 1) {
my $fs = $new_vf->feature_Slice;
if($fs->start > $fs->end) {
($fs->{'start'}, $fs->{'end'}) = ($fs->{'end'},
$fs->{'start'});
}
foreach my
$existing_vf_obj(@{$new_vf->adaptor->fetch_all_by_Slice($fs)}) {
$existing_vf = $existing_vf_obj->variation_name
if $existing_vf_obj->seq_region_start ==
$new_vf->seq_region_start
and $existing_vf_obj->seq_region_end ==
$new_vf->seq_region_end;
}
}
questions:
1. I believe the feature slice for a feature is defined as the region
exactly spanned by the feature. Does that mean its one bp for a snp?
2. Is it possible that the 'matching' dbsnp record could describe the
snp as being on the opposite strand to my snp, or does ensembl do any
internal procesing to make sure all snps are on the forward strand?
3. why might the feature slice start be greater than the feature slice
end? I know this script is used for other variations than snps so it
might have something to do with that perhaps?
4. Can i just confirm the variation_name will give the dbsnp id if it is
a known snp. Could it give anything else? I presume the same snp can be
held in multiple databases used as external references by ensembl.
5. I must be reading this code wrong because it doesnt look to me as if
it concatenates a list of dbsnp ids in the variable $existing_vf, it
looks as though it is overwriting this variable with each snp found
thanks a lot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20101126/02d4734f/attachment.html>
More information about the Dev
mailing list