BLAST Linearizer

About

This script implements a lossless transformation of BLAST output by converting each multi-block alignment into a single block (example below). The result is easier to parse, easier to read on large display and occupies slightly less space, while still containing all information.

This tool was made by Kirill Kryukov in Saitou lab, NIG. I share it with the hope that it can be useful, but without any warranties.

This script was tested with the default pairwise output format (-outfmt 0) of blastn, blastx and tblastx from BLAST+ 2.2.25 package, and should probably work with any other version. Please report any issues or incompatibilities.

News

2012-01-12 – This page is created.

Download

(Distributed under the zlib/libpng license, see the source file for details)

Usage

perl blast_linearizer.pl <blastoutput.txt >linear.txt

You can also process BLAST output on the fly as it is generated. Simply append

| perl blast_linearizer.pl >linear.txt

to the end of your search command instead of specifying the output file.

Example

Input (fragment):

Query 1336 WRDRNAFAMQLAEFQNVRDSVNLQYDHDSQLLEKLQRTNVYNDTFCISHDGKFGTINGLR 1515 +RD +A Q E + +V Q + ++L+ N + TF I +G G IN R Sbjct 6879491 YRDYSALKRQQLELLDQLGNVENQLQYARVQRDRLKEINCFTATFEIWVEGPLGVINNFR 6879670 Query 1516 LGRLSNVPVDWPEINAAWGHTVLLLQTVADRLGYKFQGYELQPMGSTS 1659 LGRL V V W EIN AWG LLL T+A+ +G +FQ Y L P G+ S Sbjct 6879671 LGRLPTVRVGWNEINTAWGQAALLLLTLANTIGLQFQRYRLIPCGNHS 6879814

Output (fragment):

Query 1336 WRDRNAFAMQLAEFQNVRDSVNLQYDHDSQLLEKLQRTNVYNDTFCISHDGKFGTINGLRLGRLSNVPVDWPEINAAWGHTVLLLQTVADRLGYKFQGYELQPMGSTS 1659 +RD +A Q E + +V Q + ++L+ N + TF I +G G IN RLGRL V V W EIN AWG LLL T+A+ +G +FQ Y L P G+ S Sbjct 6879491 YRDYSALKRQQLELLDQLGNVENQLQYARVQRDRLKEINCFTATFEIWVEGPLGVINNFRLGRLPTVRVGWNEINTAWGQAALLLLTLANTIGLQFQRYRLIPCGNHS 6879814

If you have any questions, comments or suggestions, please contact me.


  © 2012 Kirill Kryukov
This page is available under the CC BY 3.0 License