sortting of blast output in perl programme

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akhilciba
    New Member
    • Sep 2016
    • 5

    sortting of blast output in perl programme

    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,$o utfile) = @ARGV;
    print "running BLAST ...";
    system("blastal l -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=BAC5 8264.1 CP014046.1 100.00 435 0 0 1 435 804117 804551 0.0 862
    protein_id=BAC5 8264.1 CP014046.1 100.00 16 0 0 357 372 444601 444586 3.9 32.2
    protein_id=BAC5 8264.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=BAC5 8264.1 CP014046.1 100.00 435 0 0 1 435 804117 804551 0.0 862
    protein_id=BAC5 8264.1 BA000031.2 100.00 435 0 0 1 435 805 371 0.0 862
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    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.
    Last edited by RonB; Sep 17 '16, 01:28 PM.

    Comment

    Working...