toil.test.wdl.toilwdlTest

Module Contents

Classes

BaseToilWdlTest

Base test class for WDL tests

ToilWdlTest

General tests for Toil WDL

ToilWDLLibraryTest

Test class for WDL standard functions.

ToilWdlIntegrationTest

Test class for WDL tests that need extra workflows and data downloaded

Functions

compare_runs(output_dir, ref_dir)

Takes two directories and compares all of the files between those two

compare_vcf_files(filepath1, filepath2)

Asserts that two .vcf files contain the same variant findings.

class toil.test.wdl.toilwdlTest.BaseToilWdlTest(methodName='runTest')[source]

Bases: toil.test.ToilTest

Inheritance diagram of toil.test.wdl.toilwdlTest.BaseToilWdlTest

Base test class for WDL tests

setUp()[source]

Runs anew before each test to create farm fresh temp dirs.

Return type

None

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

Return type

None

classmethod setUpClass()[source]

Runs once for all tests.

Return type

None

class toil.test.wdl.toilwdlTest.ToilWdlTest(methodName='runTest')[source]

Bases: BaseToilWdlTest

Inheritance diagram of toil.test.wdl.toilwdlTest.ToilWdlTest

General tests for Toil WDL

testMD5sum()[source]

Test if toilwdl produces the same outputs as known good outputs for WDL’s GATK tutorial #1.

class toil.test.wdl.toilwdlTest.ToilWDLLibraryTest(methodName='runTest')[source]

Bases: BaseToilWdlTest

Inheritance diagram of toil.test.wdl.toilwdlTest.ToilWDLLibraryTest

Test class for WDL standard functions.

testFn_SelectFirst()[source]

Test the wdl built-in functional equivalent of ‘select_first()’, which returns the first value in a list that is not None.

testFn_Size()[source]

Test the wdl built-in functional equivalent of ‘size()’, which returns a file’s size based on the path.

Return type

None

testFn_Basename()[source]
testFn_Glob()[source]

Test the wdl built-in functional equivalent of ‘glob()’, which finds all files with a pattern in a directory.

testFn_ParseMemory()[source]

Test the wdl built-in functional equivalent of ‘parse_memory()’, which parses a specified memory input to an int output.

The input can be a string or an int or a float and may include units such as ‘Gb’ or ‘mib’ as a separate argument.

testFn_ParseCores()[source]

Test the wdl built-in functional equivalent of ‘parse_cores()’, which parses a specified disk input to an int output.

The input can be a string or an int.

testFn_ParseDisk()[source]

Test the wdl built-in functional equivalent of ‘parse_disk()’, which parses a specified disk input to an int output.

The input can be a string or an int or a float and may include units such as ‘Gb’ or ‘mib’ as a separate argument.

The minimum returned value is 2147483648 bytes.

testPrimitives()[source]

Test if toilwdl correctly interprets some basic declarations.

testCSV()[source]
testTSV()[source]
class toil.test.wdl.toilwdlTest.ToilWdlIntegrationTest(methodName='runTest')[source]

Bases: BaseToilWdlTest

Inheritance diagram of toil.test.wdl.toilwdlTest.ToilWdlIntegrationTest

Test class for WDL tests that need extra workflows and data downloaded

gatk_data: str
gatk_data_dir: str
encode_data: str
encode_data_dir: str
wdl_data: str
wdl_data_dir: str
classmethod setUpClass()[source]

Runs once for all tests.

Return type

None

classmethod tearDownClass()[source]

We generate a lot of cruft.

Return type

None

testTut01()[source]

Test if toilwdl produces the same outputs as known good outputs for WDL’s GATK tutorial #1.

testTut02()[source]

Test if toilwdl produces the same outputs as known good outputs for WDL’s GATK tutorial #2.

testTut03()[source]

Test if toilwdl produces the same outputs as known good outputs for WDL’s GATK tutorial #3.

testTut04()[source]

Test if toilwdl produces the same outputs as known good outputs for WDL’s GATK tutorial #4.

testENCODE()[source]

Test if toilwdl produces the same outputs as known good outputs for a short ENCODE run.

testPipe()[source]

Test basic bash input functionality with a pipe.

testJSON()[source]
test_size_large()[source]

Test the wdl built-in functional equivalent of ‘size()’, which returns a file’s size based on the path, on a large file.

Return type

None

classmethod fetch_and_unzip_from_s3(filename, data, data_dir)[source]
toil.test.wdl.toilwdlTest.compare_runs(output_dir, ref_dir)[source]

Takes two directories and compares all of the files between those two directories, asserting that they match.

  • Ignores outputs.txt, which contains a list of the outputs in the folder.

  • Compares line by line, unless the file is a .vcf file.

  • Ignores potentially date-stamped comments (lines starting with ‘#’).

  • Ignores quality scores in .vcf files and only checks that they found the same variants. This is due to assumed small observed rounding differences between systems.

Parameters
  • ref_dir – The first directory to compare (with output_dir).

  • output_dir – The second directory to compare (with ref_dir).

toil.test.wdl.toilwdlTest.compare_vcf_files(filepath1, filepath2)[source]

Asserts that two .vcf files contain the same variant findings.

  • Ignores potentially date-stamped comments (lines starting with ‘#’).

  • Ignores quality scores in .vcf files and only checks that they found the same variants. This is due to assumed small observed rounding differences between systems.

VCF File Column Contents: 1: #CHROM 2: POS 3: ID 4: REF 5: ALT 6: QUAL 7: FILTER 8: INFO

Parameters
  • filepath1 – First .vcf file to compare.

  • filepath2 – Second .vcf file to compare.