in reply to concatenate/stitch multiple GZip fastq files and output combined gzip file

G'day Bioinfocoder,

Welcome to the Monastery.

Here's 'pm_1149165_zip_merge.pl', which appears to do what you want.

#!/usr/bin/env perl use strict; use warnings; use autodie qw{:all}; open my $gz_pipe, '|-', 'gzip >> pm_1149165_all.gz'; while (<>) { open my $zcat_pipe, '-|', "zcat $_"; print $gz_pipe $_ while <$zcat_pipe>; }

Here's a sample run (with minimal test data):

$ zcat pm_1149165_1.gz q w e $ zcat pm_1149165_2.gz a s d $ zcat pm_1149165_3.gz z x c $ cat pm_1149165_list pm_1149165_1.gz pm_1149165_2.gz pm_1149165_3.gz $ ls -l pm_1149165_all.gz ls: pm_1149165_all.gz: No such file or directory $ pm_1149165_zip_merge.pl pm_1149165_list $ ls -l pm_1149165_all.gz -rw-r--r-- 1 ken staff 38 3 Dec 11:44 pm_1149165_all.gz $ zcat pm_1149165_all.gz q w e a s d z x c

I'll leave you to add in argument checking, usage message, and similar niceties.

— Ken