panGWAS aims for >=95% code coverage in it’s unit tests.
Unit tests are defined in: tests/config/test_pangwas.yaml
The following are some examples of typical unit tests.
# -----------------------------------------------------------------------------# extractextract: # Basic unit test-name: extractparams:function: pangwas.extracttags:["default","cov"]args:gff:"{data_dir}/{sample}.gff3"min_len:"{min_len}"outdir:"{outdir}"output:tsv:"{outdir}/{prefix}.tsv"variables:data_dir:"data/test/gff"min_len:"10"outdir:"tests/observed/test/extract"prefix:"{sample}"sample:-"sample1"-"sample2"-"sample3"-"sample4" # Unit test that is expected to fail with a particular error-name: duplicate_contig_errorparams:tags:["cov"]function: pangwas.extractargs:gff:"{test_data}/{name}.gff3"outdir:"{outdir}"prefix:"{prefix}"error_message:"Duplicate contig ID found: sample2_pesticin"variables:outdir:"tests/observed/test/extract/{name}"prefix:"{name}"test_data:"tests/data"# -----------------------------------------------------------------------------# clustercluster: # run the cluster function with various resources, and check that the # results are the same every single time.-name: reproducibleparams:tags:["reproducible"]function: pangwas.clusterargs:fasta:"{collect_dir}/sequences.fasta"outdir:"{outdir}"tmp:"{outdir}/tmp"memory:"{memory}"threads:"{threads}"output:clusters:"{outdir}/clusters.tsv"representative:"{outdir}/representative.fasta"variables:collect_dir:"tests/observed/test/collect"outdir:"tests/observed/test/cluster/t{threads}_mem{memory}"prefix:"t{threads}_mem{memory}"threads:-1-2-4memory:-"1G"-"2G"-"4G"