AGFusion icon indicating copy to clipboard operation
AGFusion copied to clipboard

Protein sequence of breakpoint within 5'UTR in the second partner gene is still buggy [Fix attached]

Open sufyazi opened this issue 3 months ago • 0 comments

This is pertaining to the Python version of AGFusion (latest version, installed from pip).

This bug was described years ago here: https://github.com/murphycj/agfusionweb-react/issues/4

The web app bugfix worked, but the correct behavior was not recapitulated in the Python version. Initially I thought the author has not gotten around to fixing this in the Python version, but a closer look into the only script this behavior depends on, reveals that a fix has been incorporated, but it was not thoroughly tested (there is a simple syntax error that goes unnoticed by Python somehow).

Below is the patched version of model.py.

model.py

If you are having the same issue and wants a quick fix, you can use this patched model.py script as a drop-in simply by following these steps:

  1. Copy and paste the patched model.py script below into a new file using your favourite text editor and save it as model.py precisely (or download it as model.py using the link above)

  2. Find where the installed package of AGFusion is located in your machine by running:

python -c "import agfusion; import os; print(os.path.dirname(agfusion.__file__))"

This returns a path to the directory where model.py should be located. For example, the path to agfusion of my machine is /opt/conda/lib/python3.12/site-packages/agfusion.

  1. Change directory (cd) into this directory, rename model.py to back the unpatched version up
cd /opt/conda/lib/python3.12/site-packages/agfusion && cp model.py model.py.backup
  1. Now mv the patched version of model.py you saved/downloaded to this location. For example, if you downloaded it to your Downloads folder, then do this:
mv ~/Downloads/model.py ./

Now you can rerun AGFusion and AGFusion should run with the correct behaviour. As the edit I made is purely syntactic, this should be very safe. I am not creating a pull request because the author is no longer maintaining this repo.

sufyazi avatar Oct 09 '25 04:10 sufyazi