Ejemplo n.º 1
0
def test_plot_figures(tmpdir):
    workdir = tmpdir / "analysis"
    init(workdir, TESTDATA_BLR_READ1, "blr")
    change_config(
        workdir / DEFAULT_CONFIG,
        [("genome_reference", REFERENCE_GENOME)]
    )
    target = "figures"
    run(workdir=workdir, targets=[target])
    assert Path(workdir / target).is_dir()
Ejemplo n.º 2
0
def test_duplicate_markers(tmpdir, duplicate_marker):
    workdir = tmpdir / "analysis"
    init(workdir, TESTDATA_BLR_READ1, "blr")
    change_config(
        workdir / DEFAULT_CONFIG,
        [("genome_reference", REFERENCE_GENOME), ("duplicate_marker", duplicate_marker)]
    )
    run(workdir=workdir, targets=["mapped.sorted.tag.mkdup.bam"])
    n_input_fastq_reads = 2 * count_fastq_reads(Path(workdir / "trimmed_barcoded.1.fastq.gz"))
    assert n_input_fastq_reads <= count_bam_alignments(workdir / "mapped.sorted.tag.mkdup.bam")
Ejemplo n.º 3
0
def test_call_variants(tmpdir, variant_caller):
    workdir = tmpdir / "analysis"
    init(workdir, TESTDATA_BLR_READ1, "blr")
    change_config(
        workdir / DEFAULT_CONFIG,
        [("genome_reference", REFERENCE_GENOME), ("reference_variants", "null"), ("variant_caller", variant_caller)]
    )
    target = "variants.called.vcf"
    run(workdir=workdir, targets=[target])
    assert Path(workdir / target).is_file()
Ejemplo n.º 4
0
def test_link_reference_variants(tmpdir):
    workdir = tmpdir / "analysis"
    init(workdir, TESTDATA_BLR_READ1, "blr")
    change_config(
        workdir / DEFAULT_CONFIG,
        [("genome_reference", REFERENCE_GENOME), ("reference_variants", REFERENCE_VARIANTS)]
    )
    target = "variants.reference.vcf"
    run(workdir=workdir, targets=[target])
    assert Path(workdir / target).is_symlink()
Ejemplo n.º 5
0
def test_final_compressed_reads_exist(tmpdir):
    workdir = tmpdir / "analysis"
    init(workdir, TESTDATA_BLR_READ1, "blr")
    change_config(
        workdir / DEFAULT_CONFIG,
        [("genome_reference", REFERENCE_GENOME)]
    )
    targets = ("reads.1.final.fastq.gz", "reads.2.final.fastq.gz")
    run(workdir=workdir, targets=targets)
    for filename in targets:
        assert Path(workdir / filename).exists()
Ejemplo n.º 6
0
def test_trim_tenx(tmpdir):
    workdir = tmpdir / "analysis"
    init(workdir, TESTDATA_TENX_READ1, "10x")
    change_config(
        workdir / DEFAULT_CONFIG,
        [("barcode_whitelist", TESTDATA_TENX_BARCODES)]
    )
    trimmed = ["trimmed.barcoded.1.fastq.gz", "trimmed.barcoded.2.fastq.gz"]
    run(workdir=workdir, targets=trimmed)
    for raw, trimmed in zip((TESTDATA_TENX_READ1, TESTDATA_TENX_READ2), trimmed):
        assert count_fastq_reads(raw) == count_fastq_reads(Path(workdir / trimmed))
Ejemplo n.º 7
0
def test_trim_blr(tmpdir):
    workdir = tmpdir / "analysis"
    init(workdir, TESTDATA_BLR_READ1, "blr")
    change_config(
        workdir / DEFAULT_CONFIG,
        [("library_type", "blr")]
    )
    trimmed = ["trimmed.barcoded.1.fastq.gz", "trimmed.barcoded.2.fastq.gz"]
    run(workdir=workdir, targets=trimmed)
    assert count_fastq_reads(trimmed[0]) <= count_fastq_reads(TESTDATA_BLR_READ1)
    assert count_fastq_reads(trimmed[1]) <= count_fastq_reads(TESTDATA_BLR_READ2)
Ejemplo n.º 8
0
def test_BQSR(tmpdir):
    workdir = tmpdir / "analysis"
    init(workdir, TESTDATA_BLR_READ1, "blr")
    change_config(
        workdir / DEFAULT_CONFIG,
        [("genome_reference", REFERENCE_GENOME), ("dbSNP", DB_SNP), ("BQSR", "true"), ("reference_variants", "null"),
         ("variant_caller", "gatk")]
    )
    target = "mapped.sorted.tag.mkdup.bcmerge.mol.filt.BQSR.bam"
    run(workdir=workdir, targets=[target])
    assert Path(workdir / target).is_file()