genipe.tests package

Module contents

Submodules

genipe.tests.test_db module

class genipe.tests.test_db.TestDB(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Setup the tests.

tearDown()[source]

Finishes the test.

test_check_task_completion()[source]

Tests the ‘check_task_completion’ function.

test_create_db_connection()[source]

Tests the ‘_create_db_connection’ function.

test_create_task_db()[source]

Tests the ‘create_task_db’ function.

test_create_task_entry()[source]

Tests the ‘create_task_entry’ function.

test_get_all_runtimes()[source]

Tests the ‘get_all_runtimes’ function.

test_get_task_runtime()[source]

Tests the ‘task_runtime’ function.

test_mark_drmaa_task_completed()[source]

Tests the ‘mark_drmaa_task_completed’ function.

test_mark_task_completed()[source]

Tests the ‘mark_task_completed’ function.

test_mark_task_incomplete()[source]

Tests the ‘mark_task_incomplete’ function.

genipe.tests.test_formats module

class genipe.tests.test_formats.TestFormats(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_additive_from_probs()[source]

Tests the ‘additive_from_probs’ function.

test_dosage_from_probs()[source]

Tests the ‘dosage_from_probs’ function.

test_get_good_probs()[source]

Tests the ‘get_good_probs’ function.

test_hard_calls_from_probs()[source]

Tests the ‘hard_calls_from_probs’ function.

test_maf_dosage_from_probs()[source]

Tests the ‘maf_dosage_from_probs’ function.

test_maf_from_probs()[source]

Tests the ‘maf_from_probs’ function.

test_matrix_from_line()[source]

Tests the ‘matrix_from_line’ function.

genipe.tests.test_impute2_extractor module

class genipe.tests.test_impute2_extractor.TestImpute2Extractor(methodName='runTest')[source]

Bases: unittest.case.TestCase

static clean_logging_handlers()[source]
setUp()[source]

Setup the tests.

tearDown()[source]

Finishes the test.

test_extract()[source]

Tests the extraction by marker name.

test_genomic()[source]

Tests the extraction by genomic location.

test_genomic_info()[source]

Tests the extraction by genomic location and information value.

test_genomic_maf()[source]

Tests the extraction by genomic location and maf.

test_genomic_maf_info()[source]

Tests the extraction by genomic location, maf and information.

test_genomic_maf_rate()[source]

Tests the extraction by genomic location, maf and rate.

test_genomic_maf_rate_info()[source]

Tests the extraction by genomic location, maf, rate and info.

test_genomic_rate()[source]

Tests the extraction by genomic location and completion rate.

test_info()[source]

Tests the extraction by information value.

test_maf()[source]

Tests the extraction by maf.

test_maf_info()[source]

Tests the extraction by maf and information value.

test_maf_rate()[source]

Tests the extraction by maf and completion rate.

test_maf_rate_info()[source]

Tests the extraction by maf, completion rate and information.

test_rate()[source]

Tests the extraction by completion rate.

test_rate_info()[source]

Tests the extraction by completion rate and information value.

genipe.tests.test_impute2_merger module

class genipe.tests.test_impute2_merger.TestImpute2Merger(methodName='runTest')[source]

Bases: unittest.case.TestCase

static clean_logging_handlers()[source]
setUp()[source]

Setup the tests.

tearDown()[source]

Finishes the test.

test_check_alleles()[source]

Checks the ‘.alleles’ file.

test_check_output_files()[source]

Checks the presence of all the output files.

test_completion_rates()[source]

Checks the ‘.completion_rates’ file.

test_good_sites()[source]

Checks the ‘.good_sites’ file.

test_impute2()[source]

Checks the ‘.impute2’ file.

test_impute2_info()[source]

Checks the ‘.impute2_info’ file.

test_imputed_sites()[source]

Checks the ‘.imputed_sites’ file.

test_maf()[source]

Checks the ‘.maf’ file.

test_map()[source]

Checks the ‘.map’ file.

genipe.tests.test_imputed_stats module

class genipe.tests.test_imputed_stats.TestImputedStats(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Setup the tests.

tearDown()[source]

Finishes the test.

test_check_args()[source]

Tests the ‘check_args’ function.

test_compute_statistics()[source]

Tests the ‘compute_statistics’ function.

test_get_formula()[source]

Tests the ‘get_formula’ function.

test_process_impute2_site()[source]

Tests the ‘process_impute2_site’ function.

test_read_phenotype()[source]

Tests the ‘read_phenotype’ function.

test_read_samples()[source]

Tests the ‘read_samples’ function.

test_read_sites_to_extract()[source]

Tests the ‘test_read_sites_to_extract’ function.

test_samples_with_hetero_calls()[source]

Tests the ‘samples_with_hetero_calls’ function.

class genipe.tests.test_imputed_stats.TestImputedStatsCox(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Setup the tests.

tearDown()[source]

Finishes the test.

test_fit_cox_interaction_snp1()[source]

Tests the ‘fit_cox’ function with interaction, first SNP.

test_fit_cox_invalid()[source]

Tests the ‘fit_linear’ function, third SNP.

test_fit_cox_snp1()[source]

Tests the ‘fit_cox’ function, first SNP.

test_fit_cox_snp2()[source]

Tests the ‘fit_cox’ function, second SNP.

test_fit_cox_snp3()[source]

Tests the ‘fit_cox’ function, third SNP.

test_full_fit_cox()[source]

Tests the full pipeline for Cox’s regression.

test_full_fit_cox_interaction()[source]

Tests the full pipeline for Cox’s regression with interaction.

test_full_fit_cox_multiprocess()[source]

Tests the full pipeline for Cox’s regression with >1 processes.

class genipe.tests.test_imputed_stats.TestImputedStatsLinear(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Setup the tests.

tearDown()[source]

Finishes the test.

test_fit_linear_interaction()[source]

Tests the ‘fit_linear’ function with interaction.

test_fit_linear_invalid()[source]

Tests the ‘fit_linear’ function, invalid values.

test_fit_linear_snp1()[source]

Tests the ‘fit_linear’ function, first SNP.

test_fit_linear_snp2()[source]

Tests the ‘fit_linear’ function, second SNP.

test_fit_linear_snp3()[source]

Tests the ‘fit_linear’ function, third SNP.

test_full_fit_linear()[source]

Tests the full pipeline for linear regression.

test_full_fit_linear_interaction()[source]

Tests the full pipeline for linear regression with interaction.

test_full_fit_linear_multiprocess()[source]

Tests the full pipeline for linear regression with >1 processes.

class genipe.tests.test_imputed_stats.TestImputedStatsLogistic(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Setup the tests.

tearDown()[source]

Finishes the test.

test_fit_logistic_interaction()[source]

Tests the ‘fit_logistic’ function with interaction.

test_fit_logistic_invalid()[source]

Tests the ‘fit_logistic’ function, invalid values.

test_fit_logistic_snp1()[source]

Tests the ‘fit_logistic’ function, first SNP.

test_fit_logistic_snp2()[source]

Tests the ‘fit_logistic’ function, second SNP.

test_fit_logistic_snp3()[source]

Tests the ‘fit_logistic’ function, third SNP.

test_full_fit_logistic()[source]

Tests the full pipeline for logistic regression.

test_full_fit_logistic_interaction()[source]

Tests the full pipeline for logistic regression with interaction.

test_full_fit_logistic_multiprocess()[source]

Tests the full pipeline, logistic regression with >1 processes.

class genipe.tests.test_imputed_stats.TestImputedStatsMixedLM(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Setup the tests.

classmethod setUpClass()[source]

Gets the data and compute random effects.

tearDown()[source]

Finishes the test.

test_fit_mixedlm_interaction()[source]

Tests the ‘fit_mixedlm’ function with interaction.

test_fit_mixedlm_interaction_use_ml()[source]

Tests the ‘fit_mixedlm’ function with interaction (using ML).

test_fit_mixedlm_invalid_column()[source]

Tests when asking an invalid column.

test_fit_mixedlm_snp1()[source]

Tests the ‘fit_mixedlm’ function for the first SNP.

test_fit_mixedlm_snp1_use_ml()[source]

Tests mixedlm using ML on first SNP.

test_fit_mixedlm_snp2()[source]

Tests the ‘fit_mixedlm’ function for the second SNP.

test_fit_mixedlm_snp2_use_ml()[source]

Tests mixedlm using ML on second SNP.

test_fit_mixedlm_snp3()[source]

Tests the ‘fit_mixedlm’ function for the third SNP.

test_fit_mixedlm_snp3_use_ml()[source]

Tests mixedlm using ML on third SNP.

test_full_fit_mixedlm()[source]

Tests the full pipeline for mixed effect model.

test_full_fit_mixedlm_interaction()[source]

Tests the full pipeline for mixed linear model with interaction.

test_full_fit_mixedlm_interaction_use_ml()[source]

Tests the full pipeline for mixed linear model (interaction, ML).

test_full_fit_mixedlm_multiprocess()[source]

Tests the full pipeline, mixed linear model with >1 processes.

test_full_fit_mixedlm_multiprocess_use_ml()[source]

Tests the full pipeline, mixed linear with >1 processes (ML).

test_full_fit_mixedlm_use_ml()[source]

Tests the full pipeline for mixed effect model (using ML).

class genipe.tests.test_imputed_stats.TestImputedStatsSkat(methodName='runTest')[source]

Bases: unittest.case.TestCase

args = None
classmethod setUpClass()[source]

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

static setup_skat_files(out_directory)[source]

Parses the SKAT example files into the format expected by genipe.

classmethod tearDownClass()[source]

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

test_continuous()[source]
test_continuous_multiprocess()[source]
test_discrete()[source]
test_discrete_multiprocess()[source]
tmp_dir = None

genipe.tests.test_launcher module

class genipe.tests.test_launcher.TestLauncher(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Setup the tests.

tearDown()[source]

Finishes the test.

test_check_impute2_file()[source]

Tests the ‘_check_impute2_file’ function.

test_check_missing_impute2()[source]

Tests the ‘_check_output_files’ for missing impute2 file.

test_check_output_files()[source]

Tests the ‘_check_output_files’ function.

genipe.tests.test_main_pipeline module

class genipe.tests.test_main_pipeline.TestMainPipeline(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Setup the tests.

tearDown()[source]

Finishes the test.

test_file_sorter()[source]

Tests the ‘file_sorter’ function.

test_gather_execution_time()[source]

Tests the ‘gather_execution_time’ function.

test_gather_imputation_stats()[source]

Tests the ‘gather_imputation_stats’ function.

test_gather_maf_stats()[source]

Tests the ‘gather_maf_stats’ function.

test_get_chrom_encoding()[source]

Tests the ‘get_chrom_encoding’ function.

test_get_chromosome_length()[source]

Tests the ‘get_chromosome_length’ function.

test_get_cross_validation_results()[source]

Tests the ‘get_cross_validation_results’ function.

test_is_reversed()[source]

Tests the ‘is_reversed’ function.

test_read_preamble()[source]

Tests the ‘read_preamble’ function.

genipe.tests.test_reporting_utils module

class genipe.tests.test_reporting_utils.TestReportingUtils(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_colorize_time()[source]

Tests the ‘colorize_time’ function.

test_create_float()[source]

Tests the ‘create_float’ function.

test_create_tabular()[source]

Tests the ‘create_tabular’ function.

test_format_tex()[source]

Tests the ‘format_tex’ function.

test_format_time()[source]

Tests the ‘format_time’ function.

test_is_sanitized()[source]

Tests the ‘_is_sanitized’ function.

test_sanitize_tex()[source]

Tests the ‘sanitize_tex’ function.

test_tex_inline_math()[source]

Tests the ‘tex_inline_math’ function.

test_wrap_tex()[source]

Tests the ‘wrap_tex’ function.