fmi-basel / gliberal-scMultipleX

Feature extraction and linking of multiplexing data.
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

Refactor of nuclear linking over multiplexing rounds #77

Closed nrepina closed 1 year ago

nrepina commented 1 year ago

Refactor, clean up code, and improve documentation of wrapper functions to run PlatyMatch single-cell linking.

Write Prefect/FAIM-HCS-independent run functions and image transformation in NucleiLinkingFunctions.py for ease of use for Fractal. Also added new linking QC metrics and corrected original PlatyMatch code to set seed during FFD transformation matrix calculation and ensure reproducible FFD results.

nrepina commented 1 year ago

@jluethi Please check out the PlatyMatch refactor. The relevant functions for Fractal are in NucleiLinkingFunctions.py, where affine and ffd-based registration is performed on input point clouds and images (numpy arrays). As we discussed the output is also a numpy array of matches, along with some confidence and matching accuracy metrics. The transformation matrices and transformed images are also returned, and we can tackle later how to apply and store them in Fractal.

You can see how the linking functions are implemented in scMultiplex in the NucleiLinking.py code, in particular link_affine and link_ffd functions, however these functions already have some lines that are specific to FAIM-HCS.

Looking forward to your feedback, and let us know if you have any questions!