Question: bwa mem -R or samtools view -T
1
gravatar for flystar233
3 months ago by
flystar2330
flystar2330 wrote:

As we all know, bam file required by GATK need header in it. We can explicitly add it via the -R parameter.But,if you didn't use -R ,you also can use samtools -T genome.fa to add header. What is the difference between the two?

bwa • 206 views
ADD COMMENTlink modified 3 months ago • written 3 months ago by flystar2330
2

Hello flystar233 ,

what exact samtools command you mean? Depending on that, the -T parameter means very different things.

fin swimmer

ADD REPLYlink modified 3 months ago • written 3 months ago by finswimmer10k

oh,sorry,please see code:

samtools view  -SbT  genome.fa  sample.bam >uniq.bam

-

ADD REPLYlink modified 3 months ago by finswimmer10k • written 3 months ago by flystar2330
3
gravatar for finswimmer
3 months ago by
finswimmer10k
Germany
finswimmer10k wrote:

OK, now we can talk about this ;)

I would recommend you also have a look at the sam specs to understand what type of header informations (page 3ff.) exists in a bam/sam file.

The -R parameter during alignment adds a ReadGroup to the bam file. Doing this you can store informations like SampleName or used platform into the bam file. This is useful and often neccessary for downstream analyses like variant calling. It is best practice to always include a ReadGroup with at least the sample name.

What every aligner should automaticly store in the bam header is an informationen about the contigs (name and length) used during alignment. These information are introduced by @SQ. But this is not mandatory. But just like the ReadGroup there are tools that need this information. For example samtools view. If this information is missing you can use the -T parameter to provide the reference genome file used for alignment and samtools will extract the information it needs from there instead using the header.

fin swimmer

ADD COMMENTlink modified 3 months ago • written 3 months ago by finswimmer10k
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: 1391 users visited in the last hour