My RNAseq data contains reads from two different organisms (a host and a pathogen). I wish to separate these reads so I can work on both species separately. I plan to do a de novo assembly on the host reads, which requires the reads to be in fastq format, not bam format.
In order to separate the reads, I have aligned to the pathogen genome using tophat2, which produced an unmapped.bam file containing the host reads. I used samtools sort to sort the bam file, then ran BEDtools bamtofastq to recreate the fastq files containing only the host reads. However, when I run bed tools I always get an empty output file. Looking at the error messages, this is because there are unpaired reads in the bam file. I ran tophat2 with the 'no-mix' parameter, which should prevent the reads from being separated but I still get unpaired reads in my unmapped.bam file.
I'm pretty stumped, does anyone have any experience in using bedtools bamtofastq? Or maybe a better suggestion for separating reads from two different organisms?
Thank you!
In order to separate the reads, I have aligned to the pathogen genome using tophat2, which produced an unmapped.bam file containing the host reads. I used samtools sort to sort the bam file, then ran BEDtools bamtofastq to recreate the fastq files containing only the host reads. However, when I run bed tools I always get an empty output file. Looking at the error messages, this is because there are unpaired reads in the bam file. I ran tophat2 with the 'no-mix' parameter, which should prevent the reads from being separated but I still get unpaired reads in my unmapped.bam file.
I'm pretty stumped, does anyone have any experience in using bedtools bamtofastq? Or maybe a better suggestion for separating reads from two different organisms?
Thank you!
Comment