This is a test version of Biostars. For the public version, visit https://www.biostars.org.
combining fastq from different lanes

I have fastq files as follows:

Sample1-1_S13_R1_001.fastq
Sample1-2_S14_R1_001.fastq
Sample1-3_S15_R1_001.fastq
Sample1-4_S16_R1_001.fastq
Sample1-1_S13_R2_001.fastq
Sample1-2_S14_R2_001.fastq
Sample1-4_S16_R2_001.fastq
Sample1-3_S15_R2_001.fastq

I simply cat R1 and R2 but the tool I am using is giving me an error Some files in the fastq path are split by lane, while some are not. This is not supported. My question is is there another alternate to cat that to combine fastq files so that it can avoid this error or combine fatsq masking different lanes. Thanks

sequence

the tool I am using is giving me an error

What kind of error?

error Some files in the fastq path are split by lane, while some are not. This is not allowed

If the tool does not expect samples to run in different lanes then you may have to treat the lane specific replicates as independent inputs. Or edit/replace the lane numbers so there is just one in all fastq headers.

What tool are we looking at here?

why are you 'catting' R1 and R2 ? Simply joining them might indeed result in an error, if you want to have them in a single file you should interleave them.

it seems to me those are just read1 and read2 from a paired-end sequencing.

Presumably OP is cating R1/R2 files in a lane specific manner. It sounds like the tool just does not like having a sample run on multiple lanes.

could be indeed, though it does not show from the example ( if it were to be from different lanes files would be called _002 _003 and such )

likely not helping :) but I've done that dozens of times (= catting lanes together) never had any issue with it. Until we know which tool we're talking here we're just guessing I assume

which tools are you using ? what is the error exactly ? and can you post the command here ?

1 answer

The example file names you give have no lane numbers in them.

It sounds like you might be trying to do this:

cat Sample1-1_S13_R1_001.fastq Sample1-1_S13_R2_001.fastq > Sample1.fastq

This should yield a validly formated fastq, but I don't know of any software that expects to receive paired end data like this. Interleaved, sure some software wants that, but most software can deal with separate files, because that's the default of how Illumina outputs them.

If your files are split by size, doing this:

cat Sample1-1_S13_R1_001.fastq Sample1-1_S13_R1_002.fastq > Sample1.fastq

is probably a smart thing to do. Illumina bcl2fastq can be told to not split fastqs into chunks, but maybe whoever ran it for you didn't run it like that.

Note that you can also cat to fastq.gz files. That's fine.

In short, catting two fastqs together (assuming they are no truncated or somehow botched) should work. If it's not working for you, either your files are botched, or you really shouldn't be catting what you are catting.

Log in to answer this question.