Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

ktest

This package implements kernel tests such as kernel Fisher Discriminant Analysis (kFDA) and Minimum Mean Discrepency (MMD) introduced in [1].

Note regarding code used in publication

The code for the analysis presented in [1] are available in a dedicated repository here.

The source code for experimental_data and squair scripts are based on the branch publication_genome_biology. The reversion scripts are based on the branch publication_genome_biology_reversion.

See https://github.com/AnthoOzier/ktest_experiment_genome_biology_2024 for more details.

Licensing and authorship

See the dedicated LICENSE.md and AUTHORS.md files.

Python package

Install

Latest development version:

pip install ktest@git+https://github.com/LMJL-Alea/ktest@main#subdirectory=python

Caution: For users of MacOS with x86 processors (before Apple switched to ARM processors), PyTorch (that is a dependency for ktest) stopped supporting this platform with version 2.3. As a consequence, you will be limited to Pytorch <2.3, and thus Python >=3.8,<3.13.

Tutorials

See the dedicated tutorials folder in the project root directory for notebook tutorials.

Usage

Example with a dataset used in [1]:

import pandas as pd
from ktest.tester import Ktest

# data
url = "https://raw.githubusercontent.com/LMJL-Alea/ktest/main/tutorials/v5_data/RTqPCR_reversion_logcentered.csv"
data = pd.read_csv(url, index_col=0)

meta = pd.Series(data = pd.Series(data.index).apply(lambda x : x.split(sep='.')[1]))
meta.index = data.index

# init ktest object
kt_1 = Ktest(
    data=data, metadata=meta, sample_names=['48HREV','48HDIFF'], nystrom=True
)
# run kfda test
kt_1.test()
print(kt_1)

# save object
kt_1.save("ktest_RTqPCR_reversion_logcentered.pkl", compress=True)

# load saved
kt_1 = Ktest.load("ktest_RTqPCR_reversion_logcentered.pkl", compressed=True)

References

[1] Anthony Ozier-Lafontaine, Camille Fourneaux, Ghislain Durif, Polina Arsenteva, Céline Vallot, Olivier Gandrillon, Sandrine Gonin-Giraud, Bertrand Michel, Franck Picard. Kernel-based testing for single-cell differential analysis. Genome Biol 25, 114 (2024). doi:10.1186/s13059-024-03255-1, hal-04214858