Skip to content
Snippets Groups Projects
Commit 76803af5 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Start working on popsim snakefile

parent 2291404c
No related branches found
No related tags found
1 merge request!11Integrate popsim simulation software to cnvpipelines
import sys
import os
ROOTPATH = os.path.dirname(os.path.dirname(workflow.snakefile))
sys.path.insert(0, os.path.join(ROOTPATH, "lib"))
os.environ["PYTHONPATH"] = os.path.join(ROOTPATH, "lib")
os.environ["PATH"] = ":".join([os.path.join(ROOTPATH, "bin"), os.environ["PATH"]])
WDIR = config['wdir']
workdir: WDIR
NB_INDS = config["nb_inds"]
REFERENCE = config["reference"]
REFBUNDLE = config["refbundle"] if "refbundle" in config else None
NSTRETCHES = config["nstretches"] if "nstretches" in config else None
SV_LIST = config["sv_list"] if "sv_list" in config else None
COVERAGE = config["coverage"]
FORCE_POLYMORPHISME = config["force_polymorphism"]
HAPLOID = config["haploid"]
PROBA_DEL = config["proba_del"]
PROBA_INV = config["proba_inv"]
READ_LEN = config["read_len"]
INSERT_LEN_MEAN = config["insert_len_mean"]
INSERT_LEN_SD = config["insert_len_sd"]
MIN_DELETIONS = config["min_deletions"]
MIN_INVERSIONS = config["min_inversions"]
MAX_TRY = config["max_try"]
GENOTYPES = config["genotypes"] if "genotypes" in config else None
# Functions here
def buildpop_inputs():
inputs = {
"reference": REFERENCE
}
params = {
"nstretches": False,
"genotypes": False,
"sv_list": False
}
if NSTRETCHES is not None:
inputs["nstretches"] = NSTRETCHES
params["nstretches"] = True
if GENOTYPES is not None:
inputs["genotypes"] = GENOTYPES
params["genotypes"] = True
if SV_LIST is not None:
inputs["sv_list"] = SV_LIST
params["sv_list"] = True
return inputs, params
def buildpop_outputs():
outputs = []
for n in range(1, NB_INDS+1):
outputs += ["INDIV_%d_1.fg.gz" % n, "INDIV_%d_2.fq.gz" % n]
return outputs
bp_inputs, bp_params = buildpop_inputs()
bp_outputs = buildpop_outputs()
bp_out_inds = [("INDIV_%d_1.fg.gz" % n, "INDIV_%d_2.fq.gz" % n) for n in range(0,5)]
include: "threads.snk"
localrules: all
rule all:
input:
# Set final outputs here
rule buildpop:
input:
bp_inputs
output:
bp_outputs
params:
bp_params,
nb_inds = NB_INDS
out_dir="pop"
shell:
"build_pop.py -"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment