[Bioperl-l] Generate a hsp from emboss format?
Antony03
antony.vincent.1 at ulaval.ca
Mon Mar 18 17:35:13 EDT 2013
Hi!
For example, with this code I can easily modify only one string:
#! /usr/bin/perl -w
# use strict;
use Bio::SeqIO;
use Bio::Tools::Run::StandAloneBlast;
use Bio::Seq;
use warnings;
###########################################################################################################
# Usage information
die "Usage: $0 <sequence 1> <sequence 2> <BLAST algorithme> <minimum % of
identity>\n", if (@ARGV != 4);
my ($infile1,$infile2,$algo,$identity) = @ARGV;
##########################################################################################################
my $query1_in = Bio::SeqIO->newFh ( -file => "$infile1",
-format => 'fasta' );
my $query1 = <$query1_in>;
my $query2_in = Bio::SeqIO->newFh ( -file => "$infile2",
-format => 'fasta' );
my $query2 = <$query2_in>;
my $factory = Bio::Tools::Run::StandAloneBlast->new('program' => "$algo");
my $report = $factory->bl2seq($query1, $query2);
############################################################################################################
while (my $result = $report->next_result) { # while 1
print "Query: ".$result->query_name."\n\n";
while (my $hit = $result->next_hit) { # while 2
while (my $hsp = $hit->next_hsp) { # while 3
if ( $hsp->percent_identity >= "$identity" )
{ # start of if
print $hsp->algorithm, ": Identity ", 100*$hsp->frac_identical, "\%, Rank
", $hsp->rank, " (evalue:", $hsp->evalue, ")\n";
print "\t", $hsp->query_string;
print "\n";
print "\t", $hsp->homology_string;
print "\n";
print "\t", $hsp->hit_string;
print "\n\n";
}
} # end of while 3
print "\n";
} # end of while 2
} # end of while 3
This is why I want to have this format. Is this possible?
Thanks!
--
View this message in context: http://old.nabble.com/Generate-a-hsp-from-emboss-format--tp35187436p35190011.html
Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
More information about the Bioperl-l
mailing list