This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Fetch mRNA sequence from mysql database using Bio::DB::SeqFeature::Store

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

0 answers

No answers yet.

Log in to answer this question.