AlexsLemonade / OpenPBTA-analysis

The analysis repository for the Open Pediatric Brain Tumor Atlas Project
Other
100 stars 67 forks source link

Update the shell scripts in `snv-callers` to have a consistent working directory #1406

Closed jaclyn-taroni closed 2 years ago

jaclyn-taroni commented 2 years ago

@runjin326 is running the generate-analysis-files-for-release.sh script described here: https://github.com/AlexsLemonade/OpenPBTA-analysis/issues/1399#issuecomment-1124329628

The script fails at the SNV callers step with the following error:

Run SNV callers module for PBTA data
Setting up Database
python3: can't open file 'analyses/snv-callers/scripts/01-setup_db.py': [Errno 2] No such file or directory

Which stems from this line: https://github.com/jaclyn-taroni/OpenPBTA-analysis/blob/f95853e50c92fa850a156f00cd914808e88cf098/scripts/generate-analysis-files-for-release.sh#L63

And subsequently:

https://github.com/AlexsLemonade/OpenPBTA-analysis/blob/c9b0f4456066f821f2c67983bdd822ed209d8b7a/analyses/snv-callers/run_caller_consensus_analysis-pbta.sh#L30

I believe the source of the error is that there is nothing in the shell script analyses/snv-callers/run_caller_consensus_analysis-pbta.sh that causes it to have a consistent working directory. So, when it gets called from scripts/generate-analysis-files-for-release.sh, its working directory is scripts/ which does not contain analyses/snv-callers/scripts/01-setup_db.py.

It would be consistent with other aspects of the project to set the shell script's working directory to where the file is located in the project, e.g., with:

https://github.com/AlexsLemonade/OpenPBTA-analysis/blob/c9b0f4456066f821f2c67983bdd822ed209d8b7a/analyses/interaction-plots/01-create-interaction-plots.sh#L14

Then we'd change all of the paths to the scripts in analyses/snv-callers/run_caller_consensus_analysis-pbta.sh to be relative to analyses/snv-callers. If I recall correctly, all the scripts in the module already assume the paths to files (e.g., MAF files) supplied as arguments are relative to the root of the repository, so we won't have to do anything there.

Note: I haven't look at the TCGA shell script in snv-callers, but I'm willing to bet we'd have to do the same thing.