scranpy.marker_detection package#
Submodules#
scranpy.marker_detection.score_markers module#
- class scranpy.marker_detection.score_markers.ScoreMarkersOptions(block=None, threshold=0, compute_auc=True, assay_type='logcounts', feature_names=None, num_threads=1)[source]#
Bases:
object
Optional arguments for
score_markers()
.- block#
Block assignment for each cell. Comparisons are only performed within each block to avoid interference from inter-block differences, e.g., batch effects.
If provided, this should have length equal to the number of cells, where cells have the same value if and only if they are in the same block. Defaults to None, indicating all cells are part of the same block.
- threshold#
Log-fold change threshold to use for computing Cohen’s d and the AUC. Large positive values favor markers with large log-fold changes over those with low variance. Defaults to 0.
- compute_auc#
Whether to compute the AUCs. This can be set to
False
for greater speed and memory efficiency. Defaults to True.
- assay_type#
Assay to use from
input
if it is aSummarizedExperiment
.
- feature_names#
Sequence of feature names of length equal to the number of rows in
input
. If provided, this is used as the row names of the output data frames.
- num_threads#
Number of threads to use. Defaults to 1.
- __annotations__ = {'assay_type': typing.Union[str, int], 'block': typing.Optional[typing.Sequence], 'compute_auc': <class 'bool'>, 'feature_names': typing.Optional[typing.Sequence[str]], 'num_threads': <class 'int'>, 'threshold': <class 'float'>}#
- __dataclass_fields__ = {'assay_type': Field(name='assay_type',type=typing.Union[str, int],default='logcounts',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),_field_type=_FIELD), 'block': Field(name='block',type=typing.Optional[typing.Sequence],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),_field_type=_FIELD), 'compute_auc': Field(name='compute_auc',type=<class 'bool'>,default=True,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),_field_type=_FIELD), 'feature_names': Field(name='feature_names',type=typing.Optional[typing.Sequence[str]],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),_field_type=_FIELD), 'num_threads': Field(name='num_threads',type=<class 'int'>,default=1,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),_field_type=_FIELD), 'threshold': Field(name='threshold',type=<class 'float'>,default=0,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),_field_type=_FIELD)}#
- __dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False)#
- __eq__(other)#
Return self==value.
- __hash__ = None#
- __repr__()#
Return repr(self).
- scranpy.marker_detection.score_markers.score_markers(input, grouping, options=ScoreMarkersOptions(block=None, threshold=0, compute_auc=True, assay_type='logcounts', feature_names=None, num_threads=1))[source]#
Score genes as potential markers for groups of cells. Markers are genes that are strongly up-regulated within each group, allowing users to associate each group with some known (or novel) cell type or state. The groups themselves are typically constructed from the data, e.g., with
build_snn_graph()
.- Parameters:
input (
Union
[TatamiNumericPointer
,SummarizedExperiment
]) –Matrix-like object where rows are features and columns are cells, typically containing expression values of some kind. This should be a matrix class that can be converted into a
TatamiNumericPointer
.Alternatively, a
SummarizedExperiment
containing such a matrix in its assays.Developers may also provide a
TatamiNumericPointer
directly.grouping (
Sequence
) – Group assignment for each cell. This should have length equal to the number of cells, where the entry for each cell specifies the assigned group for that cell.options (
ScoreMarkersOptions
) – Optional parameters.
- Raises:
ValueError – If
input
is not an expected type.- Return type:
- Returns:
Dictionary where the keys are the group identifiers (as defined in
grouping
) and the values areBiocFrame
objects containing computed metrics for each group.