troutpy.pl.coupled_scatter

troutpy.pl.coupled_scatter#

troutpy.pl.coupled_scatter(sdata, layer='extracellular_transcripts', output_path='', transcript_group='distance_to_source_cell', save=True, format='pdf', xcoord='x', ycoord='y', xcellcoord='x_centroid', ycellcoord='y_centroid', colormap='Blues', size=2, color_cells='red', figsize=(10, 7), vmax=None)#

Plot transcript locations and cell centroids, coloring transcripts by a chosen feature.

Parameters:
  • sdata (SpatialData) – A spatial data object that contains transcript and cell information.

  • layer (str (default: 'extracellular_transcripts')) – The key for the layer in sdata.points that contains transcript data.

  • output_path (str (default: '')) – The directory path where the plot will be saved. If not provided, the plot will not be saved.

  • transcript_group (str (default: 'distance_to_source_cell')) – The column in the transcript data (e.g., distance to the source cell) used for coloring the scatter plot.

  • save (bool (default: True)) – Whether to save the plot to a file. If True, the plot is saved to output_path.

  • format (str (default: 'pdf')) – The format for saving the plot (e.g., ‘pdf’, ‘png’). Only used if save=True.

  • xcoord (str (default: 'x')) – The column name in the transcript data representing the x-coordinate.

  • ycoord (str (default: 'y')) – The column name in the transcript data representing the y-coordinate.

  • xcellcoord (str (default: 'x_centroid')) – The column name in the cell data representing the x-coordinate of cell centroids.

  • ycellcoord (str (default: 'y_centroid')) – The column name in the cell data representing the y-coordinate of cell centroids.

  • colormap (str (default: 'Blues')) – The colormap to use for coloring the transcripts based on the transcript_group values.

  • size (float (default: 2)) – The size of the scatter points for cells and transcripts. Transcripts are scaled down by 0.1.

  • color_cells (str (default: 'red')) – The color to use for the cell centroids.

  • figsize (tuple[float, float] (default: (10, 7))) – The size of the figure in inches (width, height).

  • vmax (Optional[float] (default: None)) – The upper limit for the colormap.

Return type:

None

Returns:

None