Skip to content

Commit

Permalink
remove tax_collapse
Browse files Browse the repository at this point in the history
  • Loading branch information
farchaab committed Dec 6, 2024
1 parent 88c9990 commit 1316da0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 26 deletions.
5 changes: 3 additions & 2 deletions zamp/DBprocess.Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ TAXONOMY = config.args.taxonomy
CLASSIFIERS = config.args.classifier
RDP_MEM = config.args.rdp_mem
PROCESS = config.args.processing
TAX_COLLAPSE = dict(config.args.tax_collapse)

## Cutadapt args
ERRORS = config.args.errors
Expand Down Expand Up @@ -72,7 +71,9 @@ if "--use-singularity" in sys.argv:
workflow.deployment_settings.apptainer_args += (
f" -B {workflow.basedir}:{workflow.basedir}"
)
workflow.deployment_settings.apptainer_args += f" -B {os.path.abspath(DBPATH)}:{os.path.abspath(DBPATH)}"
workflow.deployment_settings.apptainer_args += (
f" -B {os.path.abspath(DBPATH)}:{os.path.abspath(DBPATH)}"
)
#### Load a dictionnary of singularity containers that will be called from each rule
singularity_envs = yaml.safe_load(
open(os.path.join(workflow.basedir, "envs", "singularity", "sing_envs.yml"), "r")
Expand Down
33 changes: 16 additions & 17 deletions zamp/rules/DB_processing/DB_preprocessing.rules
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ rule Extract_amplicons_cutadapt:
threads: 3
shell:
"""
cutadapt \
--cores {threads} \
--error-rate {params.errors} \
--times 1 \
-o {output} \
-g "{params.adapter}" \
--discard-untrimmed \
--minimum-length {params.minlen} \
--maximum-length {params.maxlen} \
cutadapt \\
--cores {threads} \\
--error-rate {params.errors} \\
--times 1 \\
-o {output} \\
-g "{params.adapter}" \\
--discard-untrimmed \\
--minimum-length {params.minlen} \\
--maximum-length {params.maxlen} \\
{input} > {log}
"""

Expand All @@ -49,10 +49,10 @@ rule Dereplicate_amplicons:
threads: 1
shell:
"""
vsearch \
--derep_fulllength {input} \
--output {output.fa} \
--uc {output.uc} \
vsearch \\
--derep_fulllength {input} \\
--output {output.fa} \\
--uc {output.uc} \\
2> {log}
"""

Expand All @@ -66,14 +66,13 @@ rule Derep_and_merge_taxonomy:
tax=os.path.join("{prefix}", "master", "original_tax.txt"),
uc=os.path.join("{prefix}", "QIIME", "DB_amp.uc"),
output:
formatted_tax=os.path.join("{prefix}", "QIIME", "DB_amp_taxonomy.txt"),
collapsed=os.path.join("{prefix}", "QIIME", "DB_amp_taxonomy.txt"),
all=os.path.join("{prefix}", "QIIME", "DB_amp_all_taxonomy.txt"),
problematic=os.path.join("{prefix}", "QIIME", "problematic_taxa.txt"),
ambiguous=os.path.join("{prefix}", "QIIME", "ambiguous_taxa.txt"),
log:
os.path.join("{prefix}", "logs", "QIIME", "derep_and_merge.log"),
params:
db_name=DBNAME,
tax_collapse=TAX_COLLAPSE,
threads: 1
script:
os.path.join("scripts", "tax_formatting.py")
Expand All @@ -83,7 +82,7 @@ rule Hash_derep_tax:
input:
os.path.join("{prefix}", "QIIME", "DB_amp_taxonomy.txt"),
os.path.join("{prefix}", "QIIME", "DB_amp_all_taxonomy.txt"),
os.path.join("{prefix}", "QIIME", "problematic_taxa.txt"),
os.path.join("{prefix}", "QIIME", "ambiguous_taxa.txt"),
os.path.join("{prefix}", "QIIME", "DB_amp.fasta"),
output:
os.path.join("{prefix}", "QIIME", "DB_formatted.hash"),
Expand Down
7 changes: 0 additions & 7 deletions zamp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,6 @@ def db_options(func):
help="Extract amplicon regions and merge taxonomy",
show_default=True,
),
click.option(
"--tax-collapse",
help="Dictionary of number of ranks to print limit when collapsing names ",
default='{"Species": 5, "Genus": 6}',
callback=validate_dict,
show_default=True,
),
click.option(
"--fw-primer",
type=str,
Expand Down

0 comments on commit 1316da0

Please sign in to comment.