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

Enhance nuclear linking exception handling #73

Open
enricotagliavini opened this issue May 31, 2023 · 0 comments
Open

Enhance nuclear linking exception handling #73

enricotagliavini opened this issue May 31, 2023 · 0 comments

Comments

@enricotagliavini
Copy link
Contributor

There are two exception cases in NucleiLinking.py that could use some TLC (tender love care). At

except Exception as e:
print(R0_obj, RX_obj, e)

and at

except Exception as e:
print(R0_obj, RX_obj, e)

When an exception happens within the try statement scope the error message could be as the following

Executing: python3 scripts/prefect/03_nuclear_multiplex.py --config ./scripts/configs/unified_start.conf --cpus 40 --prefect-logfile /tungstenfs/nobackup/gliberal/taglenri/nicole/scmultipl
ex/prefect-scmultiplex-20230531-15_40_35.log
Running scMultipleX version 0.3.dev36+g5b9d379.d20230411
matching of object_38 and object_35 in day1p5 C03
100% 8/8 [00:00<00:00, 1139.56it/s]
100% 8/8 [00:00<00:00, 903.39it/s]
object_38 object_35 Shape of passed values is (8, 2), indices imply (8, 3)
03_nuclear_multiplex.py completed successfully

This could be clearer and, in the case of the example above, it also makes step 07 completely fail

Executing: python3 scripts/prefect/07_aggregate_nuclear_multiplex.py --config ./scripts/configs/unified_start.conf --cpus 40 --prefect-logfile /tungstenfs/nobackup/gliberal/taglenri/nicole/scmultiplex/prefect-scmultiplex-20230531-15_40_35.log
Running scMultipleX version 0.3.dev36+g5b9d379.d20230411
ERROR! Run organoid linking and linking_nuc_df aggregation of round  R1
ERROR: Task 'merge_scmultiplexed_features_task': Exception encountered during task execution!
Traceback (most recent call last):
  File "/tungstenfs/nobackup/gliberal/taglenri/nicole/scmp_venv/lib64/python3.8/site-packages/prefect/engine/task_runner.py", line 880, in get_task_run_state
    value = prefect.utilities.executors.run_task_with_timeout(
  File "/tungstenfs/nobackup/gliberal/taglenri/nicole/scmp_venv/lib64/python3.8/site-packages/prefect/utilities/executors.py", line 468, in run_task_with_timeout
    return task.run(*args, **kwargs)  # type: ignore 
  File "scripts/prefect/07_aggregate_nuclear_multiplex.py", line 47, in merge_scmultiplexed_features_task
    write_nuclear_linking_over_multiplexing_rounds(round_names, round_summary_csvs)
  File "/tungstenfs/nobackup/gliberal/taglenri/nicole/gliberal-scMultipleX/src/scmultiplex/utils/accumulate_utils.py", line 873, in write_nuclear_linking_over_multiplexing_rounds
    link = links[round_names[i + 1]]  # load linking 
KeyError: 'R1'
Command 'python3 scripts/prefect/07_aggregate_nuclear_multiplex.py --config ./scripts/configs/unified_start.conf --cpus 40 --prefect-logfile /tungstenfs/nobackup/gliberal/taglenri/nicole/scmultiplex/prefect-scmultiplex-20230531-15_40_35.log' returned non-zero exit status 1.
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