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
Martin@529
     1
#! /bin/bash
Martin@529
     2
Martin@598
     3
test $# = 2 || {
Martin@598
     4
    cat <<EOF
Martin@598
     5
Usage: $0 x.fastq y.fastq
Martin@598
     6
Martin@598
     7
Read 2 fastq files, and write them interleaved.
Martin@598
     8
Assumes 1 fastq per 4 lines, i.e. no line wrapping.
Martin@598
     9
EOF
Martin@598
    10
    exit
Martin@598
    11
}
Martin@529
    12
Martin@529
    13
paste <(cat "$1" | paste - - - -) <(cat "$2" | paste - - - -) | tr '\t' '\n'
Martin@529
    14
Martin@529
    15
# Is this better?
Martin@529
    16
#paste <(zcat -f "$1"|paste - - - -) <(zcat -f "$2"|paste - - - -)|tr '\t' '\n'
Martin@529
    17
Martin@529
    18
# This does not interpret "-" as stdin:
Martin@529
    19
#paste <(paste - - - - < "$1") <(paste - - - - < "$2") | tr '\t' '\n'