<p>What you did should work.  You don't need to decompress and recompress.</p>
<p>I'd check the files.  Were they trimmed?  Can you get the top, say 1000 lines of the merged files to work?  (You will need to decompress to count lines accurately)</p>

CC BY-SA 4.0
2020-11-17T21:03:26.020Z
OP seems to have two distinct `V3000*` prefixes - could that be the cause for the tool to fail?
Ram RS
CC BY-SA 4.0
2020-11-17T23:26:21.023Z
Who knows?  I'm not familiar with the downstream tool, and no one can troubleshoot "it failed".  More details are needed.
swbarnes2
CC BY-SA 4.0
2020-11-17T18:54:29.767Z
2020-11-17T18:54:29.767Z
swbarnes2
<p>I have the following files:</p>
<pre><code>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
</code></pre>
<p>the ending defines whether it is forward _1 or reverse _2.</p>
<p>I want to merge all the <code>_1.fq.gz</code> files into like <code>Merge1_.fq.gz</code> and the same for <code>_2.fq.gz</code></p>
<p>I tried doing <code>cat *_(number).fq.gz &gt; merged(number).fq.gz</code> 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.</p>
<p>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.</p>

CC BY-SA 4.0
2020-11-17T08:18:21.203Z
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.
zorbax
CC BY-SA 4.0
2020-11-17T09:00:32.760Z
There's discussion of this topic here: https://www.biostars.org/p/81924/
jared_mamrot
CC BY-SA 4.0
2020-11-18T12:56:22.577Z
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`.
Kamil S Jaron
<genome><fastq><bash>
Merging several fq.gz files or R1 and R2 classes into a single one
# Merging several fq.gz files or R1 and R2 classes into a single one

(Asked by: username_0 on 2020-11-17)

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.

**Tags:** genome, fastq, bash
> **Comments:**
> **username_1**: 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.  
> **username_2**: There's discussion of this topic here: https://www.biostars.org/p/81924/  
> **username_3**: 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`.  

---

## 1 answers

### Answer by username_4 on 2020-11-17. Score: 2

What you did should work. You don't need to decompress and recompress.

I'd check the files. Were they trimmed? Can you get the top, say 1000 lines of the merged files to work? (You will need to decompress to count lines accurately)

> **Comments:**
> **username_5**: OP seems to have two distinct `V3000*` prefixes - could that be the cause for the tool to fail?  
> **username_4**: Who knows?  I'm not familiar with the downstream tool, and no one can troubleshoot "it failed".  More details are needed.  

---

