It plays nicely with nextflow / nf-core because th...
# shameless-promo
p
It plays nicely with nextflow / nf-core because the file names in the assertion file are just aliases
Copy code
process ALIGNED_BAM_ASSERTIONS {
    tag "reference_genome"
    label 'process_medium'
    conda "${moduleDir}/environment.yml"
    container "<http://ghcr.io/peterkneale/bioassert:latest|ghcr.io/peterkneale/bioassert:latest>"

    input:
    tuple val(meta), path(bam), path(bai)

    output:
    path ("*.log"), emit: log
    tuple val("${task.process}"), val('bioassert'), eval('bioassert version | sed "1!d;s/.* //"'), emit: versions_bioassert, topic: versions

    script:
    """
    cat <<'EOF' > assertions.txt
    bam exists eq true
    bai exists eq true
    bam size gt 1MB
    bai size gt 1KB
    bam read_count gt 10000
    bam sort_order eq coordinate
    bam read_group_count gte 1
    bam has_index eq true
    EOF

    bioassert \
        --verbose \
        --log-file aligned_bam_assertions.log \
        --assertions assertions.txt  \
        --input bam=${bam} \
        --input bai=${bai}
    """
}