Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mmassaviol
WAWmassaviol
Commits
ba96f06c
Commit
ba96f06c
authored
Jan 20, 2020
by
mmassaviol
Browse files
Update raw_inputs system
parent
21d6689b
Changes
15
Hide whitespace changes
Inline
Side-by-side
generate_workflow.py
View file @
ba96f06c
...
...
@@ -98,6 +98,12 @@ def generate_params(pipeline):
params_info
[
option
[
"name"
]]
=
collections
.
OrderedDict
()
params_info
[
option
[
"name"
]][
"type"
]
=
option
[
"type"
]
if
"input"
in
pipeline_config
:
raw_inputs_yaml
=
read_yaml
(
"./raw_inputs/"
+
pipeline_config
[
"input"
]
+
".yaml"
)
for
option
in
raw_inputs_yaml
[
"options"
]:
params_info
[
option
[
"name"
]]
=
collections
.
OrderedDict
()
params_info
[
option
[
"name"
]][
"type"
]
=
option
[
"type"
]
for
step
in
pipeline_config
[
"steps"
]:
params
[
"params"
][
step
[
"name"
]]
=
step
[
"default"
]
for
tool
in
step
[
"tools"
]:
...
...
generate_workflow_snakefile.py
View file @
ba96f06c
...
...
@@ -55,6 +55,7 @@ def generate(name):
raw_inputs_yaml
=
read_yaml
(
"./raw_inputs/"
+
yaml
[
"input"
]
+
".yaml"
)
result
+=
"# raw_inputs function call
\n
"
result
+=
yaml
[
"input"
]
+
" = "
+
raw_inputs_yaml
[
"function_call"
]
+
"
\n
"
result
+=
"config.update("
+
yaml
[
"input"
]
+
")
\n
"
result
+=
"SAMPLES = "
+
yaml
[
"input"
]
+
"['samples']
\n
"
#else : # OLD (to replace for all workflows with input raw_reads)
# result += "# Generic input functions\n"
...
...
raw_inputs/raw_reads.py
View file @
ba96f06c
...
...
@@ -41,10 +41,11 @@ def raw_reads(results_dir, sample_dir, SeOrPe):
for
sample
in
sorted
(
samples
):
sampleTab
.
write
(
"
\n
"
+
sample
+
"
\t
"
+
"
\t
"
.
join
(
sorted
(
dicoSamples
[
sample
])))
out
=
{
'samples'
:
sorted
(
samples
),
'suffix'
:
suffix
,
'dico'
:
dicoSamples
}
out
=
{
'samples'
:
sorted
(
samples
),
'
sample_
suffix'
:
suffix
,
'dico'
:
dicoSamples
}
if
SeOrPe
==
"SE"
:
out
[
"read"
]
=
os
.
path
.
join
(
sample_dir
,
"{sample}"
+
suffix
)
out
[
"read2"
]
=
""
else
:
out
[
"read"
]
=
os
.
path
.
join
(
sample_dir
,
"{sample}"
+
PE_mark
+
"1"
+
suffix
)
out
[
"read2"
]
=
os
.
path
.
join
(
sample_dir
,
"{sample}"
+
PE_mark
+
"2"
+
suffix
)
...
...
workflows/Genome_Profile/Genome_Profile.snakefile
View file @
ba96f06c
...
...
@@ -20,6 +20,7 @@ config = config["params"]
# raw_inputs function call
raw_reads = raw_reads(config['results_dir'], config['sample_dir'], config['SeOrPe'])
config.update(raw_reads)
SAMPLES = raw_reads['samples']
# Tools inputs functions
...
...
workflows/Long_Read_Assembly/Long_Read_Assembly.snakefile
View file @
ba96f06c
...
...
@@ -20,6 +20,7 @@ config = config["params"]
# raw_inputs function call
raw_long_reads = raw_long_reads(config['results_dir'], config['sample_dir'])
config.update(raw_long_reads)
SAMPLES = raw_long_reads['samples']
# Tools inputs functions
...
...
workflows/Metabarcoding/Metabarcoding.snakefile
View file @
ba96f06c
...
...
@@ -20,6 +20,7 @@ config = config["params"]
# raw_inputs function call
raw_reads = raw_reads(config['results_dir'], config['sample_dir'], config['SeOrPe'])
config.update(raw_reads)
SAMPLES = raw_reads['samples']
# Tools inputs functions
...
...
workflows/MitoZ/MitoZ.snakefile
View file @
ba96f06c
...
...
@@ -20,6 +20,7 @@ config = config["params"]
# raw_inputs function call
raw_reads = raw_reads(config['results_dir'], config['sample_dir'], config['SeOrPe'])
config.update(raw_reads)
SAMPLES = raw_reads['samples']
# Tools inputs functions
...
...
workflows/Mito_Assembler_Megahit/Mito_Assembler_Megahit.snakefile
View file @
ba96f06c
...
...
@@ -20,6 +20,7 @@ config = config["params"]
# raw_inputs function call
raw_reads = raw_reads(config['results_dir'], config['sample_dir'], config['SeOrPe'])
config.update(raw_reads)
SAMPLES = raw_reads['samples']
# Tools inputs functions
...
...
workflows/RADseq_denovo/RADseq_denovo.snakefile
View file @
ba96f06c
...
...
@@ -30,6 +30,7 @@ individus = get_individus()
# raw_inputs function call
raw_reads = raw_reads(config['results_dir'], config['sample_dir'], config['SeOrPe'])
config.update(raw_reads)
SAMPLES = raw_reads['samples']
## get reads (trimmed or raw)
...
...
workflows/RADseq_ref/RADseq_ref.snakefile
View file @
ba96f06c
...
...
@@ -30,6 +30,7 @@ individus = get_individus()
# raw_inputs function call
raw_reads = raw_reads(config['results_dir'], config['sample_dir'], config['SeOrPe'])
config.update(raw_reads)
SAMPLES = raw_reads['samples']
## get reads (trimmed or raw)
...
...
workflows/RNAseq/RNAseq.snakefile
View file @
ba96f06c
...
...
@@ -16,6 +16,7 @@ config = config["params"]
# raw_inputs function call
raw_reads = raw_reads(config['results_dir'], config['sample_dir'], config['SeOrPe'])
config.update(raw_reads)
SAMPLES = raw_reads['samples']
## get reads (trimmed or raw)
...
...
workflows/RNAseq_denovo/RNAseq_denovo.snakefile
View file @
ba96f06c
...
...
@@ -7,7 +7,6 @@ import csv
# Wildcards #
#############
SAMPLES = config["samples"]
STEPS = config["steps"]
PREPARE_REPORT_OUTPUTS = config["prepare_report_outputs"]
PREPARE_REPORT_SCRIPTS = config["prepare_report_scripts"]
...
...
@@ -19,28 +18,15 @@ config = config["params"]
# Inputs #
##########
# Generic input functions
## get raw_reads
def raw_reads():
inputs = dict()
if (config["SeOrPe"] == "PE"):
inputs["read"] = config['sample_dir']+'/{sample}_R1'+config["sample_suffix"]
inputs["read2"] = config['sample_dir']+'/{sample}_R2'+config["sample_suffix"]
elif (config["SeOrPe"] == "SE"):
inputs["read"] = config['sample_dir']+'/{sample}'+config["sample_suffix"]
else:
sys.exit("SeOrPe should be SE or PE")
return inputs
## get reads (trimmed or raw)
def reads():
return raw_reads()
# raw_inputs function call
raw_reads = raw_reads(config['results_dir'], config['sample_dir'], config['SeOrPe'])
config.update(raw_reads)
SAMPLES = raw_reads['samples']
# Tools inputs functions
def trimmomatic_inputs():
return raw_reads
()
return raw_reads
def fastqc_inputs():
inputs = dict()
...
...
workflows/RNAseq_denovo/RNAseq_denovo.yaml
View file @
ba96f06c
...
...
@@ -4,6 +4,7 @@
description
:
,
version
:
"
0.0.1"
,
author
:
"
MBB"
,
input
:
raw_reads
,
steps
:
[
{
title
:
Trimming
,
name
:
trimming
,
tools
:
[
trimmomatic
,
"
null"
],
default
:
"
null"
},
...
...
@@ -22,25 +23,5 @@
label
:
"
Results
directory:
"
,
volumes
:
[
Results
:
"
/Results"
]
},
{
name
:
"
sample_dir"
,
type
:
"
input_dir"
,
value
:
"
/Data"
,
label
:
"
Data
directory:
"
,
volumes
:
[
Data
:
"
/Data"
,
Results
:
"
/Results"
]
},
#{
# name: "sample_suffix",
# type: "text",
# value: ".fastq.gz",
# label: "Samples suffix: ",
#},
{
name
:
"
SeOrPe"
,
type
:
"
radio"
,
value
:
"
PE"
,
choices
:
[
Single end
:
SE
,
Paired end
:
PE
],
label
:
"
Single
end
reads
(SE)
or
Paired
end
reads
(PE):
"
,
},
],
}
\ No newline at end of file
workflows/Variant_calling/Variant_calling.snakefile
View file @
ba96f06c
...
...
@@ -20,6 +20,7 @@ config = config["params"]
# raw_inputs function call
raw_reads = raw_reads(config['results_dir'], config['sample_dir'], config['SeOrPe'])
config.update(raw_reads)
SAMPLES = raw_reads['samples']
# Tools inputs functions
...
...
workflows/Virus_Assembler_Megahit/Virus_Assembler_Megahit.snakefile
View file @
ba96f06c
...
...
@@ -20,6 +20,7 @@ config = config["params"]
# raw_inputs function call
raw_reads = raw_reads(config['results_dir'], config['sample_dir'], config['SeOrPe'])
config.update(raw_reads)
SAMPLES = raw_reads['samples']
# Tools inputs functions
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment