How To Filter Blastn Results By Alignment Lenght
1
0
Entering edit mode
10.8 years ago
2011101101 ▴ 110

I want to filter the blastn result according to cutoff "alignment length more than 50bp , the gap max length less than 50bp in the alignment region and evalue less than 0.01.like this ,the cdna map to genome ,the intron length less than 50bp. some blastn result in the outfmt 6

gi|312461686|gb|HP608955.1|    gi|359614520|gb|JP881116.1|    94.86    564    25    3    613    1173    1764    1202    0.0     880
gi|312461686|gb|HP608955.1|    gi|359614520|gb|JP881116.1|    98.00    150    2    1    1447    1596    1208    1060    5e-72     259
gi|312461686|gb|HP608955.1|    gi|359614520|gb|JP881116.1|    95.17    145    7    0    1831    1975    1060    916    4e-63     230
gi|509468259|gb|GAJL01013922.1|    gi|391056808|gb|JV874923.1|    99.41    170    1    0    40    209    426    257    4e-88     309
gi|509468259|gb|GAJL01013922.1|    gi|391056808|gb|JV874923.1|    100.00    36    0    0    1    36    450    415    3e-15    67.6

the filter result

gi|509468259|gb|GAJL01013922.1|    gi|391056808|gb|JV874923.1|    99.41    170    1    0    40    209    426    257    4e-88     309
gi|509468259|gb|GAJL01013922.1|    gi|391056808|gb|JV874923.1|    100.00    36    0    0    1    36    450    415    3e-15    67.6
blastn • 8.4k views
ADD COMMENT
1
Entering edit mode

you need to specify what your columns are - also simplify the question is not clear what you want

ADD REPLY
0
Entering edit mode

A short python script will do the job.

ADD REPLY
0
Entering edit mode

Simple awk command will solve this too

ADD REPLY
5
Entering edit mode
10.8 years ago
Joseph Hughes ★ 3.0k

If this is blast tabular output, then the columns correspond to the following variables: query, subject, %id, alignment length, mismatches, gap openings, query start, query end, subject start, subject end, Evalue, bit score

You want to sort on alignment length greater than 50 (column 4) and gap opening less than 50 (column 6) and Evalue (column 11) less than 0.01, then using a simple awk command as suggested by Pgibas from your input file blast_results.txt:

awk '{if ($4>=50 && $6 <1 && $11<0.01)print $1 }' blast_results.txt
ADD COMMENT

Login before adding your answer.

Traffic: 2069 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6