Skip to content

Commit

Permalink
Fix LDA file name bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dirmeier committed Aug 9, 2019
1 parent 28613cf commit 5a8d54a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pybda/config/rule_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, method, algorithm, parent, infile, outfolder):
self.__infile = infile if parent is None else parent.outfile
self.__level = 0 if parent is None else parent.level + 1
try:
infl_suffix = re.match("(?:.+/)?(.+)\.tsv", self.__infile).group(1)
infl_suffix = re.match(r"(?:.+/)?(.+)\.tsv", self.__infile).group(1)
self.__outfile = os.path.join(
outfolder, algorithm + "_from_{}".format(infl_suffix)) + ".tsv"
except AttributeError or TypeError:
Expand Down
16 changes: 8 additions & 8 deletions pybda/pybda.snake
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,18 @@ rule ica:

rule lda:
input:
expand("{infile}", infile=pybda_config[INFILE__])
expand("{infile}", infile=pybda_config.infiles(LDA__))
output:
expand("{outfolder}/{dimred}{fls}",
outfolder=pybda_config[OUTFOLDER__],
dimred=LDA__, fls=[".tsv", "-projection.tsv"]),
dimred=pybda_config.outfiles_basename(LDA__),
fls=[".tsv", "-projection.tsv"]),
directory(expand("{outfolder}/{dimred}-plot",
outfolder=pybda_config[OUTFOLDER__],
dimred=LDA__))
dimred=pybda_config.outfiles_basename(LDA__)))
params:
out = expand("{outfolder}/{dimred}",
outfolder=pybda_config[OUTFOLDER__],
dimred=LDA__),
out = os.path.join(pybda_config[OUTFOLDER__],
pybda_config.outfiles_basename(LDA__)),
pca = os.path.join(dirname(), "lda.py"),
params = " ".join([x for x in pybda_config[SPARKPARAMS__]])
run:
Expand All @@ -192,8 +192,8 @@ rule lda:
input,
pybda_config[FEATURES__],
pybda_config[RESPONSE__],
params.out[0],
params.out[0] + "-spark.log")
params.out,
params.out + "-spark.log")
_run(cmd)


Expand Down

0 comments on commit 5a8d54a

Please sign in to comment.