You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception has occurred: FrozenInstanceError
cannot assign to field 'sample_id'
File "/data/TS_data_analysis/jgribble/abrf_methylation/pod5_rename/pod5_rename_test.py", line 12, in
read.run_info.sample_id = str('NA24385_MGI_Lib1_New_flowcell')
^^^^^^^^^^^^^^^^^^^^^^^
dataclasses.FrozenInstanceError: cannot assign to field 'sample_id'
To my understanding, this appears that the following code block does not create a mutable RunInfo attribute? Is this intended or should users be able to edit RunInfo fields using this package?
import pod5
# New output file for edited data
with pod5.Writer("output.pod5") as writer:
# Read all records
with pod5.Reader("input.pod5") as reader:
# Iterate over immutable ReadRecords
for record in reader:
# Convert to mutable Read
read = record.to_read()
# Edit the value
read.run_info.sample_id = str('NA24385_MGI_Lib1_New_flowcell')
Specifications
Pod5 Version: 0.3.6
Python Version: 3.11
Platform: conda env on Linux (Ubuntu 20.04)
The text was updated successfully, but these errors were encountered:
Issue Description
https://github.com/nanoporetech/pod5-file-format/issues/100
Exception has occurred: FrozenInstanceError
cannot assign to field 'sample_id'
File "/data/TS_data_analysis/jgribble/abrf_methylation/pod5_rename/pod5_rename_test.py", line 12, in
read.run_info.sample_id = str('NA24385_MGI_Lib1_New_flowcell')
^^^^^^^^^^^^^^^^^^^^^^^
dataclasses.FrozenInstanceError: cannot assign to field 'sample_id'
Specifications
The text was updated successfully, but these errors were encountered: