I used samtools to extract uniquely mapped reads from a Tophat "accepted_hits.bam" file by command :
samtools view q 10 accepted_hits.bam > UniqueHits.bam
but during Cuffdiff procedure it makes this error
Cufflinks requires that if your file has SQ records in
the SAM header that they appear in the same order as the chromosomes names
in the alignments.
If there are no SQ records in the header, or if the header is missing,
the alignments must be sorted lexicographically by chromsome
name and by position.
1- Is my samtools extraction command makes Sam file in output?? And if yes
2-Can I use below command for creating bam output?? (and then Sorted bam from that)
samtools view -b -q 10 accepted_hits.bam > Unique.bam samtools sort Unique.bam Unique.sorted