Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cnvpipelines
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
SVdetection
cnvpipelines
Commits
76803af5
Commit
76803af5
authored
6 years ago
by
Floreal Cabanettes
Browse files
Options
Downloads
Patches
Plain Diff
Start working on popsim snakefile
parent
2291404c
No related branches found
No related tags found
1 merge request
!11
Integrate popsim simulation software to cnvpipelines
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
snakecnv/popsim.snk
+84
-0
84 additions, 0 deletions
snakecnv/popsim.snk
with
84 additions
and
0 deletions
snakecnv/popsim.snk
+
84
−
0
View file @
76803af5
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment