ProtProtocols / IsoProt

Protocol of the analysis of iTRAQ/TMT proteomics data including quantification, statistical analysis and maybe clustering
https://protprotocols.github.io
11 stars 4 forks source link

Scripts change working directory and break search #38

Closed jgriss closed 6 years ago

jgriss commented 6 years ago

If you run the Example.ipnyb workflow including the R analysis and then change, for example, the experimental design and re-launch the search by clicking the button, the script fails since some other script changed the working directory to the OUT folder and the python scripts can no-longer be found.

I have three solutions: 1.) Use absolute paths for the python scripts (most robust) 2.) Change the working directory back to the default as a first command in the python cell (not very elegant) 3.) Never change the working directory in any other script (requires discipline and therefore might fail)

@veitveit @gvinterhalter Please vote whichever option you prefer. I prefer option 1

jgriss commented 6 years ago

Thinking about this some more: I am not quite sure if all our scripts are robust against a changed working directory.

Therefore, if we choose option 1 we need to check all scripts that they assume some working directory.

To prevent any issues maybe option 3 (never changing the working directory) might be more appropriate.

gvinterhalter commented 6 years ago

I remember that when the first R script was crashing it would leave the working directory changed. Drove me nuts. I assumed that when R script finished correctly it wold revert the working dir. Both cases to me are a bug.

Maybe the option 1) is most appropriate (and pain in the ***) as you wanted robust scripts that can be reused in different projects. So when you call the GUI you pass the root path and the GUI teeters all the paths local to the root?

On Wed, Jul 11, 2018 at 11:27 AM, Johannes Griss notifications@github.com wrote:

Thinking about this some more: I am not quite sure if all our scripts are robust against a changed working directory.

Therefore, if we choose option 1 we need to check all scripts that they assume some working directory.

To prevent any issues maybe option 3 (never changing the working directory) might be more appropriate.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ProtProtocols/IsoLabeledProtocol/issues/38#issuecomment-404105353, or mute the thread https://github.com/notifications/unsubscribe-auth/AF6yEYGAVQ5twnw0QyYxQ1GoOs0_HuWVks5uFcUbgaJpZM4VKybo .

-- Goran Vinterhalter

veitveit commented 6 years ago

Oh, I didn't know that it was the R scripts to change the working directory! I will change them to use only absolute paths. Then we should be OK.

2018-07-11 12:04 GMT+02:00 Goran notifications@github.com:

I remember that when the first R script was crashing it would leave the working directory changed. Drove me nuts. I assumed that when R script finished correctly it wold revert the working dir. Both cases to me are a bug.

Maybe the option 1) is most appropriate (and pain in the ***) as you wanted robust scripts that can be reused in different projects. So when you call the GUI you pass the root path and the GUI teeters all the paths local to the root?

On Wed, Jul 11, 2018 at 11:27 AM, Johannes Griss <notifications@github.com

wrote:

Thinking about this some more: I am not quite sure if all our scripts are robust against a changed working directory.

Therefore, if we choose option 1 we need to check all scripts that they assume some working directory.

To prevent any issues maybe option 3 (never changing the working directory) might be more appropriate.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ProtProtocols/IsoLabeledProtocol/issues/38# issuecomment-404105353, or mute the thread https://github.com/notifications/unsubscribe-auth/ AF6yEYGAVQ5twnw0QyYxQ1GoOs0_HuWVks5uFcUbgaJpZM4VKybo .

-- Goran Vinterhalter

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ProtProtocols/IsoLabeledProtocol/issues/38#issuecomment-404115646, or mute the thread https://github.com/notifications/unsubscribe-auth/APEZhfHZC0gkKB9LY2MjPcxrDyJQSL1Vks5uFc2WgaJpZM4VKybo .

-- |||/ (o o) ----ooO-(_)-Ooo----

Don't worry about life; you're not going to survive it anyway.

http://computproteomics.bmb.sdu.dk

veitveit commented 6 years ago

The R scripts should not change folders anymore and are using absolute paths. Let's see whether this is fixed now.