Skip to content

Instantly share code, notes, and snippets.

@berguner
berguner / interleave_gzipped_fastq.sh
Last active March 16, 2023 14:03
Take a pair of fastq.gz files and produce interleaved fastq output
#!/bin/bash
# This script can be usd to interleave paired fastq.gz files to produce interleaved fastq stdoutput.
# This is quite useful if you don't want to create temporary fastq files (i.e. trimmed.fastq.gz) to run aligners
# Use bash not sh
READ1=$1
READ2=$2
paste <(zcat $READ1 | paste - - - - ) <(zcat $READ2 | paste - - - - ) | tr '\t' '\n'