Skip to content

Commit

Permalink
Ignore OPERA-MS dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulthran committed Feb 2, 2024
1 parent d1def8b commit eb496ba
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.bt2
OPERA-MS/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
33 changes: 28 additions & 5 deletions sbx_demic_ref.smk
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,23 @@ DEMIC_FP = MAPPING_FP / "demic"
DEMIC_REF_FP = DEMIC_FP / "ref"


def get_demic_path() -> Path:
for fp in sys.path:
if fp.split("/")[-1] == "sbx_demic":
return Path(fp)
raise Error(
"Filepath for demic not found, are you sure it's installed under extensions/sbx_demic?"
)


localrules:
all_demic_ref,


rule all_demic_ref:
input:
DEMIC_REF_FP / "all_PTR.txt"
#DEMIC_REF_FP / "all_PTR.txt"
expand(DEMIC_REF_FP / "OPERA_MS" / "{sample}" / "contigs.fasta", sample=Samples.keys())


rule install_opera_ms:
Expand All @@ -40,9 +50,20 @@ rule install_opera_ms:
rule run_opera_ms:
input:
DEMIC_REF_FP / ".installed",
reads=QC_FP / "decontam" / "{sample}_{rp}.fastq.gz",
reads=expand(QC_FP / "decontam" / "{{sample}}_{rp}.fastq.gz", rp=Pairs),
contigs=Cfg["sbx_demic"]["ref_fp"],

output:
DEMIC_REF_FP / "OPERA_MS" / "{sample}" / "contigs.fasta",
params:
demic_fp=str(get_demic_path()),
threads=Cfg["sbx_demic"]["demic_threads"],
conda:
"envs/demic_ref_env.yml"
shell:
"""
cd {params.demic_fp}/OPERA-MS
perl OPERA-MS.pl --num-processors {params.threads} --long-read {input.contigs} --short-read1 {input.reads[0]} --short-read2 {input.reads[1]} --out-dir {output} --no-polishing
"""



Expand All @@ -53,12 +74,12 @@ rule run_opera_ms:
rule run_pycov3_ref:
input:
DEMIC_FP / "sorted",
COASSEMBLY_DEMIC_FP / "max_bin" / "max_bin",
#COASSEMBLY_DEMIC_FP / "max_bin" / "max_bin",
output:
directory(DEMIC_FP / "pycov3"),
params:
sam_dir=str(DEMIC_FP / "sorted"),
fasta_dir=str(COASSEMBLY_DEMIC_FP / "max_bin"),
#fasta_dir=str(COASSEMBLY_DEMIC_FP / "max_bin"),
extras=Cfg["sbx_demic"]["extras"],
threads: Cfg["sbx_demic"]["demic_threads"]
resources:
Expand All @@ -68,6 +89,8 @@ rule run_pycov3_ref:
"envs/demic_bio_env.yml"
log:
LOG_FP / "run_pycov3.log",
benchmark:
BENCHMARK_FP / "run_pycov3_ref.txt",
shell:
"""
pycov3 -S {params.sam_dir} -F {params.fasta_dir} -O {output} -X {params.extras} 2>&1 | tee {log}
Expand Down

0 comments on commit eb496ba

Please sign in to comment.