This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Trying to filter blast results

Hi, I'm trying to filter my blast results but I keep getting an error.

awk: 1: unexpected character '.'

I thought it wwas the files name so I changed the points to underscores:

L_brevis_NG-45673_blastVF1_2.txt

But I keep getting the same error. This is the command I'm running:

for file in *.txt; do echo $file; awk '{alg = $4/($8-$7)}{size = ($10-$9)/($8-$7)}(size>=0.75 && size<=1.5 && alg>0.6){print $1, $2, $3}' | awk '{id = $1; getline} ($1!=id){print $0}'$file >> $file.filtered; done
filters commandline blastresults

1 answer

The first awk isn't even getting any input. Perhaps you want to use your $file as input for it by typing $file after the command? .. awk '{whatever}' "$file" | awk '{whatever}' .. BTW you should always quote your bash variables..

Thank you very much for your help, it worked fine after fixing it.

Log in to answer this question.