<p>I have paired-end RNA-Seq data - read1 and read2 - stored in the same fastq file.</p>

<p>I&#39;d like to align the reads using tophat.</p>

<p>Do I have to separate the data into two different files before running tophat?</p>

If you have any pattern in the read name ( like `1:N:####` or `/1` or `_1` etc) you could use the <a href="http://homes.cs.washington.edu/~dcjones/fastq-tools/fastq-grep.html">fastq-grep</a> to match the pattern to extract the R1 and R2 into two separate files.

Or a simple Awk patter match will do. something like:

    zcat fastq.gz | paste - - - - | awk '{ if $1 ~ /< R1 pattern here>/ { print $1"\n"$2"\n"$3"\n"$4" }' | gzip > Read_1.fastq.gz

    zcat fastq.gz | paste - - - - | awk '{ if $1 ~ /< R2 pattern here>/ { print $1"\n"$2"\n"$3"\n"$4" }' | gzip > Read_2.fastq.gz

But they need to be kept in order, if they are not.