Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If you call the script from outside the script's directory, the Rscript cannot find the temporary files created by the shell script #82

Open
somethingp opened this issue Mar 24, 2022 · 1 comment

Comments

@somethingp
Copy link

I found a solution to this problem by including the full path of the temporary files to the R script.

I edited around line 118 to get the directory the script is being run from (using pwd) and then appending that to the file names passed on to the R script.

path=`dirname $0`
tempfile_path=`pwd`
if [[ -f $2 ]] && [[ $norm == "norm" ]]
then
	echo "Calculating threshold using normalized control: $(date)"
	Rscript $path/SEACR_1.3.R --exp="$tempfile_path/$password.auc" --ctrl="$tempfile_path/$password2.auc" --norm=yes --output="$tempfile_path/$password"
elif [[ -f $2 ]]
then
	echo "Calculating threshold using non-normalized control: $(date)"
	Rscript $path/SEACR_1.3.R --exp="$tempfile_path/$password.auc" --ctrl="$tempfile_path/$password2.auc" --norm=no --output="$tempfile_path/$password"
else
	echo "Using user-provided threshold: $(date)"
	Rscript $path/SEACR_1.3.R --exp="$tempfile_path/$password.auc" --ctrl=$2 --norm=no --output=$tempfile_path/$password
fi
@somethingp somethingp changed the title If you call the script from outside the script's directory, the Rscript cannot find the temporary files created by the script If you call the script from outside the script's directory, the Rscript cannot find the temporary files created by the shell script Mar 24, 2022
@mpmeers
Copy link
Collaborator

mpmeers commented Jun 27, 2022

Hello,

Thanks for the heads up here--I will incorporate this into a future version.

Mike

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

No branches or pull requests

2 participants