mecfs_bio.build_system.task.specificity_frac_task
Classes:
-
PrepareSpecificityFraction–Task to compute the specificity of genes for cell types using the fractional specificity metric.
Functions:
Attributes:
PrepareSpecificityFraction
Bases: Task
Task to compute the specificity of genes for cell types using the fractional specificity metric.
In this metric, the specificity of a gene for a cell type is (mean expression in cell type)/(sum over all cell types of mean expression in those cell types)
Methods:
Attributes:
-
cell_col(str) – -
cell_type_col(str) – -
count_col(str) – -
deps(list[Task]) – -
gene_col(str) – -
long_count_df_task(Task) – -
meta(Meta) – -
min_cells_per_type(int) – -
out_format(OutFormat) – -
post_pipe(DataProcessingPipe) – -
pre_pipe(DataProcessingPipe) –
create
classmethod
create(
asset_id: str,
long_count_df_task: Task,
cell_type_col: str,
count_col: str,
gene_col: str,
cell_col: str,
min_cells_per_type: int,
out_format: OutFormat = ParquetOutFormat(),
pre_pipe: DataProcessingPipe = IdentityPipe(),
post_pipe: DataProcessingPipe = IdentityPipe(),
)
Source code in mecfs_bio/build_system/task/specificity_frac_task.py
execute
Source code in mecfs_bio/build_system/task/specificity_frac_task.py
filter_by_cell_count
filter_by_cell_count(
df: LazyFrame,
cell_type_col: str,
cell_col: str,
min_cells: int,
) -> narwhals.LazyFrame