Hello everyone,
I have question please
I have bam file containing unmapped reads that I want to assemble.
I tried samtools fastq to obtain the two files forward and reverse
I did this command
samtools fastq -1 wPru_1_Unmapped_reads.fastq -2 wPru_2_Unmapped_reads.fastq wPru_Unmapped_reads.bam
but when I wanted to perform the assembly (shovill) it didn't work it shows that the number of forward is larger than the number of reverse reads
The number of left read-pairs is larger than the number of right read-pairs
my objective now is how to extract forward and reverse reads from bam file
Thank you very much
How did you obtain the bam file with unmapped reads?
What I suspect is that in the unaligned bam file there will be reads pairs for which one is mapped and the other not , and if the bam was created not taking this into account it might not work the split them in equal numbers.
Thank you very much for your answer i did this command to obtain unmapped reads
i save all the files so i can fix the error in any step i mapped my reads against the eference using bowtie2 after that i ransfer the sam file to bam file and i extracted the unmapped reads from bam file then ai tranformed bam file to two fastq files using the command in the question
don't know the specifics from the top of my head but I don't think that the samtools cmdline will do this correctly. If will process all reads as separate entities (so not taking the PE info into account).
alternatively have a look at the
bbmap
software, that you can specificly configure to write out all kinds of read mapping resultsOkay , thank you very much
A small educational note: I added (code) markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below: