Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix: R encoding of pathlib.Path objects (#1201)
* feat: support converting Path objects for R * test: test for converting Path objects to R * Update script.py * test: Snakemake test for R encoding pathlib.Path objects (missing files) * fix: touch file to make expected-results dir appear in git Co-authored-by: Johannes Köster <johannes.koester@uni-due.de>
- Loading branch information
1 parent
12a9f92
commit bd516e9
Showing
5 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
from pathlib import Path | ||
|
||
|
||
rule all: | ||
input: | ||
out_file="out-file.txt" | ||
|
||
|
||
rule step1: | ||
input: | ||
text_file=Path("text-file.txt") | ||
params: | ||
param_dir=Path("dir") | ||
output: | ||
out_file=Path("out-file.txt") | ||
script: | ||
"r-script.R" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
infile <- snakemake@input[["text_file"]] | ||
|
||
# Check the read value is as expected in R. | ||
param_dir <- snakemake@params[["param_dir"]] | ||
stopifnot(param_dir == "dir") | ||
|
||
outfile <- snakemake@output[["out_file"]] | ||
file.create(outfile) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters