Skip to content

Commit

Permalink
Allow choosing nan string (#33)
Browse files Browse the repository at this point in the history
* allow choosing nan string

* rename back to matrix

---------

Co-authored-by: Tony Kuo <[email protected]>
  • Loading branch information
tony-kuo and Tony Kuo authored Jul 3, 2024
1 parent 21419c0 commit 18bc076
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cellarr/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def __init__(
num_workers: int = 0,
lognorm: bool = True,
target_sum: float = 1e4,
nan_string: str = "nan",
):
"""Initialize a ``DataModule``.
Expand Down Expand Up @@ -228,6 +229,10 @@ def __init__(
target_sum:
Target sum for log-normalization.
nan_string:
A string representing NaN.
Defaults to "nan".
"""

super().__init__()
Expand Down Expand Up @@ -260,7 +265,7 @@ def __init__(
)

# limit to cells with labels
query_condition = f"{self.label_column_name} != 'nan'"
query_condition = f"{self.label_column_name} != '{nan_string}'"
self.data_df = subset_frame(
self.cell_metadata_tdb,
query_condition,
Expand Down

0 comments on commit 18bc076

Please sign in to comment.