Created
October 21, 2013 00:05
-
-
Save armintoepfer/7076884 to your computer and use it in GitHub Desktop.
Reverse transcribe FASTQ with AWK, one-liner
This file contains 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
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