Commit 80dc8d9c authored by Valentina Galata's avatar Valentina Galata
Browse files

init: split link_input_files into LR/SR (better for updates, no effect on output)

parent bb04dfe0
...@@ -41,22 +41,29 @@ READ_ASSEMBLER_PAIRS = assembler_pairs(READ_ASSEMBLERS) ...@@ -41,22 +41,29 @@ READ_ASSEMBLER_PAIRS = assembler_pairs(READ_ASSEMBLERS)
BWA_IDX_EXT = ["amb", "ann", "bwt", "pac", "sa"] BWA_IDX_EXT = ["amb", "ann", "bwt", "pac", "sa"]
# Set links to input files # Set links to input files
localrules: link_input_files localrules: link_input_files_lr, link_input_files_sr
rule link_input_files: rule link_input_files_lr:
output: output:
metag_lr=os.path.join(RESULTS_DIR, "preproc/metag/lr/lr.fastq.gz"), metag_lr=os.path.join(RESULTS_DIR, "preproc/metag/lr/lr.fastq.gz")
metag_sr=expand(os.path.join(RESULTS_DIR, "input/metag/sr/{rid}.fq.gz"), rid={"R1", "R2"}),
metat_sr=expand(os.path.join(RESULTS_DIR, "input/metat/sr/{rid}.fq.gz"), rid={"R1", "R2"}) if "metat" in META_TYPES else []
message: message:
"Link input files" "Link input files: LR"
run: run:
import os import os
from pathlib import Path from pathlib import Path
# metaG, FASTQ
ifname = os.path.abspath(config["data"]["metag"]["ont"]["fastq"]) ifname = os.path.abspath(config["data"]["metag"]["ont"]["fastq"])
ofname = os.path.join(RESULTS_DIR, "preproc/metag/lr/lr.fastq.gz") ofname = os.path.join(RESULTS_DIR, "preproc/metag/lr/lr.fastq.gz")
os.symlink(os.path.abspath(ifname), ofname, target_is_directory=False) os.symlink(os.path.abspath(ifname), ofname, target_is_directory=False)
rule link_input_files_sr:
output:
metag_sr=expand(os.path.join(RESULTS_DIR, "input/metag/sr/{rid}.fq.gz"), rid={"R1", "R2"}),
metat_sr=expand(os.path.join(RESULTS_DIR, "input/metat/sr/{rid}.fq.gz"), rid={"R1", "R2"}) if "metat" in META_TYPES else []
message:
"Link input files: SR"
run:
import os
from pathlib import Path
# metaG, SR # metaG, SR
os.symlink(os.path.abspath(config["data"]["metag"]["sr"]["r1"]), os.path.join(RESULTS_DIR, "input/metag/sr/R1.fq.gz"), target_is_directory=False) os.symlink(os.path.abspath(config["data"]["metag"]["sr"]["r1"]), os.path.join(RESULTS_DIR, "input/metag/sr/R1.fq.gz"), target_is_directory=False)
os.symlink(os.path.abspath(config["data"]["metag"]["sr"]["r2"]), os.path.join(RESULTS_DIR, "input/metag/sr/R2.fq.gz"), target_is_directory=False) os.symlink(os.path.abspath(config["data"]["metag"]["sr"]["r2"]), os.path.join(RESULTS_DIR, "input/metag/sr/R2.fq.gz"), target_is_directory=False)
...@@ -64,4 +71,3 @@ rule link_input_files: ...@@ -64,4 +71,3 @@ rule link_input_files:
if "metat" in META_TYPES: if "metat" in META_TYPES:
os.symlink(os.path.abspath(config["data"]["metat"]["sr"]["r1"]), os.path.join(RESULTS_DIR, "input/metat/sr/R1.fq.gz"), target_is_directory=False) os.symlink(os.path.abspath(config["data"]["metat"]["sr"]["r1"]), os.path.join(RESULTS_DIR, "input/metat/sr/R1.fq.gz"), target_is_directory=False)
os.symlink(os.path.abspath(config["data"]["metat"]["sr"]["r2"]), os.path.join(RESULTS_DIR, "input/metat/sr/R2.fq.gz"), target_is_directory=False) os.symlink(os.path.abspath(config["data"]["metat"]["sr"]["r2"]), os.path.join(RESULTS_DIR, "input/metat/sr/R2.fq.gz"), target_is_directory=False)
\ No newline at end of file
\ No newline at end of file
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