Skip to content

Commit

Permalink
formatting rule according to good standards
Browse files Browse the repository at this point in the history
  • Loading branch information
LiaOb21 committed Dec 15, 2023
1 parent 5ce9a43 commit 1c3c477
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions workflow/rules/hifi_prep.smk
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ import glob

rule hifi_prep:
input:
expand("{hifi_path}/{file}.fastq.gz", hifi_path=config["hifi_path"], file=glob_wildcards(config["hifi_path"] + "/{file}.fastq.gz").file)
files = expand("{hifi_path}{file}.fastq.gz", hifi_path=config["hifi_path"], file=glob_wildcards(config["hifi_path"] + "{file}.fastq.gz").file)
output:
"results/reads/hifi/hifi.fastq.gz"
hifi = "results/reads/hifi/hifi.fastq.gz"
params:
num_files = len(glob.glob(config["hifi_path"] + "/*.fastq.gz"))
num_files = len(glob.glob(config["hifi_path"] + "*.fastq.gz"))
log:
"logs/hifi_prep.log"
shell:
"""
if [ {params.num_files} -gt 1 ]; then
zcat {input} | gzip > {output}
zcat {input.files} | gzip > {output.hifi}
else
cp {input[0]} {output}
cp {input.files[0]} {output.hifi}
fi
"""

0 comments on commit 1c3c477

Please sign in to comment.