Skip to content

Commit 5480246

Browse files
committed
refactor!: provide default min peak height and distance
BREAKING-CHANGE: instead of providing a type `PeakIdentificationParameters`, simply provide the min peak height and distance directly Signed-off-by: Josh Loecker <joshloecker@icloud.com>
1 parent bb1449a commit 5480246

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

main/como/rnaseq_gen.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -358,16 +358,16 @@ def _zfpkm_calculation(col_fpkm: pd.Series, min_peak_height: float, min_peak_dis
358358

359359
def zfpkm_transform(
360360
fpkm_df: pd.DataFrame,
361-
peak_parameters: PeakIdentificationParameters,
362-
bandwidth: float,
361+
min_peak_height: float = 0.02,
362+
min_peak_distance: int = 1,
363363
update_every_percent: float = 0.1,
364364
) -> tuple[dict[str, _ZFPKMResult], DataFrame]:
365365
"""Perform zFPKM calculation/transformation.
366366
367367
Args:
368368
fpkm_df: A DataFrame containing FPKM values with genes as rows and samples as columns.
369-
peak_parameters: Parameters for peak identification in zFPKM calculation.
370-
bandwidth: The bandwidth for kernel density estimation in zFPKM calculation.
369+
min_peak_height: Minimum height of peaks; passed on to `find_peaks` function.
370+
min_peak_distance: Minimum distance between peaks; passed on to `find_peaks` function.
371371
update_every_percent: Frequency of progress updates as a decimal between 0 and 1 (e.g., 0.1 for every 10%).
372372
373373
Returns:
@@ -398,12 +398,13 @@ def zfpkm_transform(
398398
futures: list[Future[_ZFPKMResult]] = [
399399
pool.submit(
400400
_zfpkm_calculation,
401-
column=fpkm_df[column],
402-
peak_parameters=peak_parameters,
403-
bandwidth=bandwidth,
401+
col_fpkm=fpkm_df[column],
402+
min_peak_height=min_peak_height,
403+
min_peak_distance=min_peak_distance,
404404
)
405-
for column in fpkm_df
405+
for column in slim_fpkm_df
406406
]
407+
407408
for i, future in enumerate(as_completed(futures)):
408409
result = future.result()
409410
key = str(result.zfpkm.name)

0 commit comments

Comments
 (0)