scripts/fastq-interleave
author Martin C. Frith
Fri Jun 02 18:40:29 2017 +0900 (2017-06-02)
changeset 863 6a4915d5b5cb
parent 529 dc2c88c11662
child 872 a530b1ee48f4
permissions -rwxr-xr-x
last-dotplot: get bp-per-pixel faster
     1 #! /bin/bash
     2 
     3 test $# = 2 || {
     4     cat <<EOF
     5 Usage: $0 x.fastq y.fastq
     6 
     7 Read 2 fastq files, and write them interleaved.
     8 Assumes 1 fastq per 4 lines, i.e. no line wrapping.
     9 EOF
    10     exit
    11 }
    12 
    13 paste <(cat "$1" | paste - - - -) <(cat "$2" | paste - - - -) | tr '\t' '\n'
    14 
    15 # Is this better?
    16 #paste <(zcat -f "$1"|paste - - - -) <(zcat -f "$2"|paste - - - -)|tr '\t' '\n'
    17 
    18 # This does not interpret "-" as stdin:
    19 #paste <(paste - - - - < "$1") <(paste - - - - < "$2") | tr '\t' '\n'