Skip to content

Instantly share code, notes, and snippets.

@l-modolo
Created October 31, 2013 09:31
Show Gist options
  • Save l-modolo/7246864 to your computer and use it in GitHub Desktop.
Save l-modolo/7246864 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