Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong NH tag when outSAMmultNmax flag is set to 1 #1180

Closed
y9c opened this issue Mar 18, 2021 · 1 comment
Closed

Wrong NH tag when outSAMmultNmax flag is set to 1 #1180

y9c opened this issue Mar 18, 2021 · 1 comment
Labels
Milestone

Comments

@y9c
Copy link

y9c commented Mar 18, 2021

As mentioned in the docs,

Note that \code{NH:i:} tag in STAR will still report the actual number of loci that the reads map to,

The \opt{outSAMmultNmax} parameter limits the number of output alignments (SAM lines) for multimappers. For instance, \opt{outSAMmultNmax} \optv{1} will output exactly one SAM line for each mapped read. Note that \code{NH:i:} tag in STAR will still report the actual number of loci that the reads map to, while the the number of reported alignments for a read in the SAM file is \code{min(NH,--outSAMmultNMax)}. If \opt{outSAMmultNmax} is equal to \optv{-1}, all the alignments are output according to the order specified in \opt{outMultimapperOrder} option. If \opt{outSAMmultNmax} is not equal to -1, than top-scoring alignments will always be output first, even for the default \opt{outMultimapperOrder} \optv{Old\_2.4} option.

But when I try to mapped a multiple hit read into the genome. STAR always report NH:i:1, which is not consistent with the docs.


The input data:

@test
TTCAACGATTAAAGTCCTACGTGATCTG
+
EEEEEEEEEEEEEEEEEEEEEEEEEEEE

The code:

STAR --runThreadN 1 \ 
     --genomeDir ~/Homo_sapiens.GRCh38.genome \
     --readFilesIn test.fq \
     --alignEndsType EndToEnd \
      --outFilterMatchNmin 15 \
      --outFilterMismatchNmax 5 \
      --outFilterMismatchNoverLmax 0.2 \
      --outFilterMultimapNmax 50 \
      --outSAMmultNmax 1 \
     --outReadsUnmapped Fastx \
     --outSAMattributes NH HI AS nM NM MD jM jI MC \
     --limitBAMsortRAM 1000000000 \
     --outSAMtype BAM SortedByCoordinate \
     --outFileNamePrefix test_star_

Note that outSAMmultNmax is set to 1 in the code above, and the STAR version is 2.7.7a.

But if the outSAMmultNmax flag is set to 5, the result will be ok, and the "NH" tag will be "NH:i:3",

@alexdobin alexdobin added the bug label Mar 25, 2021
@alexdobin alexdobin added this to the 2.7.8b: bug-fix release milestone Apr 1, 2021
alexdobin added a commit that referenced this issue Apr 27, 2021
…even if --outSAMmultNmax is set to a smaller value.
@alexdobin
Copy link
Owner

Hi @yech1990

this bug was fixed in 2.7.9a release.
Thanks for reporting it!

Cheers
Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants