kcleal / dysgu

Toolkit for calling structural variants using short or long reads
MIT License
88 stars 10 forks source link

TypeError: an integer is required when using --sites option and manta.vcf #81

Closed bbunce closed 3 months ago

bbunce commented 4 months ago

Hi, am finding Dysgu very useful but I am encountering the following error when using --sites option and a manta.vcf file.

I am using a docker and this is the command I am using:

docker exec dysgu sh -c "dysgu run -p4 \
    /data/input/vcf/$manta \
    /data/input/ref/$ref \
    /data/temp/ \
    /data/input/bams/$bam \
    -x > /data/$sample.dysgu3.vcf"

The error:

2024-02-20 11:29:45,607 [INFO   ]  Writing vcf to stdout
2024-02-20 11:29:46,050 [INFO   ]  Inferred read length 149.0, insert median 407, insert stdev 173
    sys.exit(cli())
  File "/opt/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    sys.exit(cli())
             ^^^^^
  File "/opt/venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/dysgu/main.py", line 259, in run_pipeline
    cluster.cluster_reads(ctx.obj)
  File "dysgu/cluster.pyx", line 1188, in dysgu.cluster.cluster_reads
  File "dysgu/cluster.pyx", line 790, in dysgu.cluster.pipe1
  File "dysgu/graph.pyx", line 1086, in dysgu.graph.construct_graph
  File "dysgu/graph.pyx", line 1212, in dysgu.graph.construct_graph
  File "dysgu/graph.pyx", line 872, in dysgu.graph.process_alignment
  File "dysgu/graph.pyx", line 1074, in dysgu.graph.SiteAdder.add_any_sites
TypeError: an integer is required
kcleal commented 4 months ago

Hi @bbunce, Thanks for reporting this. I haven't tested a manta vcf recently, so apologies for the error. The error message looks like a simple problem to fix, but will have to try and repeat the error to find the culprit - I'm running a test sample now. Would you be able to confirm which version of dysgu you are running?

bbunce commented 4 months ago

Thanks for taking a look at the problem. The Dysgu version is v1.6.2. The vcf was generated using Manta v1.6.0.

kcleal commented 4 months ago

Hi @bbunce, I have fixed the problem, there was a None value when there should have been an integer. The fix is currently on the dysgu_dev branch. It may be a week or so before the fix ends up in a proper release (v1.6.3). I noticed you are using Docker, if that is your only way of running dysgu then you may have to wait for the release. Otherwise you can try building from source (make sure to use the dysgu_dev branch though). Or you can download the wheel file from the CI runner when the build is successful:

https://github.com/kcleal/dysgu/actions/runs

You should be able to install the wheel on debian or macOS (intel).

bbunce commented 4 months ago

Thanks @kcleal. I'm processing whole genomes on the cloud so I prefer using a Docker. I've tried installing Dysgu in an cloud instance using the bash INSTALL.sh but have encountered this error when I try run dysgu:

Traceback (most recent call last):
  File "/usr/bin/dysgu", line 33, in <module>
    sys.exit(load_entry_point('dysgu==1.6.3', 'console_scripts', 'dysgu')())
  File "/usr/bin/dysgu", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/lib/python3.8/importlib/metadata.py", line 503, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.8/importlib/metadata.py", line 177, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: dysgu

If the release is out in a week then I'll wait but if not any advice on how to fix the error above would be appreciated.

kcleal commented 4 months ago

Ok, that's not great. What OS are you using? Have you tried one of the wheel files from the build? Steps are:

Download the artifact from https://github.com/kcleal/dysgu/actions/runs/7975944105 Unzip folder Find the one that matches your OS and python version e.g. For Python3.9 and linux use dysgu-1.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Install using pip install dysgu-1.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Also should work on the host system, or can be run from a docker with python

bbunce commented 4 months ago

Hi @kcleal Thanks for the instructions. I managed to install the wheel file and I have processed a sample using --sites and a manta vcf. It ran successfully with no errors. Thanks you for your quick response and fix.