Closed Dcwrenn closed 2 months ago
HI,
Thanks for raising this - we will have a look. We tend not to run on flongles for a variety of reasons.
Will post here when the issue is resolved.
Matt
OK - we've found the issue - it is a bug due to the unusual size of the flongle flowcell.
We will fix this and implement in the next release of readfish. If you want to manually make this work for your flongle, please edit this line in your local copy of the code: https://github.com/LooseLab/readfish/blob/8e5210e9d7e72d9b7e9d57e9a14b3e4f232fb7d1/src/readfish/_utils.py#L284
and change
axis: int = 1
to
axis: int = 0
The reason the validate command works is that it does not the flowcell shape - this is only done when you run with a live flowcell.
Hi Matt,
Thank you for your quick response. Apologies for my delay in getting back to you - we've just been able to try the manual fix you suggested. We are still getting errors after adjusting to axis: int = 0
. The new errors we are seeing are below:
Traceback (most recent call last):
File "<cattrs generated structure readfish._config.Conf>", line 33, in structure_Conf
return __cl(
File "<attrs generated init readfish._config.Conf>", line 14, in __init__
self.__attrs_post_init__()
File "/home/dcwrenn/miniconda3/envs/readfish/lib/python3.10/site-packages/readfish/_config.py", line 284, in __attrs_post_init__
split_channels = generate_flowcell(self.channels, len(self.regions) or 1)
File "/home/dcwrenn/miniconda3/envs/readfish/lib/python3.10/site-packages/readfish/_utils.py", line 384, in generate_flowcell
raise ValueError("The flowcell cannot be split evenly")
ValueError: The flowcell cannot be split evenly
During handling of the above exception, another exception occurred:
+ Exception Group Traceback (most recent call last):
| File "/home/dcwrenn/miniconda3/envs/readfish/bin/readfish", line 8, in <module>
| sys.exit(main())
| File "/home/dcwrenn/miniconda3/envs/readfish/lib/python3.10/site-packages/readfish/_cli_base.py", line 61, in main
| raise SystemExit(args.func(parser, args, extras))
| File "/home/dcwrenn/miniconda3/envs/readfish/lib/python3.10/site-packages/readfish/entry_points/targets.py", line 616, in run
| conf = Conf.from_file(args.toml, read_until_client.channel_count, logger=logger)
| File "/home/dcwrenn/miniconda3/envs/readfish/lib/python3.10/site-packages/readfish/_config.py", line 376, in from_file
| return cls.from_dict(dict_, channels)
| File "/home/dcwrenn/miniconda3/envs/readfish/lib/python3.10/site-packages/readfish/_config.py", line 394, in from_dict
| return conv.structure(dict_, cls)
| File "/home/dcwrenn/miniconda3/envs/readfish/lib/python3.10/site-packages/cattrs/converters.py", line 332, in structure
| return self._structure_func.dispatch(cl)(obj, cl)
| File "<cattrs generated structure readfish._config.Conf>", line 36, in structure_Conf
| except Exception as exc: raise __c_cve('While structuring ' + 'Conf', [exc], __cl)
| cattrs.errors.ClassValidationError: While structuring Conf (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/home/dcwrenn/miniconda3/envs/readfish/lib/python3.10/site-packages/readfish/_utils.py", line 378, in generate_flowcell
| arr = np.array(np.split(arr, split, axis=axis))
| File "/home/dcwrenn/miniconda3/envs/readfish/lib/python3.10/site-packages/numpy/lib/shape_base.py", line 864, in split
| raise ValueError(
| ValueError: array split does not result in an equal division
|
| During handling of the above exception, another exception occurred:
|
| Traceback (most recent call last):
| File "<cattrs generated structure readfish._config.Conf>", line 33, in structure_Conf
| return __cl(
| File "<attrs generated init readfish._config.Conf>", line 14, in __init__
| self.__attrs_post_init__()
| File "/home/dcwrenn/miniconda3/envs/readfish/lib/python3.10/site-packages/readfish/_config.py", line 284, in __attrs_post_init__
| split_channels = generate_flowcell(self.channels, len(self.regions) or 1)
| File "/home/dcwrenn/miniconda3/envs/readfish/lib/python3.10/site-packages/readfish/_utils.py", line 384, in generate_flowcell
| raise ValueError("The flowcell cannot be split evenly")
| ValueError: The flowcell cannot be split evenly
+------------------------------------
Hi @Dcwrenn, apologies that should read:
axis: int = 1
to
axis: int = 0
What we've changed above will let us draw an ASCII split flow cell to the CLI, so that is also required! Cheers. Rory
@Adoni5 Apologies again for the delayed response - we are back up and running! We ended up using a combination of the solution provided in this issue and the solution provided in issue 365.
For others that may encounter the same problem we first made a clean install of readfish using pip install git+https://github.com/LooseLab/readfish@issue365/flongle-draw-split
and then changed axis: int = 1
to axis: int = 0
in lines 287 and 349 of _utils.py
Thank you for all of your help!
Hello ReadFish folks, We've run into an issue while trying to run a ReadFish experiment on a flongle. When attempting to split the flow cell into two regions we get the following error:
When we've adjusted our TOML to only have one region we get the following error:
This is a new issue since updating to the newest MinKNOW (v.24.02.16) and ReadFish (v.2024.2.0) versions. We get no errors when using the same TOML with a MinION flow cell.
readfish validate
reports no issue with the TOML itself and outputs two clear regions. Our TOML with 2 regions is below. Thank you for your help! :fish: