# -*- coding: utf-8 -*-
"""CUBI Pipeline somatic_hla_loh_calling step Snakefile"""

import os

from snappy_pipeline import expand_ref
from snappy_pipeline.workflows.somatic_hla_loh_calling import SomaticHlaLohCallingWorkflow

__author__ = "Clemens Messerschmidt"


# Configuration ===============================================================


configfile: "config.yaml"


# Expand "$ref" JSON pointers in configuration (also works for YAML)
config, lookup_paths, config_paths = expand_ref("config.yaml", config)

# WorkflowImpl Object Setup ===================================================

wf = SomaticHlaLohCallingWorkflow(
    workflow, config, cluster_config, lookup_paths, config_paths, os.getcwd()
)

# Rules =======================================================================


localrules:
    # Linking files from work/ to output/ should be done locally
    somatic_hla_loh_calling_link_out_run,


rule all:
    input:
        wf.get_result_files(),


# House-Keeping ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# Generic linking out ---------------------------------------------------------


rule somatic_hla_loh_calling_link_out_run:
    input:
        wf.get_input_files("link_out", "run"),
    output:
        wf.get_output_files("link_out", "run"),
    run:
        shell(wf.get_shell_cmd("link_out", "run", wildcards))


# Run LOHHLA ------------------------------------------------------------------


rule somatic_hla_loh_calling_lohhla:
    input:
        unpack(wf.get_input_files("lohhla", "run")),
    output:
        **wf. get_output_files('lohhla','run'),
    log:
        **wf. get_log_file('lohhla','run'),
    wrapper:
        wf.wrapper_path("lohhla")

32d04e5426758a263128ba6c8e130b4969ef7fac
# -*- coding: utf-8 -*-
"""CUBI Pipeline somatic_hla_loh_calling step Snakefile"""

import os

from snappy_pipeline import expand_ref
from snappy_pipeline.workflows.somatic_hla_loh_calling import SomaticHlaLohCallingWorkflow

__author__ = "Clemens Messerschmidt"


# Configuration ===============================================================


configfile: "config.yaml"


# Expand "$ref" JSON pointers in configuration (also works for YAML)
config, lookup_paths, config_paths = expand_ref("config.yaml", config)

# WorkflowImpl Object Setup ===================================================

wf = SomaticHlaLohCallingWorkflow(
    workflow, config, cluster_config, lookup_paths, config_paths, os.getcwd()
)

# Rules =======================================================================


localrules:
    # Linking files from work/ to output/ should be done locally
    somatic_hla_loh_calling_link_out_run,


rule all:
    input:
        wf.get_result_files(),


# House-Keeping ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# Generic linking out ---------------------------------------------------------


rule somatic_hla_loh_calling_link_out_run:
    input:
        wf.get_input_files("link_out", "run"),
    output:
        wf.get_output_files("link_out", "run"),
    run:
        shell(wf.get_shell_cmd("link_out", "run", wildcards))


# Run LOHHLA ------------------------------------------------------------------


rule somatic_hla_loh_calling_lohhla:
    input:
        unpack(wf.get_input_files("lohhla", "run")),
    output:
        **wf. get_output_files('lohhla','run'),
    log:
        **wf. get_log_file('lohhla','run'),
    wrapper:
        wf.wrapper_path("lohhla")
