Samtools Have Trouble "View" Bwa Mem Result, But Good With Bwa Sampe Result?
1
1
Entering edit mode
10.6 years ago
Chen Sun ★ 1.1k

I always have trouble to use "samtools view" command to deal with "bwa mem" aligning result, but if I use "bwa sampe" then everything goes fine.

The head lines of aligning results is as follows:

[M::main_mem] read 100000 sequences (10000000 bp)...
[M::mem_pestat] # candidate unique pairs for (FF, FR, RF, RR): (0, 45245, 0, 0)
[M::mem_pestat] skip orientation FF as there are not enough pairs
[M::mem_pestat] analyzing insert size distribution for orientation FR...
[M::mem_pestat] (25, 50, 75) percentile: (686, 699, 713)
[M::mem_pestat] low and high boundaries for computing mean and std.dev: (632, 767)
[M::mem_pestat] mean and std.dev: (699.49, 20.02)
[M::mem_pestat] low and high boundaries for proper pairs: (605, 794)
[M::mem_pestat] skip orientation RF as there are not enough pairs
[M::mem_pestat] skip orientation RR as there are not enough pairs
[M::mem_process_seqs] Processed 100000 reads in 17.108 CPU sec, 17.240 real sec
@SQ     SN:chr17        LN:81195210
@PG     ID:bwa  PN:bwa  VN:0.7.8-r455   CL:bwa mem /gpfs/home/cxs1031/backup/ref/chr17.fa simulated_huref_chr17_10x_1.fq simulated_huref_chr17_10x_2.fq
chr17_43074173_43074853_0:0:0_0:0:0_0   99      chr17   43122985        60      100M    =       43123566        681     AGCTACTTGGGAAGCTGAAGAAGGAGAATCACTTGAACCCGGGAGGGGGAGGTTGCAGTG
AGCAGAGATCGCACCACTGCGCTCCAGCCTGAGCAACAGA        IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII    NM:i:0  MD:Z:100        AS:i
:100    XS:i:0
chr17_43074173_43074853_0:0:0_0:0:0_0   147     chr17   43123566        60      100M    =       43122985        -681    GACAATATATTGGGCTAAAAGATGAGGAAAATGTGGGAGAGAGTGCCTAGGAAGGTGAGC
TTCCCAGCAGGCGGAACTAGAGTGTAAGAGCAGCACTTTC        IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII    NM:i:0  MD:Z:100        AS:i
:100    XS:i:0

And I use "samtools view" command as follows:

 samtools view -t chr17.fa.fai -S -b chr17_10x.sam > chr17_10x.bam

Then I get error as follows:

[sam_header_read2] 1 sequences loaded.
[sam_read1] reference '[M::mem_pestat] skip orientation FF as there are not enough pairs' is recognized as '*'.
Parse error at line 1: invalid CIGAR character
Aborted (core dumped)

Did some one meet this problem before?

samtools bwa • 5.6k views
ADD COMMENT
3
Entering edit mode
10.6 years ago

When you use bwa mem, don't redirect standard error to your SAM file. The first 10 or so lines of the SAM file simply don't belong there and wouldn't have been there had you not incorrectly redirected the output.

ADD COMMENT
0
Entering edit mode

Thank you, but how could I indicate the output SAM file, if I do not use redirect command, as I did not find any -o or --output parameter in bwa mem command

ADD REPLY
2
Entering edit mode

Most likely you are either redirecting using something like &> or you are using the nohup utility which combines stderr and stdout in one stream and messes with tools like this. You can also disable all stderr messages by passing the argument -v 0 to bwa mem.

ADD REPLY
0
Entering edit mode

yes, it is the nohup problem, thank you

ADD REPLY

Login before adding your answer.

Traffic: 2593 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