This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merge The Sam Files For Dexseq

I have RNAseq data for one sample, with two technical replicates. As I know, I need to merge them to get the gene or exon counts.

Now I get the sam files from the two techinical replicates, can I merge the sam files as: cat 1.sam 2.sam > merged.sam and then sort -k1,1 -k2,2 merged.sam?

I want to use the merged sam file for dexseq_counts.py. My sam files don't have header.. Anyone has an idea about that? Thanks..

sam

2 answers

You can just merge the SAM files by "cat" function. Btw I don't understand why you have sam files. It will just fill up your hard drive. Downstream analysis in DEXSeq can accept BAM files. Also I wonder why your sam files did not have headers. Please try using IGV browser to see if your alignment looks fine before DEXSeq. Since you will be wasting lot of time if the counts generated by DEXSeq are wrong.

I need to count the reads on exons by dexseq_counts.py, that need sam files, right?

yes, If you are using DEXSeq_count.py to generate the count files. I always use HTSeq_count.py. I don't see a point why you should not DEXSeq_count.py. You are in right path. Good luck

If they don't have headers, then just concatenating them will work fine. I wonder why they don't have headers though, that's odd. The sort should name sort them correctly. BTW, with many mappers, you can just supply a list of technical replicate files separated by a comma and the mapper will just output a single file with all of the reads (just to save you a step).

My technical replicates are single-end and paired-end, so I think I can't merge them before I map them.

Ah, in that case yes.

Log in to answer this question.