WIP: adjacency-aware tile filtering #106
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(e.g., for Open-ST data)
This implements a new, more 'sophisticated' strategy for filtering tiles.
On top of thresholding the % of barcode matches per tile, this adds the spatial (physical) adjacency structure of the tiles/pucks, detects connected subgraphs with weighted partitioning, keeps the subgraph with the highest % matching, and lastly applies a "dilation" strategy to also include tiles surrounding the ones that passed filters so far.
It includes helper scripts to generate the "adjacency" graph for the NovaSeq 6000 S4; it generates a networkx edgelist file, which provides more flexibility for adapting to other FCs/types of spatial puck. The script for computing spatial matches implements all functions for graph partitioning and tile "dilation".
Also, I updated the coordinate system csv file to add two new columns (lane and side). This does not have any conflict with the previous file structure. We can consider adding more columns to reduce the dependency on the tile/puck IDs for parsing the tile column/row.
To-Do: