By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,670 Members | 1,526 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,670 IT Pros & Developers. It's quick & easy.

sortting of blast output in perl programme

P: 5
hai wrote a code for doing BLAST as follows

#!/usr/local/bin/perl
use strict;
use warnings;
# Usage information
die "Usage: $0 <input_fasata> <gene_lenght> <output_file>\n", if (@ARGV != 3);
my ($infile,$ln,$outfile) = @ARGV;
print "running BLAST ...";
system("blastall -p blastn -d aa.fna -i $infile -o blastout -m8");
print "Parsing the BLAST result ...";

Next i want to sort blastout file based on the gene length

example
protein_id=BAC58264.1 CP014046.1 100.00 435 0 0 1 435 804117 804551 0.0 862
protein_id=BAC58264.1 CP014046.1 100.00 16 0 0 357 372 444601 444586 3.9 32.2
protein_id=BAC58264.1 BA000031.2 100.00 435 0 0 1 435 805 371 0.0 862

if user inputted 435 as gene length
desirable out put is
protein_id=BAC58264.1 CP014046.1 100.00 435 0 0 1 435 804117 804551 0.0 862
protein_id=BAC58264.1 BA000031.2 100.00 435 0 0 1 435 805 371 0.0 862
Sep 17 '16 #1
Share this Question
Share on Google+
1 Reply


Expert Mod 100+
P: 589
I'm not a biologist and these 2 books are a bit out of date but still useful.
Beginning Perl for Bioinformatics
Mastering Perl for Bioinformatics

BioPerl is more up to date and might be a better starting point.

Bio::SearchIO::blast - Event generator for event based parsing of blast reports

General cpan search for Bio modules.
Sep 17 '16 #2

Post your reply

Sign in to post your reply or Sign up for a free account.