BAM mapped and unmapped files to fq.gz paired-end reads
I would like to know if I could merge mapped and unmapped files to generate fq.gz paired-end reads and If the last one has the same content as the original fq.gz file that I used to make the alignment.
• 2,124 views
•
link
0 answers
No answers yet.
Log in to answer this question.
It is unclear what you mean. So you have a BAM file and want to make a fastq file, is that correct? What does
If the last one has the same content as the original fq.gz file that I used to make the alignment.mean?In general, you first name-sort or collate the BAM file, and then simply use
samtools fastq.So sorry If I wasn´t clear, I was talking about the original fasqt.gz reads that I got from the sequencing. My question was focused on possible changes between the original fast.gz and the new fast.qz from mapped and unmapped bam.
You should check if the aligned BAM files you have contain unmapped reads. If it does then you just need that file to re-generate the paired-end fastq reads that went into the alignment.
I am sorry if I don't have too much experience using bioinformatic tools but I would like to make the following question. I used BWA to make the alignment, I know I can get unmapped reads from my bam output, that means the output file contains both kind of reads (mapped and unmapped), right?
Thank you so much for your answer!
If you are able to get unmapped reads from your BAM file (e.g. with A: How To Filter Mapped Reads With Samtools ) then yes. Unmapped reads will have a
*in column number 3 in your BAM file (check withsamtools view your.bam | head -30).Thank you for all of your help!.
Just last question. I applied some filters on first bam output, sorted, realignment and markduplicates. Should I use the first bam output or could I use the bam with all those filters?