Skip to content

Commit

Permalink
fix: RTD needs an __init__.py in fgpyo/platform/ (#174)
Browse files Browse the repository at this point in the history
* refactor: add init, docs: add docstring to illumina.py

* style: mkdocs docstring formatting
  • Loading branch information
emmcauley authored Aug 2, 2024
1 parent 08eb529 commit 84c8ec4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
Empty file added fgpyo/platform/__init__.py
Empty file.
20 changes: 16 additions & 4 deletions fgpyo/platform/illumina.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
"""
Methods for working with Illumina-specific UMIs in SAM files
------------------------------------
The functions in this module make it easy to:
* check whether a UMI is valid
* extract UMI(s) from an Illumina-style read name
* copy a UMI from an alignment's read name to its `RX` SAM tag
"""

from typing import Optional
from typing import Set

Expand Down Expand Up @@ -35,10 +47,10 @@ def extract_umis_from_read_name(
read_name_delimiter: The delimiter separating the components of the read name.
umi_delimiter: The delimiter separating multiple UMIs.
strict: If `strict` is `True`, the read name must contain either 7 or 8 colon-separated
segments. The UMI is assumed to be the last one in the case of 8 segments and `None`
in the case of 7 segments. `strict` requires the UMI to be valid and consistent with
Illumina's allowed UMI characters. If `strict` is `False`, the last segment is returned
so long as it appears to be a valid UMI.
segments. The UMI is assumed to be the last one in the case of 8 segments and `None`
in the case of 7 segments. `strict` requires the UMI to be valid and consistent with
Illumina's allowed UMI characters. If `strict` is `False`, the last segment is returned
so long as it appears to be a valid UMI.
Returns:
The UMI extracted from the read name, or None if no UMI was found. Multiple UMIs are
Expand Down
2 changes: 2 additions & 0 deletions tests/fgpyo/platform/test_illumina.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Basic tests for Illumina-specific UMI Methods"""

from typing import Optional

import pytest
Expand Down

0 comments on commit 84c8ec4

Please sign in to comment.