i am using this command
samtools view -bh -F 2 FILE.bam mt > out.bam
to get the discordant reads(one end aligns to mitochondria and the other to chromosome) and also those reads that align to (both ends) mitochondria only. out put file is a bam file. but when i want get fastq out of this bam file using command
bamToFastq -i out.bam -fq out.1.fq -fq2 out.2.fq
it shows that there are so many reads that are marked as pairs but the but the other pair is not in the bam file. the error looks like this
*WARNING: Query HWI-ST170_235:2:22:12110:179082#0 is marked as paired, but it's mate does not occur next to it in your BAM file. Skipping.
can anyone plz tell what,s going wrong.