I have a folder of a plate run from an illumina machine, which in it has many folders of different samples each with four files from illumina. I want to combine the two left R1 files to one gz file and combine the two right R2 files to one file for each sample (folder). I can't see an automated version rather than just gzip each subfolder in turn but likely there is a bash way which completely missing?
i.e. within folder "plateK"
Sample1_folder
sampAR1_a.gz, SampAR1_b.gz, SampAR2_a.gz, SampAR2_b.gz
Sample2_folder
sampBR1_a.gz, sampBR1_b.gz, sampBR2_a.gz, sampBR2_b.gz
I think that's not really a bioinformatics question, however you can use
tar
with--include
option,tar -c -f R1.tar --include='*R1_*.gz'
or similar should work, seeman tar
.