Question: Samtools Have Trouble "View" Bwa Mem Result, But Good With Bwa Sampe Result?
1
gravatar for Chen
5.0 years ago by
Chen800
Chen800 wrote:

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 • 3.7k views
ADD COMMENTlink modified 5.0 years ago by Devon Ryan88k • written 5.0 years ago by Chen800
3
gravatar for Devon Ryan
5.0 years ago by
Devon Ryan88k
Freiburg, Germany
Devon Ryan88k wrote:

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 COMMENTlink written 5.0 years ago by Devon Ryan88k

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 REPLYlink written 5.0 years ago by Chen800
2

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 REPLYlink modified 5.0 years ago • written 5.0 years ago by Matt Shirley8.9k

yes, it is the nohup problem, thank you

ADD REPLYlink modified 5.0 years ago • written 5.0 years ago by Chen800
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: 900 users visited in the last hour