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

Simulating higher read depth leads to a KeyError: 'x' #271

Open
zoey-rw opened this issue Sep 16, 2024 · 0 comments
Open

Simulating higher read depth leads to a KeyError: 'x' #271

zoey-rw opened this issue Sep 16, 2024 · 0 comments

Comments

@zoey-rw
Copy link

zoey-rw commented Sep 16, 2024

Hi, I'm encountering an error when I change my simulated read depth from 5M to 10M. I'm using an abundance file for 200 draft genomes. This is on a computing cluster with at least 448 GB of RAM available. Environment details are below - any ideas on what's going wrong?

# Works fine for lower read depths
readdepth=10M
# Draft genomes are passed as a list of file paths
file_list=$(cat ./mc_input_fungprop_10_unzipped.txt)


(insilicoseq)[zrwerbin@scc-up2 01_mock_community_input]$ iss generate --draft $file_list --model hiseq --output $out_simulated_reads_path --cpus
 4 --abundance uniform --n_reads $readdepth

INFO:iss.app:Starting iss generate
INFO:iss.generator:Using kde ErrorModel
INFO:iss.util:Stitching input files together
INFO:iss.generator:Using uniform abundance distribution
INFO:iss.app:Using 4 cpus for read generation
INFO:iss.app:Generating 10000000 reads

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/lib/python3.10/multiprocessing/pool.py", line 51, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/lib/python3.10/site-packages/iss/generator.py", line 240, in worker_iterator
    simulate_reads(
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/lib/python3.10/site-packages/iss/generator.py", line 61, in simulate_reads
    for forward_record, reverse_record, mutations in reads_generator(
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/lib/python3.10/site-packages/iss/generator.py", line 75, in reads_generator
    forward, reverse, mutations = simulate_read(record, error_model, i, cpu_number, sequence_type)
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/lib/python3.10/site-packages/iss/generator.py", line 180, in simulate_read
    Seq(rev_comp(str(sequence[reverse_start:reverse_end]))),
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/lib/python3.10/site-packages/iss/util.py", line 90, in rev_comp
    complement = "".join([bases[b] for b in sequence])
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/lib/python3.10/site-packages/iss/util.py", line 90, in <listcomp>
    complement = "".join([bases[b] for b in sequence])
KeyError: 'x'
"""

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

Traceback (most recent call last):
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/bin/iss", line 8, in <module>
    sys.exit(main())
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/lib/python3.10/site-packages/iss/app.py", line 454, in main
    args.func(args)
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/lib/python3.10/site-packages/iss/app.py", line 100, in generate_reads
    pool.starmap(
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/lib/python3.10/multiprocessing/pool.py", line 375, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
  File "/projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq/lib/python3.10/multiprocessing/pool.py", line 774, in get
    raise self._value
KeyError: 'x'
(insilicoseq)[zrwerbin@scc-up2 01_mock_community_input]$ 
(insilicoseq)[zrwerbin@scc-up2 01_mock_community_input]$ conda list
# packages in environment at /projectnb/talbot-lab-data/zrwerbin/.conda/envs/insilicoseq:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
biopython                 1.83            py310h2372a71_0    conda-forge
brotli-python             1.1.0           py310hc6cd4ac_1    conda-forge
bzip2                     1.0.8                hd590300_5    conda-forge
c-ares                    1.26.0               hd590300_0    conda-forge
ca-certificates           2024.2.2             hbcca054_0    conda-forge
certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
future                    1.0.0              pyhd8ed1ab_0    conda-forge
idna                      3.6                pyhd8ed1ab_0    conda-forge
insilicoseq               2.0.1                    pypi_0    pypi
joblib                    1.3.2              pyhd8ed1ab_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
krb5                      1.21.2               h659d440_0    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
libblas                   3.9.0           21_linux64_openblas    conda-forge
libcblas                  3.9.0           21_linux64_openblas    conda-forge
libcurl                   8.5.0                hca28451_0    conda-forge
libdeflate                1.18                 h0b41bf4_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 13.2.0               h807b86a_5    conda-forge
libgfortran-ng            13.2.0               h69a702a_5    conda-forge
libgfortran5              13.2.0               ha4646dd_5    conda-forge
libgomp                   13.2.0               h807b86a_5    conda-forge
liblapack                 3.9.0           21_linux64_openblas    conda-forge
libnghttp2                1.58.0               h47da74e_1    conda-forge

openssl                   3.2.1                hd590300_0    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libopenblas               0.3.26          pthreads_h413a1c8_0    conda-forge
libsqlite                 3.45.1               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-ng              13.2.0               h7e041cc_5    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
ncurses                   6.4                  h59595ed_2    conda-forge
numpy                     1.26.4          py310hb13e2d6_0    conda-forge
openssl                   3.2.1                hd590300_0    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
pysam                     0.22.0          py310h41dec4a_0    bioconda
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.10.13         hd12c33a_1_cpython    conda-forge
python_abi                3.10                    4_cp310    conda-forge
readline                  8.2                  h8228510_1    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
scipy                     1.12.0          py310hb13e2d6_2    conda-forge
setuptools                69.1.0             pyhd8ed1ab_1    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tzdata                    2024a                h0c530f3_0    conda-forge
urllib3                   2.2.1              pyhd8ed1ab_0    conda-forge
wheel                     0.42.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
zlib                      1.2.13               hd590300_5    conda-forge
zstd                      1.5.5                hfc55251_0    conda-forge
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