extracting fasta records from a multi-fasta file based on a list using awk
for i in $(cat gene_list)
do
awk -v RS=">" '($1==a){print ">"$0}' a=$i input.fasta >> out.fa
sed -i '/^$/d' out.fa
done
for i in $(cat gene_list)
do
awk -v RS=">" '($1==a){print ">"$0}' a=$i input.fasta >> out.fa
sed -i '/^$/d' out.fa
done