[Bioperl-l] (no subject)

Olena Morozova olenka.m at gmail.com
Tue Dec 6 12:13:53 EST 2005


Hi,

I am trying to extract sequences from a fasta file using the script
below (the fasta file has been indexed). I keep getting the message:
failure to provide a valid PrimarySeqI object. Why is this?

Thanks a lot for all your help!!
Olena


#! /usr/bin/perl -w

    use Bio::Index::Fasta;
    use strict;

    my $Index_File_Name = "c:/perl/known.fa";
    my $inx = Bio::Index::Fasta->new('-filename' => $Index_File_Name);
    my $out = Bio::SeqIO->new('-format' => 'Fasta','-fh' => \*STDOUT);

    foreach my $id ('puffer_tf_id1.txt') {
        my $seq = $inx->fetch($id); # Returns Bio::Seq object
	$out->write_seq($seq);
    }
On 12/6/05, Hilmar Lapp <hlapp at gmx.net> wrote:
> Good point. No there is no such module, i.e., one that would implement
> RandomAccessI for BioSQL. Shouldn't be hard to write though; would you
> be inclined to volunteer?
>
> 	-hilmar
>
> On Dec 5, 2005, at 10:27 AM, Razvan Sultana wrote:
>
> > Hi !
> > I have a question regarding the bioperl-db implementation in Oracle.
> > I have created a BioSQL schema in Oracle and populated with the latest
> > version of Genbank.
> > I used the "bleeding edge" version of bioperl, bioperl-db and
> > bioperl-schema from the CVS repository.
> >
> > When I try to extract the spliced sequences of the CDS features of
> > entries that have remote locations (e.g., for AF327267:
> > join(4..190,AF327268.1:89..275,AF327268.1:780..930,
> >                     AF327268.1:1049..1196,AF327269.1:63..229,
> >                     AF327269.1:522..659,AF327269.1:784..917,
> >                     AF327269.1:1461..1582,AF327270.1:100..173,
> >                     AF327270.1:349..417)
> > the appended  code complains that it
> > Can't locate object method "get_Seq_by_acc" via package
> > "Bio::DB::BioSQL::DBAdaptor"
> > and rightly so, because the above object doesn't implement the
> > Bio::DB::RandomAccessI interface.
> > If I omit $db from the spliced_seq() method call, I obviously get the
> > message:
> > MSG: cannot get remote location for AF327268.1 without a valid
> > Bio::DB::RandomAccessI database handle (like Bio::DB::GenBank)
> >
> > My question is: is there an object to the BioSQL schema that
> > implements Bio::DB::RandomAccessI ?
> > If there is, how do I get a handle to it?
> > If there isn't, I would be willing to help implementing it.
> >
> > Thank you,
> > Razvan Sultana
> >
> > #!/usr/local/bin/perl
> > use strict;
> > use Bio::DB::BioDB;
> > use Bio::Seq::RichSeq;
> > use Bio::DB::Query::BioQuery;
> > use Getopt::Long;
> >
> > my $host = 'kevin';
> > my $dbuser = 'biosql';
> > my $dbpass;
> > my $dbname = 'biocompd';
> > my $driver = 'Oracle';
> > my $acc;
> > my $biodbname = 'genbank';
> >
> > &GetOptions( 'host=s' => \$host,
> >             'driver=s' => \$driver,
> >         'dbuser=s' => \$dbuser,
> >         'dbpass=s' => \$dbpass,
> >         'dbname=s' => \$dbname,
> >         'accession=s' => \$acc);
> > $acc = 'AF327270' unless $acc;
> >
> > my $db = Bio::DB::BioDB->new(-database => "biosql",
> >                 -host     => $host,
> >                 -dbname   => $dbname,
> >                 -driver   => $driver,
> >                 -user     => $dbuser,
> >                 -pass     => $dbpass,
> >                 );
> >
> > my $seqadaptor = $db->get_object_adaptor('Bio::SeqI');
> > my $query = Bio::DB::Query::BioQuery->new(-datacollections =>
> > ['Bio::PrimarySeqI e',
> >
> > 'BioNamespace=>Bio::PrimarySeqI db'],
> >                                          -where =>
> > ["e.accession_number = '$acc'",
> >                                                     "db.namespace=
> > '$biodbname'"]);
> > my $seq_object = Bio::Seq::RichSeq->new();
> > my $query_result = $seqadaptor->find_by_query($query);
> >
> > while ($seq_object = $query_result->next_object()) {
> >  for my $feature ($seq_object->get_SeqFeatures()) {
> >    my $full_sequence = $seq_object->seq();
> >    my $cds_seq = $feature->spliced_seq($db)->seq() if
> > ($feature->primary_tag() eq 'CDS');
> >  }
> > }
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at portal.open-bio.org
> > http://portal.open-bio.org/mailman/listinfo/bioperl-l
> >
> >
> --
> -------------------------------------------------------------
> Hilmar Lapp                            email: lapp at gnf.org
> GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
> -------------------------------------------------------------
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>



More information about the Bioperl-l mailing list