Skip to content

Commit

Permalink
add scaling_factor as default argument in getmm
Browse files Browse the repository at this point in the history
  • Loading branch information
noctillion committed Dec 18, 2024
1 parent 577f5ac commit 293d131
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions transcriptomics_data_service/scripts/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ def tmm_normalization(counts_df, logratio_trim=0.3, sum_trim=0.05, weighting=Tru
return normalized_data


def getmm_normalization(counts_df, gene_lengths, logratio_trim=0.3, sum_trim=0.05, weighting=True, n_jobs=-1):
def getmm_normalization(counts_df, gene_lengths, logratio_trim=0.3, sum_trim=0.05, scaling_factor=1e3, weighting=True, n_jobs=-1):
"""Perform GeTMM normalization on counts data."""
counts_df, gene_lengths = prepare_counts_and_lengths(counts_df, gene_lengths)
rpk = counts_df.mul(1e3).div(gene_lengths, axis=0)
rpk = counts_df.mul(scaling_factor).div(gene_lengths, axis=0)
return tmm_normalization(rpk, logratio_trim, sum_trim, weighting, n_jobs)


Expand Down

0 comments on commit 293d131

Please sign in to comment.