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
{ts} debug missing tag #281
Conversation
@IanSudbery - nudge nudge |
Hi @TomSmithCGAT, Today, I just downloaded UMI-Tools: Version 1.0.0, and try to use it to do "umi_tools dedup" on BAM files from cellranger (10X genomics data). However, I still have this error, "KeyError: "tag 'CB' not present". Best regards, |
For example, NH:i:1 HI:i:1 AS:i:69 nM:i:9 RE:A:I xf:i:0 li:i:0 CR:Z:CCGTAGACACTGTGTA CY:Z:FFFFFFFFFFFFFFFF UR:Z:TCAGGAACCG UY:Z:FFFFFFFFFF UB:Z:TCAGGAACCG RG:Z:1823_BA24:0:1:HCC5FDMXX:1 |
Hi Wenjun, by default, UMI-tools expects the cell barcodes to be provided in the 'CB' tag. If you have another tag denoting the cell barcode, you can add the option |
Hi @TomSmithCGAT, However, In BAM files from cellranger standard pipeline, the majority of lines have the CB tag. But, some lines do not have CB tag, like this one. Possibly that is why umi_tools had this error, "KeyError: "tag 'CB' not present". Best regards, |
Ah I see. Sorry, I misunderstood the problem. I'll take another look at this now |
I can't see any obvious reason why this would happen. This should be caught here: UMI-tools/umi_tools/sam_methods.py Lines 411 to 427 in 6945f6a
Would you mind posting the full error message here so I can see where the KeyError originates and confirming your version number ( |
Please check this file including the error and real example of BAM file. You may want to use this small BAM file to test software. many thanks. |
Ah, right, got it! The problem is that the KeyError originates from the parsing of the BAM to generate the null distribution for the stats (code below) rather than the parsing for deduplication (code above). I'll add a patch for this now. UMI-tools/umi_tools/umi_methods.py Lines 164 to 172 in 5e99b63
|
Hi Wenjuan, Could you test the version of UMI-tools on the Thanks, Tom |
Hi Tom, After testing it, this version of UMI-tools works very well. Thank you so much for your help. Wenjuan |
Great. The branch has been merged into master. Thanks for bringing this to our attention and for providing me with the example BAM. |
This enables reads missing a UMI or CB tag to be skipped rather than throwing an error (See #276).
As part of this, I've also moved the check for UMI/CB tags to before the check for bundle yielding as per all the other checks which cause reads to be skipped.