import pandas as pd
from os.path import join

configfile: "config.yaml"

samples_file    = config["samples_file"]
SAMPLES         = pd.read_table(samples_file).set_index("name", drop=False)
SAMPLES_PATH    = SAMPLES.path.values.tolist()
SAMPLES_NAME    = SAMPLES.name.values.tolist()

CHROMOSOMES     = [str(i) for i in range(1, 23)]
PLINK_FORMATS   = ['bed', 'bim', 'fam']
PLINK_FORMATS_EXT   = ['bed', 'bim', 'fam', 'nosex']

REF_DIR         = config["ref_dir"]
lift_chain      = join(REF_DIR, config["reference"]["lift_chain"])
GRCh37_fasta    = join(REF_DIR, config["reference"]["GRCh37_fasta"])

def get_samples_name(wildcards):
    return SAMPLES.loc[int(wildcards.sample), "name"] # mind the int index

def get_samples_path(wildcards):
    return SAMPLES.loc[int(wildcards.sample), "path"] # mind the int index

# include: "rules/report.rule"

rule all:
    input:
        vcf="vcf/merged_lifted.vcf",
        # rules.report_benchmark_summary.output

include: "../../rules/preprocessing.smk"