So I have used BWA to align fastq files (mate pair, Illumina HiSeq) to a reference sequence. I then extracted the unmapped reads using samtools which gives me a bam file.
I would like to take this bam file and map it back to my reference sequence using BWA again. However bam files don't seem compatible - I do get an output sam file but the flagstat and other downstream tests then do not work. I have tried converting the bam to fastq and to fasta, same story. Though I get an output sam file from BWA alignment, I can either not visualize the sam file or downstream tests yield no results?
Is there something I'm missing here? Is it the paired end reads that are messing things up? Has anyone done something like this before?