Skip to content

Difference test with Gene expression by permutation method( by T-test and median test)

Notifications You must be signed in to change notification settings

swiri021/Difference_test_with_permutation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Difference test by Permutation method

This code calculates p-value of difference by using permuted sampling T-test and Median test in case of unbalanced sample size between 2 groups. For example, group1 has only 7 samples, and group2 has only 200 samples.

Example :

from difference_test.diff_stats import diff_stats
import pandas as pd

# Your Pandas file
df = pd.read_csv('Some_of_your_data.csv', index_col=0)
# Small group
group1 = ['Sample1', 'Sample2', 'Sample3', 'Sample4', 'Sample5', 'Sample7']
# Large group
group2 = ['Somegroup']*100

diff_s = diff_stats(df, small_group=group1, large_group=group2)



# T-test result
result = diff_s._permuted_ttest(df, small_group=group1, large_group=group2, perm=100)

# Median-test result(Null distribution from permuted large population)
result = diff_s._permuted_median_test(df, small_group=group1, large_group=group2, perm=100)

# Combined result (Don't use this function because of an error)
# result = diff_s.combined_pvalues(perm=100)

print result

About

Difference test with Gene expression by permutation method( by T-test and median test)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages