I am trying to sort my paired-end data so all the read pairs are adjacent and I'm trying to use the sort function of samtools but I'm getting errors? Does samtools sort not work with .sam files?
samtools sort -n DICDvenus1_STARAligned.out.sam DICDvenus1_SortedReads.sam
[bam_header_read] EOF marker is absent. The input is probably truncated.
[bam_header_read] invalid BAM binary header (this is not a BAM file).
Segmentation fault (core dumped)
samtools sort -n -o sam DICDvenus1_STARAligned.out.sam DICDvenus1_SortedReads.sam
open: No such file or directory
[bam_sort_core] fail to open file sam
Do you know if the repair utility of featureCounts is another way to sort the reads?
It wouldn't surprise me, but I have not used that program.