Skip to content

Commit

Permalink
Merge pull request #226 from Tianyi-Summer/patch-2
Browse files Browse the repository at this point in the history
Update comment for plot_vec.py
  • Loading branch information
tanliwei-coder authored Dec 26, 2023
2 parents 822fba1 + 06554ab commit 8749079
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions stereo/plots/plot_vec/plot_vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@

class PlotVec(PlotBase):

# TODO:加入输入的边界条件
# TODO: 把画图的代码单独取出, 其余的结构性代码作为main,放在plot_vec中

def plot_vec(
self,
x_raw,
Expand All @@ -34,6 +31,31 @@ def plot_vec(
num_legend_per_col=12,
dpi_val=1000
):
"""
Plot vectors or streams of pseudo-time.
:param x_raw: Array of x coordinates, taken from the first column in adata spatial axis array
:param y_raw: Array of y coordinates, taken from the second column in adata spatial axis array
:param ty_raw: 1d NdArray, involving cell types of all cells, or bin sets, can take the format of either string, int, or float
:param ptime: Array of pseudo-time, suggested being calculated by StereoPy dpt process
:param type: 'vec' or 'vector' plots vector plots, 'stream' or 'streamplot' plots stream plots
:param count_thresh: threshold of counts when filtering spots to plot
:param tick_step: step between tick labels
:param line_len_co: length coeeficient of vectors
:param vec_alpha: transparency of vectors, 0-1
:param line_width: width of vectors
:param density: density of streams in stream plot
:param background: 'field' plots fields-like background, with pixel color representing cell types, while 'scatter', 'cell', 'bin', or 'spot' plots each spot as a scatter
:param background_alpha: transparency of background
:param num_pix: number of pixel on shorter axis (x or y) when plotting background as fields
:param filter_type: type of kernel when smoothing vectors, if type is 'vec' or 'vector'. Pass 'gauss' to use Gaussian kernel, pass 'mean' to use Mean kernel.
:param sigma_val: sigma of kernel if passing 'gauss' to filter_type
:param radius_val: half of width of kernel array, if passing 'mean' to filter_type
:param scatter_s: size of scatter, if passing 'scatter', 'cell', 'bin', or 'spot' to background
:param seed_val: seed value to assign colors for different cell types when plotting background
:param num_legend_per_col: number of lines per column in legend
:param dpi_val: dpi value of figure
"""
assert len(x_raw.shape) == 1 and x_raw.shape[0] == y_raw.shape[0] == ptime.shape[0], \
"input has wrong array shape"

Expand Down

0 comments on commit 8749079

Please sign in to comment.