I have a bam file with Unique Molecular Identifiers (UMIs) for each read present on the RX tag ( such as RX:Z:TGAGAAGGG
), as expected by picard and fgbio tools.
However, several other tools (such as UMI-tools) expect the UMIs to be present at the end of the read name, such as (NB501943:73:HK333BGXC:3:12402:20313:16437_TGAGAAGGG
).
Does anyone know of a tool to do this?
I have an awk
solution which I'll self-answer with, but I don't know whether that is robust.
umi_tools extract
moves sequences from a position in the FASTA sequence onto the read name, but in this case the reads have been added to a tag viafgbio
. $\endgroup$