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

bug: permission issues when overwriting domains_color_file #41

Closed
wants to merge 1 commit into from

Conversation

currocam
Copy link

@currocam currocam commented May 11, 2023

As explained in this issue, there are problems with Singularity because the code tries to overwrite the source file.

This is fine if the user has write permissions on that file (as I understand, in the Docker image and Singularity, if you use the --writable argument). However, I think there are better solutions than this (especially when integrating the program into a pipeline).

It is unclear how the code works: is it necessary to overwrite this file? Could you use temporary files? Although I do not have much knowledge, I would say that the program's current behavior (being able to edit a tsv file persistently) could be achieved by creating a "configuration" file in the user's home folder rather than overwriting the source code of the program. I have attached a PR with an initial proposal.

Copy link
Author

@currocam currocam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of overwriting the source file, copy it into user's home directory

currocam

This comment was marked as duplicate.

@jowodo
Copy link

jowodo commented Aug 2, 2023

I encountered the same issue as in #22, but in a centrally installed conda environment.
This is how I installed it:

VERSION=1.1.5
conda env create --name bigscape-$VERSION --file https://raw.githubusercontent.com/medema-group/BiG-SCAPE/v${VERSION}/bigscape_dependencies.yml
conda activate bigscape-$VERSION
mkdir -p ${CONDA_PREFIX}/share
pushd ${CONDA_PREFIX}/share
git clone --quiet --depth 1 --branch v$VERSION $URL
chmod +x BiG-SCAPE/bigscape.py
pushd ${CONDA_PREFIX}/bin/
ln -s ../share/BiG-SCAPE/bigscape.py bigscape.py
# resolve bug
# https://github.com/medema-group/BiG-SCAPE/issues/22
# https://stackoverflow.com/a/44853818/17440360
cp $CONDA_PREFIX/share/BiG-SCAPE/ArrowerSVG.py $CONDA_PREFIX/share/BiG-SCAPE/ArrowerSVG.py.bkp
grep -A8 -n " if len(new_color_domains)" $CONDA_PREFIX/share/BiG-SCAPE/ArrowerSVG.py | sed -e 's/[^0-9].*$//' -e 's/$/s|^|#|/' | sed -f- -i $CONDA_PREFIX/share/BiG-SCAPE/ArrowerSVG.py
popd; popd

I agree with @currocam that not editing the source code, but writing to a new file, would be advantages.

@adraismawur
Copy link
Collaborator

Hello! Thanks for the contribution and sorry it took us so long to address this. I have opened a new pull request which should resolve this issue by copying the colors file into the output directory instead. I'd prefer not to put anything in the users' home directory.

@adraismawur adraismawur self-assigned this Sep 12, 2023
@jowodo
Copy link

jowodo commented Sep 19, 2023

Looking forward to the next release :)

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

Successfully merging this pull request may close these issues.

3 participants