0

I received my paired end sequences with 4 files per sample, 2 files per read. I want to concatenate the two files of each read and only have R1 and R2 for each sample.

Manually it works:

cat /media/Ea2/Ea2_FKDL220291524-1A_H22M7DSX5_L2_1.fq.gz /media/Ea2/Ea2_FKDL220291524-1A_HYVFNDSX3_L3_1.fq.gz > /media/Ea1/Ea1_concatenated_R1.fq.gz

but I want to do it for multiple sequence files:

Ea1
Ea2
Ea3
etc...

I tried doing it for multiple files for the R1 files first:

cat /media/Ea*/Ea*_*-1A_*_L*_1.fq.gz /media/Ea*/Ea*_*-1A_*_L*_1.fq.gz > /media/Ea*/Ea*_concatenated_R1.fq.gz

it did not work.

I tried giving the command a list with the names of each samples like this:

for i in $(cat /media/list_for_con.txt) do cat /media/$i/$i_*-1A_*_L*_1.fq.gz /media//$i/$i_*-1A_*_L*_1.fq.gz > /media/$i/$i_concatenated_R1.fq.gz

It did not work. Even if it would work it would allot me to adress the R1 and then change it and do the R2 files.

tripleee
  • 175,061
  • 34
  • 275
  • 318

0 Answers0