[Bioperl-l] Swissprot keyword parsing (was Re: help)

Jason Eric Stajich jason@cgt.mc.duke.edu
Thu, 27 Sep 2001 09:39:15 -0400 (EDT)


[ cc-ing bioperl list in case others have similar problems]

You need to have the IO::String perl package installed on your system.
You can see information about this in the readme and when you run
% perl Makefile.PL

You can use the CPAN system to install all the bioperl dependancies by
installing the Bundle::BioPerl bundle.

Once you get this working you can look at the Bio::Seq::RichSeqI
interface and see that we have a keyword method so you can call
while( my $seq = $seqout->read_seq ) {
 my (@words) = $seq->keywords();
 if( grep /$testword/ @words ) {
	# save this seq
 }
}

(Note: you will need a bioperl version 0.7.1 or later)

[BP: Jason Notices that RichSeqI does not have keywords in interface -
     very bad. Adding to interface now]

I hope this helps, please email the list if you have any more problems.
-jason

On Thu, 27 Sep 2001, manjunath. K.R. wrote:

> Dear Sir Jason Stajich ,
> I am Manjunath from India, I need to use perl script
> package Bio::DB::SwissProt; coded by you . We have
> installed the bioperl package in our Red hat Linux
> server.
> The whole script look like this
>
> #!/usr/bin/perl
>
> #How to retrieve Swiss-Prot entries over the Web
>
> use Bio::DB::SwissProt;
> use Bio::SeqIO;
>
>
> my $sp = new Bio::DB::SwissProt;
> # fetch many entries
> my $seqio = $gb->get_Stream_by_batch([ qw(J00522
> AF303112 2981014)]);
>
> while( defined ($seq = $seqio->next_seq )) {
>         $seqout->write_seq($seq);
> }
>
> This script giving following message
>
> perl getsp.pl
> Can't locate IO/String.pm in @INC (@INC contains:
> /usr/lib/perl5/5.6.0/i386-linux /usr/lib
> /perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux
> /usr/lib/perl5/site_perl/5.6.0 /usr
> /lib/perl5/site_perl .) at
> /usr/lib/perl5/site_perl/5.6.0/Bio/DB/WebDBSeqI.pm
> line 87.
> BEGIN failed--compilation aborted at
> /usr/lib/perl5/site_perl/5.6.0/Bio/DB/WebDBSeqI.pm li
> ne 87.
> Compilation failed in require at
> /usr/lib/perl5/site_perl/5.6.0/Bio/DB/SwissProt.pm
> line 1
> 06.
> BEGIN failed--compilation aborted at
> /usr/lib/perl5/site_perl/5.6.0/Bio/DB/SwissProt.pm li
> ne 106.
> Compilation failed in require at getsp.pl line 5.
> BEGIN failed--compilation aborted at getsp.pl line 5.
>
> This script fetches sequences in FASTA based on
> Swiss-ID or Accession number,
> I need a perl script, which accept a set of keywords
> from the user and should go to Swiss-Prot nrDB and
> then it should open each entry and check for key word
> provided by the user is match with KW line of Swiss
> entry. If it matches then that entry should be saved
> to the local directory. The fetched sequences should
> be in Swiss-Prot format.
> I hope you will give some idea.
>
> With regards
> Manjunath.
>
>
>
>
>
> ____________________________________________________________
> Do You Yahoo!?
> Send a newsletter, share photos & files, conduct polls, organize chat events. Visit http://in.groups.yahoo.com
>

-- 
Jason Stajich
Duke University
jason@cgt.mc.duke.edu