-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
133 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,95 @@ | ||
rule rmhost_md5: | ||
input: | ||
expand(os.path.join(config["results"]["rmhost"], "{{sample}}.rmhost{read}.fq.gz"), | ||
read=[".1", ".2"] if IS_PE else "") | ||
output: | ||
os.path.join(config["results"]["rmhost"], "{sample}.rmhost.fq.gz.md5") | ||
params: | ||
rmhost_dir = os.path.join(config["results"]["rmhost"], "") | ||
shell: | ||
''' | ||
md5sum {input} | sed 's#{params.rmhost_dir}##g' > {output} | ||
''' | ||
|
||
|
||
rule assembly_md5: | ||
input: | ||
os.path.join(config["results"]["assembly"], | ||
"{sample}.{assembler}_out/{sample}.{assembler}.scaftigs.fa.gz"), | ||
output: | ||
os.path.join(config["results"]["assembly"], | ||
"{sample}.{assembler}_out/{sample}.{assembler}.scaftigs.fa.gz.md5") | ||
params: | ||
assembly_dir = os.path.join(config["results"]["assembly"], "{sample}.{assembler}_out/") | ||
shell: | ||
''' | ||
md5sum {input} | sed 's#{params.assembly_dir}##g' > {output} | ||
''' | ||
|
||
|
||
rule generate_samples_info: | ||
input: | ||
config["params"]["samples"] | ||
output: | ||
os.path.join(config["results"]["upload"], "MIxS_Samples.xlsx") | ||
run: | ||
metapi.gen_samples_info(SAMPLES, output[0], config) | ||
|
||
|
||
rule generate_run_info: | ||
input: | ||
expand("{rmhost}/{sample}.rmhost.fq.gz.md5", | ||
rmhost=config["results"]["rmhost"], | ||
sample=SAMPLES.index.unique()) | ||
output: | ||
os.path.join(config["results"]["upload"], "Experiment_Run.xlsx") | ||
threads: | ||
config["upload"]["threads"] | ||
run: | ||
metapi.gen_info(input, output[0], config, threads, "sequencing_run") | ||
|
||
|
||
rule generate_assembly_info: | ||
if config["upload"]["do"]: | ||
rule upload_generate_samples_info: | ||
input: | ||
config["params"]["samples"] | ||
output: | ||
os.path.join(config["output"]["upload"], "table/MIxS_Samples.xlsx") | ||
run: | ||
metapi.gen_samples_info(SAMPLES, output[0], config) | ||
|
||
|
||
rule upload_md5_short_reads: | ||
input: | ||
assembly_input | ||
output: | ||
os.path.join(config["output"]["upload"], "short_reads/{sample}.md5") | ||
shell: | ||
''' | ||
md5sum {input} > {output} | ||
''' | ||
|
||
|
||
rule upload_generate_run_info: | ||
input: | ||
expand(os.path.join( | ||
config["output"]["upload"], "short_reads/{sample}.md5"), | ||
sample=SAMPLES.index.unique()) | ||
output: | ||
os.path.join(config["output"]["upload"], "table/Experiment_Run.xlsx") | ||
threads: | ||
config["upload"]["threads"] | ||
run: | ||
metapi.gen_info(input, output[0], config, threads, "sequencing_run") | ||
|
||
|
||
rule upload_sequencing_all: | ||
input: | ||
os.path.join(config["output"]["upload"], "table/Experiment_Run.xlsx"), | ||
os.path.join(config["output"]["upload"], "table/MIxS_Samples.xlsx") | ||
|
||
|
||
if len(ASSEMBLERS) != 0: | ||
rule upload_md5_scaftigs: | ||
input: | ||
os.path.join( | ||
config["output"]["assembly"], | ||
"scaftigs/{sample}.{assembler}.out/{sample}.{assembler}.scaftigs.fa.gz") | ||
output: | ||
os.path.join( | ||
config["output"]["upload"], | ||
"scaftigs/{assembler}/{sample}.{assembler}.scaftigs.md5") | ||
shell: | ||
''' | ||
md5sum {input} > {output} | ||
''' | ||
|
||
|
||
rule upload_generate_assembly_info: | ||
input: | ||
expand(os.path.join( | ||
config["output"]["upload"], | ||
"scaftigs/{{assembler}}/{sample}.{{assembler}}.scaftigs.md5"), | ||
sample=SAMPLES.index.unique()) | ||
output: | ||
os.path.join(config["output"]["upload"], | ||
"table/Genome_Assembly_{assembler}.xlsx") | ||
threads: | ||
config["upload"]["threads"] | ||
run: | ||
metapi.gen_info(input, output[0], config, threads, "assembly") | ||
|
||
|
||
rule upload_assembly_all: | ||
input: | ||
expand(os.path.join( | ||
config["output"]["upload"], | ||
"table/Genome_Assembly_{assembler}.xlsx"), | ||
assembler=ASSEMBLERS) | ||
|
||
else: | ||
rule upload_assembly_all: | ||
input: | ||
|
||
else: | ||
rule upload_sequencing_all: | ||
input: | ||
|
||
|
||
rule upload_assembly_all: | ||
input: | ||
|
||
|
||
rule upload_all: | ||
input: | ||
expand("{assembly}/{sample}.{assembler}_out/{sample}.{assembler}.scaftigs.fa.gz.md5", | ||
assembly=config["results"]["assembly"], | ||
sample=SAMPLES.index.unique(), | ||
assembler=config["params"]["assembler"]) | ||
output: | ||
os.path.join(config["results"]["upload"], "Genome_Assembly.xlsx") | ||
threads: | ||
config["upload"]["threads"] | ||
run: | ||
metapi.gen_info(input, output[0], config, threads, "assembly") | ||
rules.upload_sequencing_all.input, | ||
rules.upload_assembly_all.input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters