[Bioperl-l] Obsolete method call in Bio/DB/SQL/SeqAdaptor.pm?
Marc Logghe
Marc.Logghe at devgen.com
Thu Feb 3 11:45:51 EST 2005
> The bioentry table has a key biodatabase_id that includes
> biodatabase_id,
> accession, and entry version. The fasta files have only a
> number on the
> header line to identify them and apparently either SeqIO or
> Seq loads this
> into the display id and leaves the accession undefined so
> that all of the
> records have the same key (e.g., 4-unknown-UNK) which is a
> Bozo no-no (for
> you old enough to remember who Bozo is). I'm using bioperl
> 1.4. Shouldn't
> the accession get set to display_id if accession doesn't
> exist? Failing
> that, would it make sense to modify the store method in
> SeqAdaptor to use
> the display_id in the key if the accession is undefined?
What I do in that case is use the -pipeline option of load_seqdatabase.pl and pass it a seqprocessor that sets the accession number to the display_id.
E.g.
load_seqdatabase.pl <my_other_options> --format fasta --pipeline "SeqProcessor::Accession" <fastafile>
You create first the use-able SeqProcessor::Accession processor that basically should look like this:
package SeqProcessor::Accession;
use strict;
use vars qw(@ISA);
use Bio::Seq::BaseSeqProcessor;
use Bio::SeqFeature::Generic;
@ISA = qw(Bio::Seq::BaseSeqProcessor);
sub process_seq
{
my ($self, $seq) = @_;
$seq->accession_number($seq->display_id);
return ($seq);
}
1;
I am a big fan of the seqprocessor facility of Bioperl. It is just magic.
Everybody should make use of it ;-)
Cheers,
Marc
More information about the Bioperl-l
mailing list