genetest.tests package

Submodules

genetest.tests.test_configuration module

class genetest.tests.test_configuration.TestAnalysisConfiguration(methodName='runTest')[source]

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()[source]

Hook method for deconstructing the class fixture after running all tests in the class.

test_extra_section()[source]

Tests when there is an extra section.

test_invalid_genotype_format()[source]

Tests when an invalid format for genotypes is asked.

test_invalid_phenotype_format()[source]

Tests when an invalid format for phenotypes is asked.

test_invalid_test()[source]

Tests when an invalid model for statistics is asked.

test_missing_genotype_format()[source]

Tests when the genotype format is missing.

test_missing_phenotype_format()[source]

Tests when the phenotype format is missing.

test_missing_section()[source]

Tests when there is a missing section.

test_missing_test()[source]

Tests when the statistics test is missing.

test_normal_functionality()[source]

Tests the normal functionality.

genetest.tests.test_coxph module

class genetest.tests.test_coxph.TestStatsCoxPH(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests the ‘StatsCoxPH’ class.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()[source]

Hook method for deconstructing the class fixture after running all tests in the class.

test_coxph_gwas()[source]

Tests coxph regression for GWAS.

test_coxph_gwas_inter()[source]

Tests coxph regression for GWAS inter (failure: singular matrix).

test_coxph_snp1()[source]

Tests coxph regression with the first SNP.

test_coxph_snp1_inter()[source]

Tests coxph regression with the first SNP (interaction).

test_coxph_snp1_inter_categorical()[source]

Tests coxph first SNP (interaction, category).

test_coxph_snp2()[source]

Tests coxph regression with the second SNP.

test_coxph_snp2_inter()[source]

Tests coxph regression with the second SNP (interaction).

test_coxph_snp3()[source]

Tests coxph regression with the third SNP.

test_coxph_snp3_inter()[source]

Tests coxph regression with the third SNP (interaction).

test_coxph_snp4()[source]

Tests coxph regression with the third SNP.

test_coxph_snp4_inter()[source]

Tests coxph regression with the third SNP (interaction).

genetest.tests.test_descriptive_stats module

class genetest.tests.test_descriptive_stats.TestDescriptiveStats(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests the descriptive statistics module.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_get_maf_flip()[source]

Tests when flip is required.

test_get_maf_flip_sex()[source]

Tests when flip is required (sex).

test_get_maf_no_valid_genotypes()[source]

Tests when all genotypes are missing.

test_get_maf_no_valid_genotypes_sex()[source]

Tests when all genotypes are missing (sex).

test_get_maf_with_null()[source]

Tests when there are missing genotypes.

test_get_maf_with_null_sex()[source]

Tests when there are missing genotypes (sex).

test_get_maf_without_null()[source]

Tests when there are no missing genotypes.

test_get_maf_without_null_sexes()[source]

Tests when there are no missing genotypes (sex).

genetest.tests.test_linear module

class genetest.tests.test_linear.TestStatsLinear(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests the ‘StatsLinear’ class.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()[source]

Hook method for deconstructing the class fixture after running all tests in the class.

test_linear_gwas()[source]

Tests linear regression for GWAS.

test_linear_gwas_inter()[source]

Tests linear regression for GWAS with interaction.

test_linear_snp1()[source]

Tests linear regression with the first SNP.

test_linear_snp1_inter()[source]

Tests linear regression with the first SNP (interaction).

test_linear_snp1_inter_categorical()[source]

Tests linear regression for first SNP (inter, category).

test_linear_snp2()[source]

Tests linear regression with the second SNP.

test_linear_snp2_inter()[source]

Tests linear regression with the second SNP (interaction).

test_linear_snp3()[source]

Tests linear regression with the third SNP.

test_linear_snp3_inter()[source]

Tests linear regression with the third SNP.

test_linear_snp4()[source]

Tests linear regression with the fourth SNP.

test_linear_snp4_inter()[source]

Tests linear regression with the fourth SNP (interaction).

test_linear_snp5()[source]

Tests linear regression with the fifth SNP (raises StatsError).

test_linear_snp5_inter()[source]

Tests linear regression fifth SNP (inter) (raises StatsError).

genetest.tests.test_logistic module

class genetest.tests.test_logistic.TestStatsLogistic(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests the ‘StatsLogistic’ class.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()[source]

Hook method for deconstructing the class fixture after running all tests in the class.

test_logistic_gwas()[source]

Tests logistic regression for GWAS.

test_logistic_gwas_inter()[source]

Tests logistic regression for GWAS with interaction.

test_logistic_snp1()[source]

Tests logistic regression with the first SNP.

test_logistic_snp1_inter()[source]

Tests logistic regression with the first SNP (interaction).

test_logistic_snp1_inter_categorical()[source]

Tests logistic regression first SNP (inter, category).

test_logistic_snp2()[source]

Tests logistic regression with the second SNP.

test_logistic_snp2_inter()[source]

Tests logistic regression with the second SNP (interaction).

test_logistic_snp3()[source]

Tests logistic regression with the third SNP (raises StatsError).

test_logistic_snp3_inter()[source]

Tests logistic regression third SNP (raises StatsError, inter).

genetest.tests.test_mixedlm module

class genetest.tests.test_mixedlm.TestStatsMixedLM(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests the ‘StatsMixedLM’ class.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()[source]

Hook method for deconstructing the class fixture after running all tests in the class.

test_mixedlm_gwas()[source]

Tests mixedlm regression for GWAS.

test_mixedlm_gwas_inter()[source]

Tests mixedlm regression for GWAS with interaction.

test_mixedlm_snp1_inter_ml()[source]

Tests mixedlm regression with the first SNP (using ML, inter).

test_mixedlm_snp1_inter_reml()[source]

Tests mixedlm regression with the first SNP (using REML, inter).

test_mixedlm_snp1_ml()[source]

Tests mixedlm regression with the first SNP (using ML).

test_mixedlm_snp1_reml()[source]

Tests mixedlm regression with the first SNP (using REML).

test_mixedlm_snp2_inter_ml()[source]

Tests mixedlm regression with the second SNP (using ML, inter).

test_mixedlm_snp2_inter_reml()[source]

Tests mixedlm regression with the second SNP (using REML, inter).

test_mixedlm_snp2_ml()[source]

Tests mixedlm regression with the second SNP (using ML).

test_mixedlm_snp2_reml()[source]

Tests mixedlm regression with the second SNP (using REML).

test_mixedlm_snp3_inter_ml()[source]

Tests mixedlm regression with the third SNP (using ML, inter).

test_mixedlm_snp3_inter_reml()[source]

Tests mixedlm regression with the third SNP (using REML, inter).

test_mixedlm_snp3_ml()[source]

Tests mixedlm regression with the third SNP (using ML).

test_mixedlm_snp3_reml()[source]

Tests mixedlm regression with the third SNP (using REML).

test_mixedlm_snp4_inter_ml()[source]

Tests mixedlm regression with the fourth SNP (using ML, inter).

test_mixedlm_snp4_inter_reml()[source]

Tests mixedlm regression with the fourth SNP (using REML, inter).

test_mixedlm_snp4_ml()[source]

Tests mixedlm regression with the fourth SNP (using ML).

test_mixedlm_snp4_reml()[source]

Tests mixedlm regression with the fourth SNP (using REML).

genetest.tests.test_phenotypes module

class genetest.tests.test_phenotypes.TestCore(methodName='runTest')[source]

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_close()[source]

Tests that ‘close’ raises a NotImplementedError.

test_get_phenotypes()[source]

Tests that ‘get_phenotypes’ raises a NotImplementedError.

test_get_sex_no_attribute()[source]

Tests when the ‘_sex_column’ attribute is missing.

class genetest.tests.test_phenotypes.TestText(methodName='runTest')[source]

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_bad_subset_phenotypes()[source]

Tests asking for a subset with unavailable phenotypes.

test_duplicated_sex()[source]

Tests when there are repeated (different) sex for a sample.

test_get_sex()[source]

Tests asking for the sex series.

test_invalid_sex()[source]

Tests when other values than 0, 1 and NaN are in the sex column.

test_multiple_missing_values()[source]

Tests when there are multiple missing values.

test_normal_functionality()[source]

Tests normal functionality.

test_one_other_missing_value()[source]

Tests when there are other missing values.

test_repeated_measurements()[source]

Tests when there are repeated measurements available.

test_specific_column_missing_value()[source]

Tests when there are specific missing values for some columns.

test_string_representation()[source]

Checks the string representation.

test_subset_phenotypes()[source]

Tests asking for a subset of phenotypes.

test_undefined_sex_column()[source]

Tests when the sex column wasn’t specified.

genetest.tests.test_stats_core module

class genetest.tests.test_stats_core.TestStatsLinear(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests the ‘StatsLinear’ class.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__create_model()[source]

Tests the ‘_create_model’ function.

test__create_model_no_intercept()[source]

Tests the ‘_create_model’ function with no intercept.

test__create_model_with_interaction()[source]

Tests the ‘_create_model’ function with an interaction.

test__create_model_with_interaction2()[source]

Tests with an interaction (categorical).

test__create_model_with_interaction_not_in_predictors()[source]

Tests with an interaction but not in predictors list.

Module contents