Skip to content

Add --umi_tag option to output UMI as a SAM-style tag (e.g. XR:Z:UMI) - #713

Open
yangmqglobe wants to merge 1 commit into
OpenGene:masterfrom
yangmqglobe:master
Open

yangmqglobe wants to merge 1 commit into
OpenGene:masterfrom
yangmqglobe:master

Conversation

@yangmqglobe

Copy link
Copy Markdown

Implements the UMI tag output suggested in #226.

What

Adds a new optional --umi_tag=<TAG> parameter (e.g. --umi_tag=XR). When specified, the UMI is written as a SAM-style optional tag after the first field of the read name instead of being appended to the name:

# default (unchanged)
@V350398653L1C001R00100001764/1:TCGACC_GCGTAA

# with --umi_tag=XR
@V350398653L1C001R00100001764/1 XR:Z:TCGACC_GCGTAA

Notes

  • The tag name is configurable (2-char SAM tag, e.g. XR, RX); --umi_prefix still applies inside the tag value (XR:Z:UMI_TCGACC_GCGTAA).
  • --umi_delim continues to control only the default name-append mode; the _ separator between per_read/per_index UMI parts is unchanged.
  • Tag mode is opt-in; default behavior is fully backward compatible.
  • Validation rejects --umi_tag without --umi and malformed tag names.
  • Unit tests added in UmiProcessor::test(); ./fastp test passes.
When --umi_tag is specified (e.g. --umi_tag=XR), the UMI is written as a SAM optional tag after the read name (name XR:Z:UMI) instead of being appended to the name with --umi_delim. Legacy behavior is unchanged. Adds validation for the 2-character tag name and unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant