Re-generating rnaSTAR reported values for "Number of input reads" and "Uniquely mapped reads number"
1
0
Entering edit mode
9.2 years ago

Hello,

I am trying to query of the rnaSTAR Aligned.sam output using the SAM flags to re-generate Number of input reads and Uniquely mapped reads number that are reported in Log.final.out for paired end RNASeq data. But so far, I had no success in getting the exact STAR reported numbers.

As for "Number of input reads", I am using:

samtools view -S -f 2 -F 8 -c Aligned.out.sam

and then dividing this number by two, which seems to be still more than what Log.final.out has reported. I assume if I can get how this number is calculated, I can then use grep by NH:i:1 tag to get the number of unique reads that STAR reports (unless you know otherwise).

I greatly appreciate your input.

Noushin

RNA-Seq STAR • 2.1k views
ADD COMMENT
1
Entering edit mode
9.2 years ago

I wouldn't necessarily expect that samtools command to match either of the numbers you mentioned. If you want to match the total number of input reads, you need to:

  1. Ensure that unmapped reads are included in the output
  2. Ensure that multimappers are
    1. counted only once or...
    2. reported only once

Then a simple samtools view -Sc foo.sam should produce the total number of input reads (divide by 2 for read pairs).

For the "uniquely mapped" reads, a simple samtools view -Scf 2 foo.sam will work if and only if STAR doesn't produce singleton alignments. Whether it will do so is dependent upon the settings you give.

ADD COMMENT

Login before adding your answer.

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