Created
February 23, 2018 12:54
-
-
Save tbrittoborges/8c231f9daf2c580a283f824bff576b64 to your computer and use it in GitHub Desktop.
calculates the average and sd read length from https://www.biostars.org/p/243552/#243563
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for f in raw_reads{39..50}.fq.gz | |
| do | |
| echo "$f " | |
| gzip -cd $f | awk 'BEGIN { t=0.0;sq=0.0; n=0;} ;NR%4==2 {n++;L=length($0);t+=L;sq+=L*L;}END{m=t/n;printf("total %d avg=%f stddev=%f\n",n,m,sq/n-m*m);}' | |
| done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment