<p>I have RNA seq data of 12 samples (paired end, so 24 files)  and I ran tophat2 for alignment on all of them which gave me one bam file for all the samples. Now I need separate bam files for all the samples. Can I spilt them from the one I have or I have to do tophat2 for all the samples separately? If yes, how to do it.</p>
<p>I need them for FRASER (splicing detction) I would also appreciate if anyone used FRASER before could help me a bit to get started. I am working with plant data for the first time.</p>
<p>The command I used</p>
<pre><code>tophat2 -p 40 \
    -o tophat_output_final bowtie_indexes/Medicago1/Medicago \
    NRNSA_S103_R1_001.fastq.gz,NRNSB_S107_R1_001.fastq.gz,\
      NRNSC_S111_R1_001.fastq.gz,NRSA_S104_R1_001.fastq.gz,\
      NRSB_S108_R1_001.fastq.gz,NRSC_S112_R1_001.fastq.gz,\
      RNSA_S105_R1_001.fastq.gz,RNSB_S109_R1_001.fastq.gz,\
      RNSC_S113_R1_001.fastq.gz,SRAB_S106_R1_001.fastq.gz,\
      SRB_S110_R1_001.fastq.gz,SRC_S114_R1_001.fastq.gz \
    NRNSA_S103_R2_001.fastq.gz,NRNSB_S107_R2_001.fastq.gz,\
      NRNSC_S111_R2_001.fastq.gz,NRSA_S104_R2_001.fastq.gz,\
      NRSB_S108_R2_001.fastq.gz,NRSC_S112_R2_001.fastq.gz,\
      RNSA_S105_R2_001.fastq.gz,RNSB_S109_R2_001.fastq.gz,\
      RNSC_S113_R2_001.fastq.gz,SRAB_S106_R2_001.fastq.gz,\
      SRB_S110_R2_001.fastq.gz,SRC_S114_R2_001.fastq.gz
</code></pre>

CC BY-SA 4.0
2021-08-14T18:40:42.640Z
Did you assign read groups while aligning? Can you add the command that you used with tophat2?
Wouter De Coster
CC BY-SA 4.0
2021-08-16T02:08:57.703Z
Hi Wouter De Coster, I have added the command in the question itself. I don't know what you mean by assigning read groups?
Dixi Modi
CC BY-SA 4.0
2021-08-16T18:06:02.647Z
The way you aligned them you can not split them in separate samples. You should have run Tophat2 for each sample separately.
Wouter De Coster
CC BY-SA 4.0
2021-08-17T01:53:36.753Z
Thank you, Wouter De Coster I have 3 replicates of each treatment. so 4 treatments x 3 replicates =12 files.

Should I merge the replicates or just go for separate alignment for each sample?
Dixi Modi
CC BY-SA 4.0
2021-08-17T19:22:39.900Z
Yes, separate alignments for each (biological) replicate
Wouter De Coster
<rna-seq><sam><multiple-sequence-alignment>
Splitting .bam files into separate samples for tophat2
# Splitting .bam files into separate samples for tophat2

(Asked by: username_0 on 2021-08-14)

I have RNA seq data of 12 samples (paired end, so 24 files)  and I ran tophat2 for alignment on all of them which gave me one bam file for all the samples. Now I need separate bam files for all the samples. Can I spilt them from the one I have or I have to do tophat2 for all the samples separately? If yes, how to do it.
I need them for FRASER (splicing detction) I would also appreciate if anyone used FRASER before could help me a bit to get started. I am working with plant data for the first time.
The command I used
tophat2 -p 40 \
    -o tophat_output_final bowtie_indexes/Medicago1/Medicago \
    NRNSA_S103_R1_001.fastq.gz,NRNSB_S107_R1_001.fastq.gz,\
      NRNSC_S111_R1_001.fastq.gz,NRSA_S104_R1_001.fastq.gz,\
      NRSB_S108_R1_001.fastq.gz,NRSC_S112_R1_001.fastq.gz,\
      RNSA_S105_R1_001.fastq.gz,RNSB_S109_R1_001.fastq.gz,\
      RNSC_S113_R1_001.fastq.gz,SRAB_S106_R1_001.fastq.gz,\
      SRB_S110_R1_001.fastq.gz,SRC_S114_R1_001.fastq.gz \
    NRNSA_S103_R2_001.fastq.gz,NRNSB_S107_R2_001.fastq.gz,\
      NRNSC_S111_R2_001.fastq.gz,NRSA_S104_R2_001.fastq.gz,\
      NRSB_S108_R2_001.fastq.gz,NRSC_S112_R2_001.fastq.gz,\
      RNSA_S105_R2_001.fastq.gz,RNSB_S109_R2_001.fastq.gz,\
      RNSC_S113_R2_001.fastq.gz,SRAB_S106_R2_001.fastq.gz,\
      SRB_S110_R2_001.fastq.gz,SRC_S114_R2_001.fastq.gz

**Tags:** rna-seq, sam, multiple-sequence-alignment
> **Comments:**
> **username_1**: Did you assign read groups while aligning? Can you add the command that you used with tophat2?  
> **username_0**: Hi Wouter De Coster, I have added the command in the question itself. I don't know what you mean by assigning read groups?  
> **username_1**: The way you aligned them you can not split them in separate samples. You should have run Tophat2 for each sample separately.  
> **username_0**: Thank you, Wouter De Coster I have 3 replicates of each treatment. so 4 treatments x 3 replicates =12 files.  Should I merge the replicates or just go for separate alignment for each sample?  
> **username_1**: Yes, separate alignments for each (biological) replicate  

---

## 0 answers

