Question: BWA (mem, sampe, or aln) used in bam file
0
gravatar for rborges
11 days ago by
rborges50
rborges50 wrote:

I'm trying to figure out which version/type of bwa was used in three aligned bam files (sampe, mem or aln). Is there a way of figuring this out? I can't find information on this from where I downloaded the samples.

Looking at the header, they say the following:

samtools view -H file1.bam  | grep "bwa"
@PG ID:bwa  PN:bwa  VN:0.5.9-r16

samtools view -H    file2.bam  | grep "bwa"
@PG ID:bwa  PN:bwa  VN:0.6.1-r104-tpx

samtools view -H   file3.bam | grep "bwa"
#(Has no output).

But from what I understand this just says the version of bwa and not the type of bwa used.

Is there something about the format in the output which might say which version was used?

EDIT: I've also grepped for "CL" and "PG", but the information is not in the header for these files.

Thank you

sequencing bwa bam • 106 views
ADD COMMENTlink modified 11 days ago • written 11 days ago by rborges50
2

EDIT: I've also grepped for "CL" and "PG", but the information is not in the header for these files.

Then you may be out of luck on last file. It looks like you have reasonably older versions of bwa in first two examples and at that time it may not have been capturing the command line used.

You could always recreate the fastq file and realign the data with current bwa.

ADD REPLYlink modified 11 days ago • written 11 days ago by genomax50k
1

Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
code_formatting

ADD REPLYlink written 11 days ago by Ram15k
2
gravatar for b.nota
11 days ago by
b.nota4.0k
Netherlands
b.nota4.0k wrote:

It should be in the same line following CL:, right after the VN: (which is the version of bwa). The info is thus not in your files.

Here an example of a file I used:

samtools view -H SRR1291026.bwa.bam  | grep "bwa"

@PG     ID:bwa  PN:bwa  VN:0.7.12-r1039 CL:bwa mem -t 20 /home/Reference/hg38/hg38.fa SRR1291026_1.fastq.gz SRR1291026_2.fastq.gz
ADD COMMENTlink modified 11 days ago • written 11 days ago by b.nota4.0k
2
gravatar for arup
11 days ago by
arup340
India
arup340 wrote:

Try samtools view -H SRR1172709.sam|grep "CL:"

$ samtools view -H SRR1172709.sam|grep "CL:"
@PG ID:bwa  PN:bwa  VN:0.7.16a-r1181    CL:bwa mem -t 10 -R @RG\tID:FLOWCELL1.LANE1\tPL:ILLUMINA\tLB:SINDIA\tSM:SRR1172709 ../../MTB_DATA//Ref_H37rv/h37rv.fa ../SRR1172709_1.fastq ../SRR1172709_2.fastq

If CL: filed is missing check this thread for related suggestions Predict/Estimate/Find Bwa Parameters From Bam Or Sam File

ADD COMMENTlink modified 11 days ago • written 11 days ago by arup340
1
gravatar for h.mon
11 days ago by
h.mon15k
Brazil
h.mon15k wrote:

You are looking for the CL field of a @PG header, try grepping for '@PG' - there should be just one or a few lines.

ADD COMMENTlink written 11 days ago by h.mon15k
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: 972 users visited in the last hour