Is there a way to extract alignment score from STAR aligner bam files?
1
0
Entering edit mode
6 weeks ago
simplitia ▴ 50

Hi I know that samtools view, column 5 can display mapq scores however is there way to extract alignment scores as well from the same bam file? thanks.

rnaseq • 355 views
0
Entering edit mode

What exactly do you mean with 'alignment score' ?

Keep in mind that mappers for NGS data work an quite a different approach than the classical sequence aligners and as such the alignment score you would get from old school aligners is not applicable for them.

The mapq score you mention is likely the closest you can get (and even as informative as the alignment score)

2
Entering edit mode

Not sure this is true lieven.sterck - STAR computes a score for each alignment with +1/-1 for matches and miss-matches and gap opening and extension penalities as specific by the parameters.

0
Entering edit mode

ah, so it does indeed, my bad.

I stand corrected.

5
Entering edit mode
6 weeks ago

The alignment score for each alignment in the STAR output is in the bam AS tag, this is output by the default STAR settings, but if for some reason you are not getting it, you can add --outSAMattributes NH HI AS nM to your STAR command line.

For further documentation of the STAR specific meaning of these tags, see the STAR manual:

https://github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf

0
Entering edit mode

Thanks this is perfect. You are correct I see the AS tag info now.