Skip to content

Add HDF5-backed CytoTalk cached runner script#2

Open
pooriass wants to merge 1 commit intomainfrom
codex/add-hdf5-backed-mi-support-for-cytotalk-0kmb6k
Open

Add HDF5-backed CytoTalk cached runner script#2
pooriass wants to merge 1 commit intomainfrom
codex/add-hdf5-backed-mi-support-for-cytotalk-0kmb6k

Conversation

@pooriass
Copy link
Owner

Summary

  • add an R script that builds a file-backed mutual information cache for CytoTalk runs
  • implement a streamed ARACNE DPI pruning routine to avoid loading full MI matrices into RAM
  • provide a cached runner helper and example invocation for a cell-type pair

Testing

  • not run (not applicable)

https://chatgpt.com/codex/tasks/task_b_68f2390e87dc8320a8e5e3af4d5d8d3b

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +193 to +199
if (length(idx_nz) >= 2L) {
for (a in seq_along(idx_nz)) {
j <- idx_nz[a]
if (!kept[a]) next
mij <- mi_i[j]
for (b in (a + 1L):length(idx_nz)) {
k <- idx_nz[b]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Prevent neighbor-loop from indexing beyond bounds

The streamed ARACNE routine loops neighbor pairs with for (a in seq_along(idx_nz)) and for (b in (a + 1L):length(idx_nz)). When a reaches the last neighbor, (a + 1L):length(idx_nz) evaluates to a decreasing sequence containing values larger than length(idx_nz) (e.g. 3:2), so idx_nz[b] becomes NA and the subsequent h5read(..., index = list(j, k)) call uses an NA index and aborts. This will throw an error for any node that keeps two or more neighbors unless the last neighbor was already pruned, making the streamed mode unusable. Guard the inner loop to run only when a < length(idx_nz) (e.g. iterate seq_len(length(idx_nz) - 1L) or skip when there is no next neighbor).

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant