Fetch mRNA sequence from mysql database using Bio::DB::SeqFeature::Store
0
0
Entering edit mode
11.2 years ago
firoz.imtech ▴ 50

I have uploaded genomic fasta sequence and GFF3 file into local mysql database using bp_seqfeature_load.pl. Now, I want to extract sequence from position 8966215-8966961 on "+" strand of Chromosome I, and print only the mRNA transcript segment between 8966215-8966961. If there are many isoforms found between these position, print each isoform sequences with name and position as fasta format. Could you please tell me what is the best approach to do it for it. My code does not work well. Thanks

#!/user/bin/perl
use strict;
use warnings;
use Bio::Seq;
use Bio::SeqIO;
use Bio::SeqFeatureI;
use Bio::DB::SeqFeature::Store;
use Bio::DB::SeqFeature::Segment;

my @features;
my $db = Bio::DB::SeqFeature::Store->
    new(-adaptor=> 'DBI::mysql',
        -dsn=> '..',
        -user=> '..',
        -pass=> '..',
    );

my @foo = $db->features(-seq_id =>'I',-start=>'8966215',-end=>'8966961', -strand =>'+1',
                        -type => 'mRNA',
                            );

for my $f(@foo){
    print ">",$->name,"_",$f->start,"_",$f->end,"\n";
    print $f->dna,"\n";
}

exit;
genome sequence gene Assembly • 2.6k views
ADD COMMENT

Login before adding your answer.

Traffic: 3770 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6