Question: Removing Phix Data From Ngs Data For Analysis
0
gravatar for crivenster
5.7 years ago by
crivenster50
India
crivenster50 wrote:

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.

bam samtools sam bwa • 3.5k views
ADD COMMENTlink modified 5.7 years ago by Pavel Senin1.9k • written 5.7 years ago by crivenster50
2

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 REPLYlink modified 5.7 years ago • written 5.7 years ago by Michael Dondrup46k

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 REPLYlink written 5.7 years ago by crivenster50
1

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

ADD REPLYlink written 5.7 years ago by Michael Dondrup46k
0
gravatar for Pavel Senin
5.7 years ago by
Pavel Senin1.9k
Los Alamos, NM
Pavel Senin1.9k wrote:

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 COMMENTlink modified 5.7 years ago • written 5.7 years ago by Pavel Senin1.9k

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 REPLYlink written 5.7 years ago by crivenster50
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2047 users visited in the last hour