I have two bam file for each sample which are paired end sequenced. I need to extract raw counts from these bam files which they look like S1.bam and s2.bam for each sample. I founf these by a search but still don't know how to move forward as they are paired end and two bam files.
featureCounts -T 4 -s 2 \ -a ~/annotations/Homo_sapiens.GRCh38.104.gtf
\ -o ~/results/counts/s1_featurecounts.txt \
~/results/STAR/bams/*.out.bam
Apparently as they are paired, they need to be sorted by
samtools sort
but I don’t know how to make a single bam file from the two paired that I already have. And how to insert it in this formula. Any help would be appreciated.
Thanks for your quick resoponse ATpoint , but how can I add my two paired bam files here in this formula?
It's the
~/results/STAR/bams/*.out.bam
part, it means "use all bam files". Alternatively replace that with the paths to your bam files.I hope you did not align your paired-end reads independently i.e. Read 1 is in S1.bam and R2 is in S2.bam. That would be incorrect. You have to align paired-end data in a single alignment run.
I didn't align anything. I just put two end paired bam files that I had in a folder and run the above code by changing only .out.bam to .bam. This worked but I don't know if this is correct or not.
BAM files are not paired-end but they can have alignments that came from a paired-end dataset. Hopefully that is clear.
Two bams implies two different samples. You could combine them if you are sure they are the same thing, but it doesn't sound like you are sure.