# Merging several fq.gz files or R1 and R2 classes into a single one

I have the following files:

V300066187_L4_B5RDBATtnuRAAAAA-408_2.fq.gz
V300066187_L4_B5RDBATtnuRAAAAA-408_1.fq.gz
V300068047_L2_B5RDBATtnuRAAAAA-408_2.fq.gz
V300068047_L2_B5RDBATtnuRAAAAA-408_1.fq.gz
V300068047_L2_B5RDBATtnuRAAAAA-407_2.fq.gz
V300068047_L2_B5RDBATtnuRAAAAA-407_1.fq.gz
V300068047_L2_B5RDBATtnuRAAAAA-405_1.fq.gz
V300068047_L2_B5RDBATtnuRAAAAA-406_1.fq.gz
V300068047_L2_B5RDBATtnuRAAAAA-405_2.fq.gz
V300066187_L4_B5RDBATtnuRAAAAA-407_2.fq.gz
V300066187_L4_B5RDBATtnuRAAAAA-407_1.fq.gz
V300066187_L4_B5RDBATtnuRAAAAA-406_2.fq.gz
V300066187_L4_B5RDBATtnuRAAAAA-406_1.fq.gz
V300066187_L4_B5RDBATtnuRAAAAA-405_2.fq.gz
V300066187_L4_B5RDBATtnuRAAAAA-405_1.fq.gz


the ending defines whether it is forward _1 or reverse _2.

I want to merge all the _1.fq.gz files into like Merge1_.fq.gz and the same for _2.fq.gz

I tried doing cat *_(number).fq.gz > merged(number).fq.gz and when I used the merges for assembly with MaSurca, it didn't detect any reads and failed. I used one pair and it worked well, but the genome size was smaller than expected, real size = 2 GB, estimated = 1.8GB.

Would appreciate how to solve this issue and use all my short reads for assembly - I need to input one file for all forward reads and one file for all reverse reads.

• you can use paired reads if you define the sample names in the config file. Check the sr_config_example.txt in your current installation folder. Edit the line PE= pe 500 50 with your file names, remove the JUMP line for mate pair. Nov 17 '20 at 8:18
• There's discussion of this topic here: biostars.org/p/81924 Nov 17 '20 at 9:00
• Hi there, cat *_(number).fq.gz > merged(number).fq.gz should have worked. Perhaps one of the files is corrupted? You can check that using gzip -t. Nov 18 '20 at 12:56

• OP seems to have two distinct V3000* prefixes - could that be the cause for the tool to fail? Nov 17 '20 at 21:03