Skip to content

Instantly share code, notes, and snippets.

@alienzj
Forked from l-modolo/reads_length_dist.sh
Created November 28, 2017 06:16
Show Gist options
  • Save alienzj/4687f175ffeebdb4c2e788f227c50d12 to your computer and use it in GitHub Desktop.
Save alienzj/4687f175ffeebdb4c2e788f227c50d12 to your computer and use it in GitHub Desktop.
compute reads length distribution from a fastq file
#!/bin/sh
# compute reads length distribution from a fastq file
awk 'NR%4 == 2 {lengths[length($0)]++} END {for (l in lengths) {print l, lengths[l]}}' file.fastq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment