Removing Phix Data From Ngs Data For Analysis
1
0
Entering edit mode
10.3 years ago
crivenster ▴ 50

I have a NGS data containing 95-98% of PHIX data,which i dont need. So after some reading, I used BWA to align the reads against PHIX genome,so that i could use the unaligned read for analysis. The alignment generated by BWA Align was in sam format. To save the unaligned reads,i tried using samtools ,but the command takes only bam format. I tried converting the sam to bam using samtools,but got error message saying the file is missing header.

Is there any way to generate alignment with the headers in BWA? if not,how to convert the SAM file generated by BWA to BAM format? I need unaligned reads so that i can further perform analysis by aligning it against the another genome.

I looked the BWA manual page,and its command line options. There is no option provided to generate the results in bam format or generate the alignments with headers.

sam bam bwa samtools • 5.0k views
ADD COMMENT
2
Entering edit mode

That's a good example why you need to give the exact and reproducible series of command calls. Your description is not precise enough, but I suspect you simply forgot the bwa samse or bwa sampe step, the output of bwa align is not in SAM format. Please copy-paste your complete command sequence and output.

ADD REPLY
0
Entering edit mode

Thank you. Yes i did not run the bwa samse or bwa sampe step. After running bwa align,i tried the conversion with output file.

ADD REPLY
1
Entering edit mode

Ok, that won't work. Then we have found the solution.

ADD REPLY
0
Entering edit mode
10.3 years ago
Pavel Senin ★ 1.9k

I think you can create your own header, concatenate it with your header-less SAM, and that will fix your workflow.

samtools view -H original.sam > header.txt
ADD COMMENT
0
Entering edit mode

Thanks for the reply. But i tried it. I get the following the error message:

[bam_header_read] EOF marker is absent. The input is probably truncated. [bam_header_read] invalid BAM binary header (this is not a BAM file). [main_samview] fail to read the header from "aln.sam".

ADD REPLY

Login before adding your answer.

Traffic: 2741 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6