This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merging bam files

Hi,

I am running some RNA-Seq analysis on our institutional cluster using the Tophat-Cufflinks protocol, while a colleague is analyzing the same data on usegalaxy.org using the Tuxedo protocol. When he tried to align the trimmed paired-end fastq files using hisat2, he received an error saying HISAT2 error: fewer reads in file specified with -2 than in file specified with -1 (but fastqc revealed this to not be true). So, to confirm whether there was anything wrong with the run, we ran hisat2 as single-end data (submitted forward and reverse reads separately), and it ran successfully. I went through a couple of posts and found out that the error could be due to hisat2 not running properly, and could have nothing to do with the number of reads.

Now, our option is to try running hisat2 again with both reads, or to merge the forward and reverse bam files into one. We found one tool -

Convert, Merge, Randomize bam files

I was wondering whether it would serve my purpose, or would it be better to use any other tool, or try to align both reads

Hoping to gain some insight on this one

Thanks in advance

bam merge rna-seq

It seems to be a problem of the trimming rather than the aligner itself, can you share a little bit more on what trimming strategy are you using?

1 answer

I would refrain from aligning the data in single-end mode. Usually, splicing can be much better resolved with PE-data, and also you might see more ambiguous/erroneous alignments, e.g. to pseudogenes.

I would try to check first, if your FastQ files are possibly out of order. You can use e.g. fasten validate for this:

cat R1.fastq R2.fastq | fasten_shuffle | fasten_validate --paired-end

Alternatively, directly run bbmap repair on the data:

repair.sh in1=broken1.fq in2=broken2 out1=fixed1.fq out2=fixed2.fq outs=singletons.fq repair

Log in to answer this question.