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

KeyError of "calculate_coverage" in multi-sample binning #180

Open
KageyamaTakuya opened this issue Dec 3, 2024 · 0 comments
Open

KeyError of "calculate_coverage" in multi-sample binning #180

KageyamaTakuya opened this issue Dec 3, 2024 · 0 comments

Comments

@KageyamaTakuya
Copy link

Hi developers.

I tried multi-sample binning for PacBio 4 samples in conda environment.
But, an error occurred;

(SemiBin) evolution@Threadripper64:/media/evolution/a4be100a-3b42-460a-9f01-9948fb54741e/Kageyama/241104_soil_pacbio$ SemiBin2 multi_easy_bin \
--sequencing-type long_read \
--threads ${CPU} \
--engine cpu \
-i 03_binning/SemiBin2/concatenated.fa.gz \
-b 02_mapping/m84142_240924_053830_s2.bam 02_mapping/m84142_240924_073752_s3.bam 02_mapping/m84142_240924_093700_s4.bam 02_mapping/m84142_240924_113625_s1.bam \
-o 03_binning/SemiBin2/multi_output
2024-12-03 13:48:03 Threadripper64 SemiBin[34927] INFO Binning for long_read
2024-12-03 13:48:03 Threadripper64 SemiBin[34927] INFO SemiBin will run in self supervised mode
2024-12-03 13:48:04 Threadripper64 SemiBin[34927] INFO Running with CPU.
2024-12-03 13:48:04 Threadripper64 SemiBin[34927] INFO Performing multi-sample binning
2024-12-03 13:48:04 Threadripper64 SemiBin[34927] INFO Generating training data...
2024-12-03 13:50:45 Threadripper64 SemiBin[34927] INFO Calculating coverage for every sample.
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/evolution/miniforge3/envs/SemiBin/lib/python3.12/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/home/evolution/miniforge3/envs/SemiBin/lib/python3.12/site-packages/SemiBin/generate_coverage.py", line 100, in generate_cov
    contig_cov, must_link_contig_cov = calculate_coverage(
                                       ^^^^^^^^^^^^^^^^^^^
  File "/home/evolution/miniforge3/envs/SemiBin/lib/python3.12/site-packages/SemiBin/generate_coverage.py", line 45, in calculate_coverage
    cov_threshold = contig_threshold_dict[sample_name]
                    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 's0.ctg000001l'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/evolution/miniforge3/envs/SemiBin/bin/SemiBin2", line 10, in <module>
    sys.exit(main2())
             ^^^^^^^
  File "/home/evolution/miniforge3/envs/SemiBin/lib/python3.12/site-packages/SemiBin/main.py", line 1610, in main2
    multi_easy_binning(
  File "/home/evolution/miniforge3/envs/SemiBin/lib/python3.12/site-packages/SemiBin/main.py", line 1313, in multi_easy_binning
    sample_list = generate_sequence_features_multi(logger, args)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/evolution/miniforge3/envs/SemiBin/lib/python3.12/site-packages/SemiBin/main.py", line 964, in generate_sequence_features_multi
    s = r.get()
        ^^^^^^^
  File "/home/evolution/miniforge3/envs/SemiBin/lib/python3.12/multiprocessing/pool.py", line 774, in get
    raise self._value
KeyError: 's0.ctg000001l'

And library information are here;

# packages in environment at /home/evolution/miniforge3/envs/SemiBin:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
arpack                    3.9.1           nompi_h77f6705_101    conda-forge
bedtools                  2.31.1               hf5e1c6e_2    bioconda
bowtie2                   2.5.4                h7071971_4    bioconda
brotli-python             1.1.0           py312h2ec8cdc_2    conda-forge
bzip2                     1.0.8                h4bc722e_7    conda-forge
c-ares                    1.34.2               heb4867d_0    conda-forge
ca-certificates           2024.8.30            hbcca054_0    conda-forge
certifi                   2024.8.30          pyhd8ed1ab_0    conda-forge
cffi                      1.17.1          py312h06ac9bb_0    conda-forge
charset-normalizer        3.4.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
coloredlogs               15.0.1             pyhd8ed1ab_3    conda-forge
filelock                  3.16.1             pyhd8ed1ab_0    conda-forge
fsspec                    2024.10.0          pyhff2d567_0    conda-forge
gawk                      5.3.1                hcd3d067_0    conda-forge
gettext                   0.22.5               he02047a_3    conda-forge
gettext-tools             0.22.5               he02047a_3    conda-forge
glpk                      5.0                  h445213a_0    conda-forge
gmp                       6.3.0                hac33072_2    conda-forge
gmpy2                     2.1.5           py312h7201bc8_2    conda-forge
h2                        4.1.0              pyhd8ed1ab_0    conda-forge
hmmer                     3.4                  hdbdd923_2    bioconda
hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
htslib                    1.21                 h5efdd21_0    bioconda
humanfriendly             10.0               pyhd8ed1ab_6    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
icu                       73.2                 h59595ed_0    conda-forge
idna                      3.10               pyhd8ed1ab_0    conda-forge
jinja2                    3.1.4              pyhd8ed1ab_0    conda-forge
joblib                    1.4.2              pyhd8ed1ab_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
krb5                      1.21.3               h659f571_0    conda-forge
ld_impl_linux-64          2.43                 h712a8e2_2    conda-forge
libabseil                 20240116.2      cxx17_he02047a_1    conda-forge
libasprintf               0.22.5               he8f35ee_3    conda-forge
libasprintf-devel         0.22.5               he8f35ee_3    conda-forge
libblas                   3.9.0           25_linux64_openblas    conda-forge
libcblas                  3.9.0           25_linux64_openblas    conda-forge
libcurl                   8.8.0                hca28451_1    conda-forge
libdeflate                1.21                 h4bc722e_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libexpat                  2.6.3                h5888daf_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc                    14.2.0               h77fa898_1    conda-forge
libgcc-ng                 14.2.0               h69a702a_1    conda-forge
libgettextpo              0.22.5               he02047a_3    conda-forge
libgettextpo-devel        0.22.5               he02047a_3    conda-forge
libgfortran               14.2.0               h69a702a_1    conda-forge
libgfortran-ng            14.2.0               h69a702a_1    conda-forge
libgfortran5              14.2.0               hd5240d6_1    conda-forge
libgomp                   14.2.0               h77fa898_1    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
libidn2                   2.3.7                hd590300_0    conda-forge
liblapack                 3.9.0           25_linux64_openblas    conda-forge
libnghttp2                1.58.0               h47da74e_1    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libopenblas               0.3.28          pthreads_h94d23a6_1    conda-forge
libprotobuf               4.25.3               h08a7969_0    conda-forge
libsqlite                 3.46.0               hde9e2c9_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx                 14.2.0               hc0a3c3a_1    conda-forge
libstdcxx-ng              14.2.0               h4852527_1    conda-forge
libtorch                  2.4.1           cpu_generic_hb3b73e9_0    conda-forge
libunistring              0.9.10               h7f98852_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libuv                     1.49.2               hb9d3cd8_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libxml2                   2.12.7               hc051c1a_1    conda-forge
libzlib                   1.2.13               h4ab18f5_6    conda-forge
markupsafe                3.0.2           py312h178313f_0    conda-forge
mmseqs2                   13.45111        pl5321hf1761c0_2    bioconda
mpc                       1.3.1                h24ddda3_1    conda-forge
mpfr                      4.2.1                h90cbb55_3    conda-forge
mpmath                    1.3.0              pyhd8ed1ab_0    conda-forge
ncurses                   6.5                  he02047a_1    conda-forge
networkx                  3.4.2              pyhd8ed1ab_1    conda-forge
nomkl                     1.0                  h5ca1d4c_0    conda-forge
numexpr                   2.10.1          py312h6a710ac_103    conda-forge
numpy                     2.1.3           py312h58c1407_0    conda-forge
openssl                   3.3.2                hb9d3cd8_0    conda-forge
pandas                    2.2.3           py312hf9745cd_1    conda-forge
perl                      5.32.1          7_hd590300_perl5    conda-forge
pip                       24.3.1             pyh8b19718_0    conda-forge
prodigal                  2.6.3                h031d066_9    bioconda
pycparser                 2.22               pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.12.3          hab00c5b_0_cpython    conda-forge
python-dateutil           2.9.0              pyhd8ed1ab_0    conda-forge
python-igraph             0.11.5          py312h4f72774_1    conda-forge
python-tzdata             2024.2             pyhd8ed1ab_0    conda-forge
python_abi                3.12                    5_cp312    conda-forge
pytorch                   2.4.1           cpu_generic_py312h411db4e_0    conda-forge
pytz                      2024.1             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0.2           py312h66e93f0_1    conda-forge
readline                  8.2                  h8228510_1    conda-forge
requests                  2.32.3             pyhd8ed1ab_0    conda-forge
samtools                  1.21                 h50ea8bc_0    bioconda
scikit-learn              1.5.2           py312h7a48858_1    conda-forge
scipy                     1.14.1          py312h62794b6_1    conda-forge
semibin                   2.1.0              pyhdfd78af_0    bioconda
setuptools                75.3.0             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sleef                     3.7                  h1b44611_0    conda-forge
sympy                     1.13.3          pypyh2585a3b_103    conda-forge
texttable                 1.7.0              pyhd8ed1ab_0    conda-forge
threadpoolctl             3.5.0              pyhc1e730c_0    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tqdm                      4.66.6             pyhd8ed1ab_0    conda-forge
typing_extensions         4.12.2             pyha770c72_0    conda-forge
tzdata                    2024b                hc8b5060_0    conda-forge
urllib3                   2.2.3              pyhd8ed1ab_0    conda-forge
wget                      1.21.4               hda4d442_0    conda-forge
wheel                     0.44.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
zlib                      1.2.13               h4ab18f5_6    conda-forge
zstandard                 0.23.0          py312hef9b889_1    conda-forge
zstd                      1.5.6                ha6fb4c9_0    conda-forge

Do you have any idea to solve this?

Thanks

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

1 participant