Skip to content

Instantly share code, notes, and snippets.

@armintoepfer
Created October 21, 2013 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save armintoepfer/7076884 to your computer and use it in GitHub Desktop.
Save armintoepfer/7076884 to your computer and use it in GitHub Desktop.
Reverse transcribe FASTQ with AWK, one-liner
awk 'BEGIN {FS=""} {if (NR%4 == 2) { for (i = NF; i >= 1; i = i - 1) { if (x == "A") { printf "T"; } else if ($i == "C") { printf "G";} else if ($i == "G") { printf "C";} else if (x == "T") { printf "A";} else if (x == "N") { printf "N";} } printf "\n"; } else print $0 }' input.fastq > rt.fastq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment