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

falir quantify fails on missing MD BAM tag #433

Closed
diekhans opened this issue Mar 4, 2025 · 3 comments
Closed

falir quantify fails on missing MD BAM tag #433

diekhans opened this issue Mar 4, 2025 · 3 comments
Assignees
Labels
bug Something isn't working mod; quantify

Comments

@diekhans
Copy link
Collaborator

diekhans commented Mar 4, 2025

Vikas encountered the following error:

(flair-dev) vpeddu@emerald:/private/groups/kimlab/vikas/nanopore/promethion/direct_cfrna/publication/flair$ flair quantify -r \
    read_manifest.tsv \
    -i drna.flair.collapse.trna.isoforms.fa \
    --threads 32 --output drna.flair.quantify.trna \
    --sample_id_only
Starting quantify...
Writing temporary files with prefixes similar to /data/tmp/tmp3br3w4mt
Step 1/3. Aligning sample drna1_b1, 1/4
Step 1/3. Aligning sample drna2_b1, 2/4
Step 1/3. Aligning sample drna3_b1, 3/4
Step 1/3. Aligning sample drna4_b1, 4/4
Step 2/3. Quantifying isoforms for sample drna1_b1: 1/4
Traceback (most recent call last):
  File "/private/groups/kimlab/vikas/HBEC/flair_split_tests/flair/src/flair/count_sam_transcripts.py", line 283, in <module>
    transcripttoreads = parsesam(args, transcripttoexons)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/groups/kimlab/vikas/HBEC/flair_split_tests/flair/src/flair/count_sam_transcripts.py", line 247, in parsesam
    mdtag = read.get_tag('MD')
            ^^^^^^^^^^^^^^^^^^
  File "pysam/libcalignedsegment.pyx", line 2507, in pysam.libcalignedsegment.AlignedSegment.get_tag
  File "pysam/libcalignedsegment.pyx", line 2546, in pysam.libcalignedsegment.AlignedSegment.get_tag
KeyError: "tag 'MD' not present"
Flair quantify took 0 minutes and 20 seconds

Flair took 0 minutes and 20 seconds and finished without issues.
@diekhans diekhans self-assigned this Mar 4, 2025
@diekhans diekhans added bug Something isn't working mod; quantify labels Mar 4, 2025
@cafelton
Copy link
Collaborator

cafelton commented Mar 4, 2025

I independently discovered this recently, a quick fix is to just use --generate_map, but this definitely needs addressed in future versions

@diekhans
Copy link
Collaborator Author

diekhans commented Mar 4, 2025 via email

diekhans added a commit that referenced this issue Mar 4, 2025
Address quantify failure if BAM not specified

Closes #433
@diekhans
Copy link
Collaborator Author

diekhans commented Mar 4, 2025

This was caused by minimap2 not being give the --MD flag if --output_bam was not specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mod; quantify
Projects
None yet
Development

No branches or pull requests

2 participants