[Bioperl-l] Blasting multiple protein sequences.
Chet Seligman
cseligman at earthlink.net
Tue Apr 27 02:04:07 UTC 2010
Thanks Christopher.
Your model made no errors.
You make it look easy!
Chet
-----Original Message-----
From: bioperl-l-bounces at lists.open-bio.org
[mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of Christopher
Bottoms
Sent: Monday, April 26, 2010 6:20 PM
To: Chet Seligman
Cc: bioperl-l at lists.open-bio.org
Subject: Re: [Bioperl-l] Blasting multiple protein sequences.
The function blast_sequence only acts on a single sequence. You've passed it
an array of sequence objects. Try something more like the following. It's
not tested, but the principles should be correct, even if there is an error
or two:
my $fastafilename = 'protein.fa';
# reads an array of sequences
my @seq_object_array = read_all_sequences($fastafilename,'fasta');
#Number to allow outputting separate files for each sequence
my $report_number = 0;
#Iterate over each sequence object
for my $seq_object( @seq_object_array){
#Get the blast report for this sequence object
my $blast_report = blast_sequence($seq_object);
#create a unique name for the output file (prepended with an '>')
my $blast_out = '>blast_report_' . $report_number++ . '.out';
#output the blast report
write_blast($blast_out, $blast_report);
}
exit;
On Mon, Apr 26, 2010 at 7:56 PM, Chet Seligman
<cseligman at earthlink.net>wrote:
> I am a student and new to BioPerl.
> I have a fasta formatted file with 17 protein sequences in it and I would
> like to blast them all.
> My problem is that only the first one gets blasted.
> Can anyone make a suggestion?
> Thanks in advance - Chet
> Here's my code:
> #!/usr/bin/perl
> use Bio::Perl;
> use strict;
>
> my $fastafilename = 'protein.fa';
> # reads an array of sequences
> my @seq_object_array = read_all_sequences($fastafilename,'fasta');
>
> # BLAST a sequence (assumes an internet connection)
>
> my $blast_report = blast_sequence(@seq_object_array);
>
> write_blast(">blast.out",$blast_report);
>
> exit;
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
_______________________________________________
Bioperl-l mailing list
Bioperl-l at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list