Question: How To Filter Blastn Results By Alignment Lenght
0
gravatar for 2011101101
5.5 years ago by
2011101101100
2011101101100 wrote:

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 • 4.8k views
ADD COMMENTlink modified 5.5 years ago by Joseph Hughes2.7k • written 5.5 years ago by 2011101101100
1

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

ADD REPLYlink written 5.5 years ago by Istvan Albert ♦♦ 81k

A short python script will do the job.

ADD REPLYlink written 5.5 years ago by Pappu1.9k

Simple awk command will solve this too

ADD REPLYlink written 5.5 years ago by PoGibas4.8k
4
gravatar for Joseph Hughes
5.5 years ago by
Joseph Hughes2.7k
Scotland, UK
Joseph Hughes2.7k wrote:

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 COMMENTlink written 5.5 years ago by Joseph Hughes2.7k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1503 users visited in the last hour