...
Code Block |
---|
title | Untangle shuffled FASTQ file |
---|
|
seqtk seq -l0 Shuffled.fq > Shuffled_4line.fq| gawk '{if ((NR-1) % 8 < 4) print >> "Separate_1.fq"; else print >> "Separate_2.fq"}'
Shuffled_4line.fq
|
After some operations on separate R1 and R2 FASTQ files, paired-end records will no longer be matched, and you need to eliminate records that are no longer matched.
Code Block |
---|
title | Convert FASTQ to one-line-per-record tabular file |
---|
|
gawk '{printf((NR % 4 == 0) ? $0"\n" : $0"\t")}' Sample.fastq > Sample_1-line.tab
|
Code Block |
---|
title | Take matching paired-end reads |
---|
|
sort Sample_1-line_R1.fq > Sample_1-line_sorted_R1.tab
sort Sample_1-line_R2.fq > Sample_1-line_sorted_R2.tab
join Sample_1-line_sorted_R1.tab Sample_1-line_sorted_R2.tab > Sample_1-line_joined.tab
|
Code Block |
---|
title | Write joined one-line FASTQ information to two FASTQ files |
---|
|
gawk '{printf($1"\n"$2"\n"$3"\n"$4"\n") >> "Sample_matched_R1.fq"; printf($1"\n"$5"\n"$6"\n"$7"\n") >> "Sample_matched_R2.fq"}' Sample_1-line_joined.tab
|