Dear bioinformaticians,
I have a problem with awk and scientific notation of values.
I want to use awk to select rows based on the min value of $5 to keep only one ID of $1 ::
Chrpa1_10100 2434 PF00063 des 3.9E-21 IPR001609
Chrpa1_10100 2434 PF03547 des 4.5E-7 IPR004776
Chrpa1_10100 2434 PF07857 des 3.3E-7 IPR012435
Chrpa1_10100 2434 PF13516 des 0.085 IPR001611
in this particular case, I want :
Chrpa1_10100 2434 PF00063 des 3.9E-21 IPR001609
If I do :
cat file |sort -k1,1|uniq| awk -F'\t' '$5 > max[$1] { max[$1]=$5; row[$1]=$0 } END { for (i in row) print row[i] }'
but I want this one :
Chrpa1_10100 2434 PF13516 des 0.085 IPR001611
Thank you in advance,
Cheers