rnalysis.filtering.CountFilter.fold_change

CountFilter.fold_change(numerator: ColumnNames, denominator: ColumnNames, numer_name: str = 'default', denom_name: str = 'default') FoldChangeFilter

Calculate the fold change between the numerator condition and the denominator condition, and return it as a FoldChangeFilter object.

Parameters:
  • numerator (str, or list of strs) – the CountFilter columns to be used as the numerator. If multiple arguments are given in a list, they will be averaged.

  • denominator (str, or list of strs) – the CountFilter columns to be used as the denominator. If multiple arguments are given in a list, they will be averaged.

  • numer_name (str or 'default') – name to give the numerator condition. If β€˜default’, the name will be generarated automatically from the names of numerator columns.

  • denom_name (str or 'default') – name to give the denominator condition. If β€˜default’, the name will be generarated automatically from the names of denominator columns.

Return type:

FoldChangeFilter

Returns:

A new instance of FoldChangeFilter

Examples:
>>> from rnalysis import filtering
>>> c = filtering.CountFilter('tests/test_files/counted_fold_change.csv')
>>> # calculate the fold change of mean(cond1_rep1,cond1_rep2)/mean(cond2_rep1,cond_2rep2)
>>> f = c.fold_change(['cond1_rep1','cond1_rep2'],['cond2_rep1','cond2_rep2'])
>>> f.numerator
"Mean of ['cond1_rep1', 'cond1_rep2']"
>>> f.denominator
"Mean of ['cond2_rep1', 'cond2_rep2']"
>>> type(f)
rnalysis.filtering.FoldChangeFilter