import logging

LOGGER = logging.getLogger("snakemake.logging")

if not "VPIPE_BASEDIR" in dir():
    # NOTE when used from a module workflow.basedir (and main_snakefile) always point to most-outer wrapping layer, workflow.current_basedir (and snakefile) to the current module
    VPIPE_BASEDIR = workflow.current_basedir
LOGGER.info("VPIPE_BASEDIR = %s", VPIPE_BASEDIR)


# Include config file parser and globals
include: "rules/common.smk"


functions = srcdir("scripts/functions.sh")


# DUMMY RULES
rule all:
    input:
        all_files,


rule alltrimmed:
    input:
        trimmed_files,


rule allfastqc:
    input:
        fastqc_files,


include: "rules/clean.smk"
include: "rules/quality_assurance.smk"
include: "rules/align.smk"
include: "rules/consensus.smk"
include: "rules/mafs.smk"
include: "rules/stats.smk"


if config.output["snv"] or config.output["local"]:

    include: "rules/snv.smk"


if config.output["global"]:

    include: "rules/haplotypes.smk"


if config.output["QA"]:

    include: "rules/contamination.smk"


if config.output["visualization"]:

    include: "rules/visualization.smk"
