Skip to content
Snippets Groups Projects
Commit 7576bd59 authored by Valentina Galata's avatar Valentina Galata
Browse files

mapping: minor change in targets (ave cov for filtered contigs); new rule/targets (issue #84)

parent 1600fdd4
No related branches found
No related tags found
No related merge requests found
......@@ -311,6 +311,24 @@ rule mapping_assembly_genomecov_average:
shell:
"(date && cat {input} | awk -f {params.script} | tail -n+2 > {output} && date) &> {log}"
rule mapping_assembly_genomecov_bg:
input:
os.path.join(RESULTS_DIR, "mapping/{mtype}/{rtype}/{tool}/{atype}.sr.bam")
output:
os.path.join(RESULTS_DIR, "mapping/{mtype}/{rtype}/{tool}/{atype}.sr.cov.bg")
wildcard_constraints:
mtype="|".join(META_TYPES),
rtype="|".join(READ_TYPES),
tool="|".join(ASSEMBLERS),
atype="ASSEMBLY|ASSEMBLY.FILTERED"
threads: 1
conda:
os.path.join(ENV_DIR, "bedtools.yaml")
message:
"Mapping: compute assembly coverage"
shell:
"bedtools genomecov -bg -ibam {input} > {output}"
##################################################
# Mappability index
......
......@@ -18,14 +18,22 @@ rule MAPPING:
rule COVERAGE:
input:
# default: map metaG (LR/SR/hybrid) to filtered contigs
metag=expand(
os.path.join(RESULTS_DIR, "mapping/metag/{rtype_tool}.cov.ave.txt"),
rtype_tool=["{r}/{t}/ASSEMBLY.{r}".format(r=r, t=t) for r, t in READ_ASSEMBLERS]
rtype_tool=["{r}/{t}/ASSEMBLY.FILTERED.{r}".format(r=r, t=t) for r, t in READ_ASSEMBLERS]
),
# if metaT: map metaT (SR) to filtered contigs
metat=expand(
os.path.join(RESULTS_DIR, "mapping/metat/{rtype_tool}.cov.ave.txt"),
rtype_tool=["{r}/{t}/ASSEMBLY.FILTERED.sr".format(r=r, t=t) for r, t in READ_ASSEMBLERS]
) if "metat" in META_TYPES else []
) if "metat" in META_TYPES else [],
# metaG/metaT SR coverage
srcov=expand(
os.path.join(RESULTS_DIR, "mapping/{mtype}/{rtype_tool}.cov.bg"),
mtype=META_TYPES,
rtype_tool=["{r}/{t}/ASSEMBLY.FILTERED.sr".format(r=r, t=t) for r, t in READ_ASSEMBLERS]
)
output:
touch("status/coverage.done")
......
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