Gitlab is now using https://gitlab.lcsb.uni.lu as it's primary address. Please update your bookmarks. FAQ.

Commit 3198b7e8 authored by ahb-ufz's avatar ahb-ufz
Browse files

start multi

parent 059020c1
Pipeline #20798 failed with stages
in 0 seconds
# include configuration file
include:
"rules/ini/config_multi"
# define the data types used and the assembly
if MG and MT and config['assembly']['hybrid']:
TYPES = ['mg', 'mt']
ASS = 'mgmt'
elif MG and MT:
TYPES = ['mg', 'mt']
ASS = 'mg'
elif MG:
TYPES = ['mg']
ASS = 'mg'
elif MT:
TYPES = ['mt']
ASS = 'mt'
elif MGaln and MTaln:
TYPES = ['mg', 'mt']
ASS = 'mg'
elif MGaln:
TYPES = ['mg']
ASS = 'mg'
elif MTaln:
TYPES = ['mt']
ASS = 'mt'
elif CONTIGS and MG and MT:
TYPES = ['mg', 'mt']
ASS = 'mg'
elif CONTIGS and MG:
TYPES = ['mg']
ASS = 'mg'
elif CONTIGS and MT:
TYPES = ['mt']
ASS = 'mg'
workdir:
OUTPUTDIR
f = open(OUTPUTDIR+'/multi.config.yaml', 'w+')
yaml.dump(config, f, allow_unicode=True,default_flow_style=False)
# include rules for the workflow based on the input parameters
include:
"rules/multi/multi.input.rules"
fin_inputs = []
# multi-methods
if 'collate' in MULT_METHS:
include:
"workflows/multi/Collate"
if 'catalogue' in MULT_METHS or 'catalog' in MULT_METHS:
include:
"workflows/multi/Catalogue"
if 'dereplicate' in MULT_METHS:
include:
"workflows/multi/Dereplicate"
if 'DB' in MULT_METHS:
include:
"workflows/multi/DB"
if 'visualize' in MULT_METHS:
include:
"workflows/multi/Visualization"
else:
raise Exception('Nothing to be done.')
inputs = []
if 'preprocessing' in IMP_STEPS:
inputs.append('preprocessing.done')
if 'assembly' in IMP_STEPS:
inputs.append('assembly.done')
if 'analysis' in IMP_STEPS:
inputs.append('analysis.done')
if 'taxonomy' in IMP_STEPS:
inputs.append('taxonomy.done')
if 'binning' in IMP_STEPS:
inputs.append('binning.done')
# master command
rule ALL:
input:
inputs
output:
touch('workflow.done')
rule tar_intermediary:
input:
"Assembly/%s.assembly.merged.fa" % ASS,
"Assembly/intermediary"
"Assembly/%s.assembly.merged.fa" % ASS
output:
"Assembly/intermediary.tar.gz"
threads: 1
params:
runtime = "8:00:00",
mem = MEMCORE
mem = MEMCORE,
intermediary = "Assembly/intermediary/"
log: "logs/assembly_tar_intermediary.log"
message: "tar_intermediary: Compressing intermediary steps of assembly."
shell:
"""
tar cvzf {output} {input[1]} && rm -r {input[1]} > {log} 2>&1
tar cvzf {output} {params.intermediary} && rm -r {params.intermediary} >> {log} 2>&1
"""
rule contig_fasta_indexing:
......
......@@ -8,7 +8,7 @@ EXTRACT_UNMAPPED_SHELL = """
<(samtools view --threads {threads} -u -f 4 -F 264 $TMP_FILE 2>> {log}) \
<(samtools view --threads {threads} -u -f 8 -F 260 $TMP_FILE 2>> {log}) \
<(samtools view --threads {threads} -u -f 12 -F 256 $TMP_FILE 2>> {log}) 2>> {log} | \
samtools view --threads {threads} -bF 0x800 - 2> {log} | samtools sort --threads {threads} -m {SAMTOOLS_MEM} -n - 2>> {log}| \
samtools view --threads {threads} -bF 0x800 - 2>> {log} | samtools sort --threads {threads} -m {SAMTOOLS_MEM} -n - 2>> {log}| \
bamToFastq -i stdin -fq {output[0]} -fq2 {output[1]} >> {log} 2>&1
if [[ -s {input[2]} ]]
......
......@@ -29,7 +29,7 @@ include:
# master command
rule ASSEMBLY:
input:
# 'Assembly/intermediary.tar.gz',
'Assembly/intermediary.tar.gz',
'Assembly/%s.assembly.merged.fa' %ASS,
'Assembly/%s.assembly.merged.fa.fai' %ASS,
'Assembly/%s.assembly.merged.fa.bed3' %ASS,
......
......@@ -21,7 +21,7 @@ include:
master_ass_input = [
# 'Assembly/intermediary.tar.gz',
'Assembly/intermediary.tar.gz',
'Assembly/mg.assembly.merged.fa',
'Assembly/mg.assembly.merged.fa.fai',
'Assembly/mg.assembly.merged.fa.bed3',
......
......@@ -22,7 +22,7 @@ include:
# master command
rule ASSEMBLY:
input:
# 'Assembly/intermediary.tar.gz',
'Assembly/intermediary.tar.gz',
'Assembly/mt.assembly.merged.fa',
'Assembly/mt.assembly.merged.fa.fai',
'Assembly/mt.assembly.merged.fa.bed3',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment