Human-GEM icon indicating copy to clipboard operation
Human-GEM copied to clipboard

prepHumanModelForftINIT should take the paths to reactions.tsv and essential tasks as optional params

Open johan-gson opened this issue 3 years ago • 2 comments

Description of the issue:

The current code is problematic since it uses "which('reactions.tsv')" - if we use for example the mouse model, it will grab the file for Human-GEM and so forth. I'm making an issue so we don't forget to change this.

Expected feature/value/output:

Just add these as params.

Current feature/value/output:

Reproducing these results:

I hereby confirm that I have:

  • [ ] Tested my code on my own computer for running the model
  • [X] Done this analysis in the main branch of the repository
  • [X] Checked that a similar issue does not exist already

johan-gson avatar Jul 11 '22 21:07 johan-gson

Another option instead of making them into params is to code their paths relative to the location of the prepHumanModelForftINIT function. Since the location of the files relative to the function is not likely to change often or at all, I think it would be sufficiently stable.

For example, the translateGrRules function uses the following code to read the genes.tsv file whose relative path from the function is ../../model/genes.tsv:

[ST, I] = dbstack('-completenames');
path = fileparts(ST(I).file);
tmpfile = fullfile(path,'..','..','model','genes.tsv');

JonathanRob avatar Jul 12 '22 05:07 JonathanRob

This would be an improvement to the default option, agreed, good suggestion! I think however that it would still be problematic for the mouse model. So, when using the mouse model, we would still use the function in Human-GEM, but with different files and a different model. The automatic code will then take the reactions.tsv from Human-GEM. In practice, reactions.tsv is most likely the same, but it still doesn't feel right to use the one in Human-GEM. I propose then to use the code you proposed above as default option, but still make possible to send the path in as a parameter for the two files. In practice, this will not matter much, but maybe they will diverge at some point.

johan-gson avatar Jul 13 '22 10:07 johan-gson

I think we can close this now?

johan-gson avatar Mar 28 '23 16:03 johan-gson