neuralib.atlas.ccf.dataframe.RoiSubregionDataFrame
- class neuralib.atlas.ccf.dataframe.RoiSubregionDataFrame[source]
Bases:
DataFrameWrapperRoiSubregionDataFrame with each source per row, column shows the subregions
- __init__(region, df, profile)[source]
- Parameters:
region (str) – region name
df (DataFrame) – subregion dataframe
profile (DataFrame) – profile dataframe
- dataframe(dataframe=None, may_inplace=True)[source]
RoiSubregionDataFrame (VIS as example):
┌─────────┬───────────┬───────────┬───────────┬───┬──────────┬──────────┬──────────┬──────────┐ │ source ┆ VISam ┆ VISp ┆ VISpm ┆ … ┆ VISal ┆ VISpor ┆ VISli ┆ VISpl │ │ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │ │ str ┆ f64 ┆ f64 ┆ f64 ┆ ┆ f64 ┆ f64 ┆ f64 ┆ f64 │ ╞═════════╪═══════════╪═══════════╪═══════════╪═══╪══════════╪══════════╪══════════╪══════════╡ │ overlap ┆ 39.649682 ┆ 15.127389 ┆ 28.025478 ┆ … ┆ 3.025478 ┆ 2.707006 ┆ 1.592357 ┆ 0.159236 │ │ aRSC ┆ 32.160414 ┆ 28.952135 ┆ 23.05304 ┆ … ┆ 6.080207 ┆ 1.293661 ┆ 2.069858 ┆ 0.07762 │ │ pRSC ┆ 25.947955 ┆ 27.95539 ┆ 27.459727 ┆ … ┆ 3.122677 ┆ 2.973978 ┆ 1.982652 ┆ 1.016109 │ └─────────┴───────────┴───────────┴───────────┴───┴──────────┴──────────┴──────────┴──────────┘
- Parameters:
dataframe (DataFrame | None)
- property region: str
region name
- property subregion: list[str]
list of subregion names
- property n_subregion: int
number of subregion
- property profile: DataFrame
with channel-wise profile:
┌─────────┬────────┬───────┬────────────────┐ │ source ┆ counts ┆ total ┆ total_fraction │ │ --- ┆ --- ┆ --- ┆ --- │ │ str ┆ u32 ┆ u32 ┆ f64 │ ╞═════════╪════════╪═══════╪════════════════╡ │ overlap ┆ 628 ┆ 4027 ┆ 0.155947 │ │ aRSC ┆ 3865 ┆ 30609 ┆ 0.12627 │ │ pRSC ┆ 4035 ┆ 14442 ┆ 0.279393 │ └─────────┴────────┴───────┴────────────────┘
- property sources: list[str]
list of source names
- to_dict(as_series=True)[source]
to subregion:value dict
- Parameters:
as_series (bool)
- Return type:
dict[str, list[float]]
- clear(n=5)
See polars.DataFrame.clear.
- Parameters:
n (int)
- Return type:
Self
- clone()
Clone the wrapper.
- Return type:
Self
- property columns: list[str]
See polars.DataFrame.columns.
- drop(*columns, strict=True)
See polars.DataFrame.drop.
- Parameters:
columns (pty.ColumnNameOrSelector | Iterable[pty.ColumnNameOrSelector])
strict (bool)
- Return type:
Self
- drop_nulls(subset)
See polars.DataFrame.drop_nulls.
- Parameters:
subset (pty.ColumnNameOrSelector | Collection[pty.ColumnNameOrSelector])
- Return type:
Self
- fill_nan(value=None)
See polars.DataFrame.fill_nan.
- Parameters:
value (pl.Expr | int | float | None)
- Return type:
Self
- fill_null(value=None, strategy=None, limit=None, **kwargs)
See polars.DataFrame.fill_null.
- Parameters:
value (Any | pl.Expr | None)
strategy (pty.FillNullStrategy | None)
limit (int | None)
- Return type:
Self
- filter(*predicates, **constraints)
See polars.DataFrame.filter.
- Parameters:
predicates (pty.IntoExprColumn | Iterable[pty.IntoExprColumn] | bool | list[bool] | np.ndarray)
constraints (Any)
- Return type:
Self
- group_by(*by, maintain_order=False, **named_by)
See polars.DataFrame.group_by.
- Parameters:
by (pty.IntoExpr | Iterable[pty.IntoExpr])
maintain_order (bool)
named_by (pty.IntoExpr)
- Return type:
GroupBy
- head(n=5)
See polars.DataFrame.head.
- Parameters:
n (int)
- Return type:
Self
- join(other, on, *args, **kwargs)
See polars.DataFrame.join.
- Parameters:
other (pl.DataFrame | DataFrameWrapper)
- Return type:
Self
- lazy()
Wrap dataframe in a lazy wrapper.
- Return type:
LazyDataFrameWrapper[Self]
- limit(n=5)
See polars.DataFrame.limit.
- Parameters:
n (int)
- Return type:
Self
- partition_by(by, *more_by, as_dict=False, **kwargs)
See polars.DataFrame.partition_by.
- pipe(function, *args, **kwargs)
See polars.DataFrame.pipe.
- Parameters:
function (Callable[Concatenate[pl.DataFrame, P], pl.DataFrame])
args (P.args)
kwargs (P.kwargs)
- Return type:
Self
- rename(mapping)
See polars.DataFrame.rename.
- Parameters:
mapping (dict[str, str] | Callable[[str], str])
- Return type:
Self
- property schema: Schema
See polars.DataFrame.schema.
- select(*exprs, **named_exprs)
See polars.DataFrame.select.
- Parameters:
exprs (pty.IntoExpr | Iterable[pty.IntoExpr])
named_exprs (pty.IntoExpr)
- Return type:
Self
- slice(offset, length=None)
See polars.DataFrame.slice.
- Parameters:
offset (int)
length (int | None)
- Return type:
Self
- sort(by, *more_by, **kwargs)
See polars.DataFrame.sort.
- Return type:
Self
- tail(n=5)
See polars.DataFrame.tail.
- Parameters:
n (int)
- Return type:
Self
- with_columns(*exprs, **named_exprs)
See polars.DataFrame.with_columns.
- Parameters:
exprs (pty.IntoExpr | Iterable[pty.IntoExpr])
named_exprs (pty.IntoExpr)
- Return type:
Self
- with_row_index(name='index', offset=0)
See polars.DataFrame.with_row_index.
- Parameters:
name (str)
offset (int)
- Return type:
Self