#!/bin/bash
usage()
{ echo " "; echo "#################################################"; echo " ";
printf "# "; echo "Usage: ./`basename $0` -i input.fa -o out.fa"
echo " "; echo "#################################################"; echo " ";
exit 1
}
[ $# -eq 0 ] && usage
while getopts :i:o: OPTION
do
case $OPTION in
i)
input_file=$OPTARG
;;
o)
output_file=$OPTARG
;;
\?)
usage
;;
esac
done
awk '{if (NR%4==1) {print ">" substr($0,2)}}{if (NR%4==2) {print}}' $input_file > $output_file
time ./awk_fq_to_fa.sh -i ../sample_data/fastQ_data/reads.left.fq -o test.fa
real 0m0.065s
user 0m0.039s
sys 0m0.014s
time perl fastQ_to_fastA.pl -I ../sample_data/fastQ_data/reads.left.fq > test_1.fa
real 0m1.562s
user 0m1.550s
sys 0m0.004s