Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

how to run_params from an outside of the repo #14

Open
alxndrkalinin opened this issue Mar 14, 2023 · 5 comments
Open

how to run_params from an outside of the repo #14

alxndrkalinin opened this issue Mar 14, 2023 · 5 comments

Comments

@alxndrkalinin
Copy link

I wanted to define a relative data_path in a config to make it user-independent (i.e. avoid overriding results folder and configs on Github), but seems like some paths in evalzoo are defined locally.

E.g., defining data_path: "../1.load/output" and trying to run from another repo gives following:

setwd("matric")
source("run_param.R")
setwd("../../position-effect-correction/2.evalzoo")
run_param("params/params_orf_group.yaml")

gives

Error in abs_path(input) : 
  The file '0.knit-notebooks.Rmd' does not exist.
In addition: Warning message:
In normalizePath(x, winslash = winslash, mustWork = must_work) :
  path[1]="0.knit-notebooks.Rmd": No such file or directory

I was able to make it work with data_path: "../../position-effect-correction/1.load/output" and

run_param("../../position-effect-correction/2.evalzoo/params/params_orf_group.yaml", results_root_dir = "../../position-effect-correction/2.evalzoo/results/")

however, it assumes both repos being located in the same directory, so doesn't fully address issues above.

@shntnu
Copy link
Member

shntnu commented Mar 16, 2023

Oops – I certainly put in no effort into this being more than barely usable :D

both repos being located in the same directory,

Can you clarify what you mean by "both repos"?

@alxndrkalinin
Copy link
Author

Oh sorry, I just meant if your evalzoo and position-effect-correction were not checked out to the same directory, then data_path: "../../position-effect-correction/1.load/output" will be incorrect, because it's a relative path from a working directory (that has to be inside evalzoo) to a file inside position-effect-correction.

Basically, when you create a new config for calculating metrics on a dataset, data_path inside this config always has to account for the relative location of of this dataset to evalzoo.

Does this make sense?

@shntnu
Copy link
Member

shntnu commented Mar 17, 2023

Ah got it

So in this param file, you wish you could have specified

https://github.com/broadinstitute/position-effect-correction/blob/cda9e242aebea8031bd01a5a358a2c3507f9f3cb/2.evalzoo/params/params_orf_group.yaml#LL3C11-L3C11

as

data_path: "../1.load/output"

(Now I understand your first comment)

@alxndrkalinin
Copy link
Author

Yep, exactly. And I think it comes down to being able to run run_params from outside of evalzoo/matric.

@shntnu
Copy link
Member

shntnu commented Mar 17, 2023

Got it, and that's where the current strategy of using notebooks as functions gets a bit messy :D I'll keep this open for now and see if there's an easy fix

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants