mgkit.counts.scaling module

Scaling functions for counts

mgkit.counts.scaling.scale_deseq(dataframe)[source]

New in version 0.1.13.

Scale a dataframe using the deseq scaling. Uses scale_factor_deseq()

mgkit.counts.scaling.scale_factor_deseq(dataframe)[source]

New in version 0.1.13.

Returns the scale factor according to he deseq paper. The columns of the dataframe are the samples.

size factor \(\hat{s}_{j}\) for sample j (from DESeq paper).

\[\hat{s}_{j} = median_{i} ( \frac {k_{ij}} { \left ( \prod_{v=1}^{m} k_{iv} \right )^{1/m} } )\]
mgkit.counts.scaling.scale_rpkm(dataframe, gene_len)[source]

New in version 0.1.14.

Perform an RPKM scaling of the pandas dataframe/series supplied using the gene_len series containing the gene sizes for all elements of dataframe

\[RPKM =\frac {10^{9} \cdot C} {N \cdot L}\]