[Bioperl-l] how to find SeqFeature at specific sequence location
Roy Chaudhuri
roy.chaudhuri at gmail.com
Fri Jul 22 11:02:15 UTC 2011
Hi Adam,
Sorry for the late reply. You can do this direct from BioSQL using a
BioQuery:
#!/usr/bin/perl
use warnings FATAL=>qw(all);
use Modern::Perl;
use Bio::DB::BioDB;
use Bio::DB::Query::BioQuery;
my ($accession, $start, $end)=qw(U00096 1000 1001);
my $dbadap=Bio::DB::BioDB->new(-database=>'biosql',
-dbname=>'mydatabase', -user=>'myuser', -pass=>'mypass', -driver=>'mysql');
my @where=("entry.accession_number='$accession'",
"location.start < $end",
"location.end > $start");
my
$query=Bio::DB::Query::BioQuery->new(-datacollections=>['Bio::SeqFeatureI feat',
'Bio::Annotation::SimpleValue=>Bio::SeqFeatureI term::primary_tag',
'Bio::PrimarySeqI=>Bio::SeqFeatureI entry',
'Bio::SeqFeatureI=>Bio::LocationI'],
-where=>\@where
);
my
$result=$dbadap->get_object_adaptor('Bio::SeqFeatureI')->find_by_query($query);
while (my $feat=$result->next_object) {
say join "\t", $feat->primary_tag, $feat->get_tagset_values(qw(gene
locus_tag product)), $feat->location->to_FTstring;
}
Cheers,
Roy.
On 13/07/2011 23:03, Adam Witney wrote:
>
> Thanks for your replies guys.
>
> I was trying to do it from the BioSQL schema and Bio::DB::BioDB but
> after some further investigation it looks like Bio::DB::GFF or
> Bio::DB::SeqFeature::Store are the only ways to do it
>
> Thanks
>
> adam
>
> On 13 Jul 2011, at 01:06, Chris UI wrote:
>
>> One should be able to do this via Bio::DB::SeqFeature::Store.
>> However, going from a Bio::Seq to that is the tricky part.
>>
>> chris
>>
>> Sent from my iPad
>>
>> On Jul 12, 2011, at 6:12 PM, "Smithies,
>> Russell"<Russell.Smithies at agresearch.co.nz> wrote:
>>
>>> I've done it before by taking a segment of the sequence and
>>> looking for features in that.
>>>
>>> my $db = Bio::DB::GFF->new( -adaptor => 'dbi::mysql',-dsn=>
>>> 'hapmap:gbrowsemysql')or die "Can't open
>>> database:",Bio::DB::GFF->error,"\n"; my $segment =
>>> $db->segment(-class=>'Chromosome',-name=> "Chr1",
>>> -start=>$start, -end=>$end); my @repeats =
>>> $segment->features(-types=> ['match:UCSC_REPEATMASK']);
>>>
>>> --Russell
>>>
>>>> -----Original Message----- From:
>>>> bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
>>>> bounces at lists.open-bio.org] On Behalf Of Adam Witney Sent:
>>>> Wednesday, 13 July 2011 6:04 a.m. To: bioperl-l at bioperl.org
>>>> Subject: [Bioperl-l] how to find SeqFeature at specific
>>>> sequence location
>>>>
>>>> Hi,
>>>>
>>>> Is there an easy way of finding the SeqFeatures at a specific
>>>> base location on a Bio::Seq? I guess I can do it by calling
>>>> get_all_SeqFeatures and testing start/stop coordinates, but
>>>> just wondered if there was a better way.
>>>>
>>>> Thanks
>>>>
>>>> Adam _______________________________________________ Bioperl-l
>>>> mailing list Bioperl-l at lists.open-bio.org
>>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>> =======================================================================
>>>
>>>
Attention: The information contained in this message and/or attachments
>>> from AgResearch Limited is intended only for the persons or
>>> entities to which it is addressed and may contain confidential
>>> and/or privileged material. Any review, retransmission,
>>> dissemination or other use of, or taking of any action in
>>> reliance upon, this information by persons or entities other than
>>> the intended recipients is prohibited by AgResearch Limited. If
>>> you have received this message in error, please notify the sender
>>> immediately.
>>> =======================================================================
>>>
>>>
>>>
_______________________________________________
>>> Bioperl-l mailing list Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>
> _______________________________________________ Bioperl-l mailing
> list Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list