text: user926: I have a problem here with my rna seq data:
  Sequencing details:
  rRNA was removed, followed by cDNA preparation and generation of stranded libraries using the TruSeq Stranded Total RNA Sample Prep Kit. Sequencing performed on the HiSeq2500 platform (Illumina) to generate 2 × 125 bp paired-end reads
  Alignment and preprocessing
  reads were aligned using tophat2(std aligner in pipeline at core (--library-type fr-firststrand), unfortunately the original unaligned files were purged and i only have access to this aligned file which i converted to fastq using following steps
  
  samtools sort -n sample.bam -o sample_sorted.bam
  bedtools bamtofastq -i sample_sorted.bam -fq sample_1.fq -fq2 sample_2.fq (get a lot of mate skipping errors here)
  check for these reads for adapters and trim them and again use hisat2 (with --rna-strandness RF)
  
  trimmed reads
  Reads were trimmed by passing parameters --adapters adapters.file --adapter-trim-end RIGHT --length-dist --threads 12 --adapter-min-overlap 7 --max-uncalled 250 --min-read-length 25 -- to FLEXBAR version 2.4
  adapters for all samples using multiqc
  
  fastqc sequence length pre trimming
  
  fastqc sequence length post trimming
  
  rmats error
  
  Incorrect readLength. sample.bam has a read length of 114, while readLength param is 125
  
  picard error on aligned bam from hisat2)
  
  ProcessExecutor   2 "Not creating insert size PDF as there are duplicated header names: All_Reads"
  
  snapshot of picard insertsize metrics file
  
  Questions
  
  Is my approach flawed at some step?
  why do i get different read lengths error for each sample when i process it through rmats when i specify len as 125?
  why is no histogram being produced when using picard insertsize metrics?
  is normal to see the graph shift to the right after trimming?
  
  insertsize for all samples (data from picard collectinsertsize compiled using multiqc)
  
  
  user77: 
  It's not an unreasonable approach. rMATs is rather picky about its input, but it seems you've noticed that.
  rMATs can't handle trimmed reads. It also can't handle soft-clipped reads. You might as well not trim. You'll get a lower alignment rate, but your only other choice would be to either exclude the trimmed reads or trim everything down to the same length.
  You have a mixture of RF and FR alignments and the plotting script can't handle that.
  Assuming you mean the read length distribution, it's actually shifted to the left, not the right. You had a single length before and a long left tail after trimming.
  
  
original_text: 926: <p>I have a problem here with my rna seq data:</p>
  <h1>Sequencing details:</h1>
  <p>rRNA was removed, followed by cDNA preparation and generation of stranded libraries using the TruSeq Stranded Total RNA Sample Prep Kit. Sequencing performed on the HiSeq2500 platform (Illumina) to generate 2 × 125 bp paired-end reads</p>
  <h1>Alignment and preprocessing</h1>
  <p>reads were aligned using tophat2(std aligner in pipeline at core (<code>--library-type fr-firststrand</code>), unfortunately the original unaligned files were purged and i only have access to this aligned file which i converted to fastq using following steps</p>
  <ol>
  <li><code>samtools sort -n sample.bam -o sample_sorted.bam</code></li>
  <li><code>bedtools bamtofastq -i sample_sorted.bam -fq sample_1.fq -fq2 sample_2.fq</code> (get a lot of mate skipping errors here)</li>
  <li>check for these reads for adapters and trim them and again use hisat2 (with <code>--rna-strandness RF</code>)</li>
  </ol>
  <h1>trimmed reads</h1>
  <p>Reads were trimmed by passing parameters <code>--adapters adapters.file --adapter-trim-end RIGHT --length-dist --threads 12 --adapter-min-overlap 7 --max-uncalled 250 --min-read-length 25 --</code> to FLEXBAR version 2.4</p>
  <h2>adapters for all samples using multiqc</h2>
  <p><a href="https://i.stack.imgur.com/IsVW7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IsVW7.png" alt="enter image description here" /></a></p>
  <h2>fastqc sequence length pre trimming</h2>
  <p><a href="https://i.stack.imgur.com/fPONe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fPONe.png" alt="enter image description here" /></a></p>
  <h2>fastqc sequence length post trimming</h2>
  <p><a href="https://i.stack.imgur.com/3nY5A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3nY5A.png" alt="enter image description here" /></a></p>
  <h2>rmats error</h2>
  <blockquote>
  <p>Incorrect readLength. sample.bam has a read length of 114, while readLength param is 125</p>
  </blockquote>
  <h2>picard error on aligned bam from hisat2)</h2>
  <blockquote>
  <p>ProcessExecutor   <a href="https://i.stack.imgur.com/fPONe.png" rel="nofollow noreferrer">2</a> &quot;Not creating insert size PDF as there are duplicated header names: All_Reads&quot;</p>
  </blockquote>
  <h2>snapshot of picard insertsize metrics file</h2>
  <p><a href="https://i.stack.imgur.com/lgeHk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lgeHk.png" alt="enter image description here" /></a></p>
  <h1>Questions</h1>
  <ol>
  <li>Is my approach flawed at some step?</li>
  <li>why do i get different read lengths error for each sample when i process it through rmats when i specify len as 125?</li>
  <li>why is no histogram being produced when using picard insertsize metrics?</li>
  <li>is normal to see the graph shift to the right after trimming?</li>
  </ol>
  <h1>insertsize for all samples (data from picard collectinsertsize compiled using multiqc)</h1>
  <p><a href="https://i.stack.imgur.com/l3A9I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l3A9I.png" alt="enter image description here" /></a></p>
   77: <ol>
  <li>It's not an unreasonable approach. rMATs is rather picky about its input, but it seems you've noticed that.</li>
  <li>rMATs can't handle trimmed reads. It also can't handle soft-clipped reads. You might as well not trim. You'll get a lower alignment rate, but your only other choice would be to either exclude the trimmed reads or trim everything down to the same length.</li>
  <li>You have a mixture of RF and FR alignments and the plotting script can't handle that.</li>
  <li>Assuming you mean the read length distribution, it's actually shifted to the left, not the right. You had a single length before and a long left tail after trimming.</li>
  </ol>
  