Skip to content
Snippets Groups Projects
Commit b830aa60 authored by Shaman Narayanasamy's avatar Shaman Narayanasamy
Browse files
parents 27b14136 f2c09bce
No related branches found
No related tags found
No related merge requests found
......@@ -91,11 +91,14 @@ if __name__ == '__main__':
# CL
cmd = ['docker', 'run'] + mount_points + envs
# reconfigure entrypoint if --enter flag is specified
# if --enter flag is specified, add attach tty and set mode to interactive
if args['--enter']:
cmd += ['--entrypoint /bin/bash -it']
cmd += ['-it']
# add container name and commands to pass to snakemake
cmd += [container_name] + args['COMMANDS']
# if --enter flag is specified, change the command
if args['--enter']:
cmd += ['/bin/bash']
# parse CL correctly
cmd = shlex.split(' '.join(cmd))
print("Executing", '"', ' '.join(cmd), '"')
......
......@@ -216,5 +216,4 @@ ENV PATH /home/imp/lib/trinityrnaseq_r20140717:/home/imp/lib/Platypus_0.8.1:/hom
VOLUME ["/data", "/output"]
WORKDIR /home/imp/integrated-metaomic-pipeline
ENTRYPOINT ["snakemake"]
CMD ["ALL"]
CMD ["snakemake", "ALL"]
......@@ -21,13 +21,16 @@ rule ASSEMBLY_MT_MEGAHIT_1:
outdir = "{dir}/MT.assembly_1".format(dir=A_OUT)
shell:
"""
if [ -d "{params.outdir}" ]; then
rm -rf {params.outdir}
fi
MAX_READ_LEN=$(cat {input} | sed -n '1~4s/^@/>/p;2~4p' |\
awk '$0 ~ \">\" {{c=0\"\t\"; }} $0 !~ \">\" {{c+=length($0); max=(max>c)?max:c;}} END {{print max}}')
echo "Max read length: $MAX_READ_LEN"
MEMBYTES=$(({MEMTOTAL}*1000*1000*1000))
echo "Available memory in bytes: $MEMBYTES"
megahit -o {params.outdir} --cpu-only -m $MEMBYTES --mem-flag 1\
-l $MAX_READ_LEN --input-cmd "cat {input}" -t {THREADS} --continue >> {log} 2>&1
-l $MAX_READ_LEN --input-cmd "cat {input}" -t {THREADS} >> {log} 2>&1
"""
......@@ -80,13 +83,17 @@ rule ASSEMBLY_MT_MEGAHIT_2:
outdir = "{dir}/MT.assembly_2".format(dir=A_OUT)
shell:
"""
if [ -d "{params.outdir}" ]; then
rm -rf {params.outdir}
fi
MAX_READ_LEN=$(cat {input} | sed -n '1~4s/^@/>/p;2~4p' | \
awk '$0 ~ \">\" {{c=0\"\t\"; }} $0 !~ \">\" {{c+=length($0); max=(max>c)?max:c;}} END {{print max}}')
echo "Max read length: $MAX_READ_LEN"
MEMBYTES=$(({MEMTOTAL}*1000*1000*1000))
echo "Available memory in bytes: $MEMBYTES"
megahit -o {params.outdir} --cpu-only -m $MEMBYTES --mem-flag 1 -l $MAX_READ_LEN \
--input-cmd "cat {input}" -t {THREADS} --continue >> {log} 2>&1
--input-cmd "cat {input}" -t {THREADS} >> {log} 2>&1
"""
rule ASSEMBLY_MT_CAT_MEGAHIT:
......@@ -424,13 +431,16 @@ rule ASSEMBLY_MGMT_FAST_1:
outdir = "{dir}/MGMT.assembly_1".format(dir=A_OUT)
shell:
"""
if [ -d "{params.outdir}" ]; then
rm -rf {params.outdir}
fi
MAX_READ_LEN=$(cat {input} | sed -n '1~4s/^@/>/p;2~4p' |\
awk '$0 ~ \">\" {{c=0\"\t\"; }} $0 !~ \">\" {{c+=length($0); max=(max>c)?max:c;}} END {{print max}}')
echo "Max read length: $MAX_READ_LEN"
MEMBYTES=$(({MEMTOTAL}*1000*1000*1000))
echo "Available memory in bytes: $MEMBYTES"
megahit -o {params.outdir} --cpu-only -m $MEMBYTES --mem-flag 1\
-l $MAX_READ_LEN --input-cmd "cat {input}" -t {THREADS} --continue >> {log} 2>&1
-l $MAX_READ_LEN --input-cmd "cat {input}" -t {THREADS} >> {log} 2>&1
"""
rule ASSEMBLY_MGMT_EXTRACT_UNMAPPED_FROM_FAST_1:
......@@ -482,9 +492,12 @@ rule ASSEMBLY_MGMT_FAST_2:
outdir = "{dir}/MGMT.assembly_2".format(dir=A_OUT)
shell:
"""
if [ -d "{params.outdir}" ]; then
rm -rf {params.outdir}
fi
MAX_READ_LEN=$(cat {input} | sed -n '1~4s/^@/>/p;2~4p' | \
awk '$0 ~ \">\" {{c=0\"\t\"; }} $0 !~ \">\" {{c+=length($0); max=(max>c)?max:c;}} END {{print max}}')
MEMBYTES=$(({MEMTOTAL}*1000*1000*1000))
megahit -o {params.outdir} --cpu-only -m $MEMBYTES --mem-flag 1 -l $MAX_READ_LEN \
--input-cmd "cat {input}" -t {THREADS} --continue >> {log} 2>&1
--input-cmd "cat {input}" -t {THREADS} >> {log} 2>&1
"""
......@@ -61,7 +61,7 @@
]
},
"prokka": {
"pkg_url": "http://www.vicbioinformatics.com/prokka-1.11.tar.gz",
"pkg_url": "https://webdav-r3lab.uni.lu/public/R3lab/IMP/prokka-1.11.tar.gz",
"databases": [
"cm/Bacteria.i1i",
"genus/Staphylococcus.phr",
......
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