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

A bug and a runtime error. #43

Open
Yichen-HNU opened this issue Nov 8, 2024 · 0 comments
Open

A bug and a runtime error. #43

Yichen-HNU opened this issue Nov 8, 2024 · 0 comments

Comments

@Yichen-HNU
Copy link

Thank you for providing the tool!

However, I encountered the following issues during execution:

In command_line.py, there is an undefined output_file, and I suspect that the author intended to provide an output path but did not add it to args.

profile_path = os.path.join(os.path.dirname(args.output_file), args.profile_name)
Therefore, I added the following:

ADD

parser.add_argument('-o', '--output-file', dest='output_file', metavar='OUTPUT',
help='Output Hi-C reads file (either interleaved or R1/R2)', required=True)
I hope this modification will not cause errors later.

However, when I run the command:

sim3C --dist uniform -n 100000 -l 150 -m hic -e NlaIII ref.split_50000_0.1_hap1.fa hic_reads_hap1_R1.fastq hic_reads_hap2_R2.fastq -o test
I get the following error:

ERROR | 2024-11-08 07:29:13,390 | main | OrderedDict mutated during iteration
Traceback (most recent call last):
File "/home/lyc/.local/lib/python3.11/site-packages/sim3C/command_line.py", line 256, in main
strategy = SequencingStrategy(args.profile_in, args.genome_seq, args.enzyme,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lyc/.local/lib/python3.11/site-packages/sim3C/simulator.py", line 345, in init
self.community = Community.from_profile(seq_index, profile_filename, self.enzymes,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lyc/.local/lib/python3.11/site-packages/sim3C/community.py", line 796, in from_profile
community._init_community()
File "/home/lyc/.local/lib/python3.11/site-packages/sim3C/community.py", line 804, in _init_community
for cell in self.cell_registry.values():
RuntimeError: OrderedDict mutated during iteration
What is the cause of this error?

The error is related to modifying an OrderedDict while it is being iterated over. During the iteration, an attempt is made to change the dictionary, which leads to the RuntimeError. This can happen if there are operations like adding, removing, or modifying dictionary entries while iterating over it.

To resolve this, you should avoid modifying the OrderedDict during the iteration process, or iterate over a copy of the dictionary.

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