-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hi,
I thought I would try out VILOCA but I'm encountering several issues, both with my data and with the test data.
Issues with printing the version of VILOCA
This is probably the simplest issue to fix. When viloca --version using a conda installation or docker image, I get the following:
# docker
$ docker run -v $PWD:$PWD -w $PWD quay.io/biocontainers/viloca:1.1.0--pyhdfd78af_0 viloca --version
1.0.0
# conda
(viloca) $ viloca --version
/Users/charles/miniforge3/envs/viloca/lib/python3.10/site-packages/viloca/cli.py:50: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
from pkg_resources import (get_distribution, DistributionNotFound)
1.0.0
In short: the version number doesn't align with the installed version. I'm running v1.1.0 but --version flag returns 1.0.0.
pkg_resources problem
As seen above in the conda code block, the conda installation has pkg_resources issues. This can be solved by pinning an earlier version of setuptools or transitioning to importlib.
i.e. in cli.py change:
use_pkg_resources = False
all_dirs = os.path.abspath(__file__).split(os.sep)
base_dir = os.sep.join(all_dirs[:-all_dirs[::-1].index('viloca')])
version_fname = os.path.join(base_dir, '.version')
if os.path.exists(version_fname):
# probably installed using Autotools, e.g: bioconda package - the current recommended way
with open(version_fname, 'r') as version_file:
__version__ = version_file.read()
else:
# probably installed using setup.py
from pkg_resources import (get_distribution, DistributionNotFound)
try:
__version__ = get_distribution('viloca').version
except DistributionNotFound:
__version__ = 'unknown'
print("cannot find version", file=sys.stderr)
else:
use_pkg_resources = True
to:
all_dirs = os.path.abspath(__file__).split(os.sep)
base_dir = os.sep.join(all_dirs[:-all_dirs[::-1].index('viloca')])
version_fname = os.path.join(base_dir, '.version')
if os.path.exists(version_fname):
# probably installed using Autotools, e.g: bioconda package - the current recommended way
with open(version_fname, 'r') as version_file:
__version__ = version_file.read()
else:
# fallback: determine version via importlib.metadata (PEP 566)
try:
from importlib import metadata as importlib_metadata # Python ≥3.8
except ImportError:
import importlib_metadata # type: ignore
try:
__version__ = importlib_metadata.version("viloca")
except importlib_metadata.PackageNotFoundError:
__version__ = "unknown"
I don't think there are necessary changes to other files, but you would know better than me :)
VILOCA not finding any reads
This is the most important problem I've encountered. VILOCA isn't giving any results because it states No reads found in the requested region. For example, using the test data sourced from GitHub:
$ viloca run -b test_aln.cram -f test_ref.fasta
/Users/charles/miniforge3/envs/viloca/lib/python3.10/site-packages/viloca/cli.py:50: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
from pkg_resources import (get_distribution, DistributionNotFound)
No reads found in the requested region
If I run the same command with VILOCA v1.0.0 I get results. It seems like something has gone wrong in the v1.0.0 --> v1.1.0 transition.
Output directory option?
Could you consider adding an option to specify an output directory? It would be useful rather than all outputs going into the working directory.
Cheers,
Charles