I need to calculate the median in the fastq file, how can I do this with awk or bioawk?
Straight up `awk` soliution would be:

    cat *.fq  | awk 'NR % 4 == 0 { print length($1) } ' | awk ' { a[i++]=$1; } END { print a[int(i/2)]; }'

I would do it with `bioawk` and `datamash` 


    cat *.fq  | bioawk -c fastx '{ print(length($seq)) }' | datamash median 1

you can also implement a better median in awk as shown here: 

*  https://stackoverflow.com/questions/6166375/median-of-column-with-awk

that works like this:

     cat *.fq  | bioawk -c fastx '{ print(length($seq)) }' | bioawk ' { a[i++]=$1; } \
                           END { x=int((i+1)/2); if (x < (i+1)/2) print (a[x-1]+a[x])/2; else print a[x-1]; }'
