Perfect. This works. Sorry but could explain why this change works? Thanks.
• 0 views
•
link
Hi, I am using bioawk to extract entries in a fasta file based on partial matches on IDs. Now normally I can use a bash variable in awk by assigning it using -v. However, when using bioawk, the variable does not seem to be stored as gene, and as such I get no matches. I have tested this using the actual ID name instead of the variable and it works, so it must be an issue with assigning the variable. What am I doing wrong?
for i in ${IDs[@]}; do cat humanGeneOrthologs.fa | bioawk -v gene="$i" -c fastx '$name ~ /gene/ \
{ print ">"$name"\n"$seq"\n"; }'; done
Log in to answer this question.