Skip to content

Commit 3207eb2

Browse files
committed
fix: use parenthesis to validate calculations
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
1 parent 06fee32 commit 3207eb2

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

main/como/rnaseq_gen.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ def cpm_filter(
505505
cutoff = (
506506
10e6 / (np.median(np.sum(counts[:, i])))
507507
if cut_off == "default"
508-
else 1e6 * cut_off / np.median(np.sum(counts[:, i]))
508+
else (1e6 * cut_off) / np.median(np.sum(counts[:, i]))
509509
)
510510
test_bools = test_bools.merge(counts_per_million[counts_per_million.iloc[:, i] > cutoff])
511511

@@ -637,7 +637,7 @@ async def _save_rnaseq_tests(
637637
filtering_options = _FilteringOptions(
638638
replicate_ratio=replicate_ratio,
639639
batch_ratio=batch_ratio,
640-
cut_off=cut_off,
640+
cut_off=float(cut_off),
641641
high_replicate_ratio=high_replicate_ratio,
642642
high_batch_ratio=high_batch_ratio,
643643
)
@@ -725,9 +725,14 @@ async def rnaseq_gen( # noqa: C901, allow complex function
725725
then study/batch numbers are checked for consensus according to batch ratios.
726726
The zFPKM method is outlined here: https://pubmed.ncbi.nlm.nih.gov/24215113/
727727
728-
:param metadata_filepath: The configuration filename to read
728+
:param context_name: The name of the context being processed
729+
:param input_rnaseq_filepath: The filepath to the gene count matrix
730+
:param input_gene_info_filepath: The filepath to the gene info file
731+
:param output_rnaseq_filepath: The filepath to write the output gene count matrix
729732
:param prep: The preparation method
730733
:param taxon: The NCBI Taxon ID
734+
:param input_metadata_filepath: The filepath to the metadata file
735+
:param input_metadata_df: The metadata dataframe
731736
:param replicate_ratio: The percentage of replicates that a gene must
732737
appear in for a gene to be marked as "active" in a batch/study
733738
:param batch_ratio: The percentage of batches that a gene must appear in for a gene to be marked as 'active"
@@ -759,7 +764,7 @@ async def rnaseq_gen( # noqa: C901, allow complex function
759764
cutoff = "default"
760765

761766
case FilteringTechnique.zfpkm:
762-
cutoff = "default" if cutoff else cutoff
767+
cutoff = cutoff or -3
763768
case FilteringTechnique.umi:
764769
pass
765770
case _:

0 commit comments

Comments
 (0)