scmcp-shared 0.4.0__py3-none-any.whl → 0.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scmcp_shared/__init__.py +1 -3
- scmcp_shared/agent.py +38 -21
- scmcp_shared/backend.py +44 -0
- scmcp_shared/cli.py +75 -46
- scmcp_shared/kb.py +139 -0
- scmcp_shared/logging_config.py +6 -8
- scmcp_shared/mcp_base.py +184 -0
- scmcp_shared/schema/io.py +101 -59
- scmcp_shared/schema/pl.py +386 -490
- scmcp_shared/schema/pp.py +514 -265
- scmcp_shared/schema/preset/__init__.py +15 -0
- scmcp_shared/schema/preset/io.py +103 -0
- scmcp_shared/schema/preset/pl.py +843 -0
- scmcp_shared/schema/preset/pp.py +616 -0
- scmcp_shared/schema/preset/tl.py +917 -0
- scmcp_shared/schema/preset/util.py +123 -0
- scmcp_shared/schema/tl.py +355 -407
- scmcp_shared/schema/util.py +57 -72
- scmcp_shared/server/__init__.py +5 -10
- scmcp_shared/server/auto.py +15 -11
- scmcp_shared/server/code.py +3 -0
- scmcp_shared/server/preset/__init__.py +14 -0
- scmcp_shared/server/{io.py → preset/io.py} +26 -22
- scmcp_shared/server/{pl.py → preset/pl.py} +162 -78
- scmcp_shared/server/{pp.py → preset/pp.py} +123 -65
- scmcp_shared/server/{tl.py → preset/tl.py} +142 -79
- scmcp_shared/server/{util.py → preset/util.py} +123 -66
- scmcp_shared/server/rag.py +13 -0
- scmcp_shared/util.py +109 -38
- {scmcp_shared-0.4.0.dist-info → scmcp_shared-0.6.0.dist-info}/METADATA +6 -2
- scmcp_shared-0.6.0.dist-info/RECORD +35 -0
- scmcp_shared/server/base.py +0 -148
- scmcp_shared-0.4.0.dist-info/RECORD +0 -24
- {scmcp_shared-0.4.0.dist-info → scmcp_shared-0.6.0.dist-info}/WHEEL +0 -0
- {scmcp_shared-0.4.0.dist-info → scmcp_shared-0.6.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,123 @@
|
|
1
|
+
from pydantic import Field, BaseModel
|
2
|
+
from typing import Optional, List, Dict, Any, Literal
|
3
|
+
|
4
|
+
|
5
|
+
class MarkVarParam(BaseModel):
|
6
|
+
"""Determine or mark if each gene meets specific conditions and store results in adata.var as boolean values"""
|
7
|
+
|
8
|
+
var_name: str = Field(
|
9
|
+
default=None,
|
10
|
+
description="Column name that will be added to adata.var, do not set if user does not ask",
|
11
|
+
)
|
12
|
+
pattern_type: Optional[Literal["startswith", "endswith", "contains"]] = Field(
|
13
|
+
default=None,
|
14
|
+
description="Pattern matching type (startswith/endswith/contains), it should be None when gene_class is not None",
|
15
|
+
)
|
16
|
+
patterns: Optional[str] = Field(
|
17
|
+
default=None,
|
18
|
+
description="gene pattern to match, must be a string, it should be None when gene_class is not None",
|
19
|
+
)
|
20
|
+
|
21
|
+
gene_class: Optional[Literal["mitochondrion", "ribosomal", "hemoglobin"]] = Field(
|
22
|
+
default=None, description="Gene class type (Mitochondrion/Ribosomal/Hemoglobin)"
|
23
|
+
)
|
24
|
+
|
25
|
+
|
26
|
+
class ListVarParam(BaseModel):
|
27
|
+
"""ListVarModel"""
|
28
|
+
|
29
|
+
pass
|
30
|
+
|
31
|
+
|
32
|
+
class ListObsParam(BaseModel):
|
33
|
+
"""ListObsModel"""
|
34
|
+
|
35
|
+
pass
|
36
|
+
|
37
|
+
|
38
|
+
class VarNamesParam(BaseModel):
|
39
|
+
"""ListObsModel"""
|
40
|
+
|
41
|
+
var_names: List[str] = Field(default=None, description="gene names.")
|
42
|
+
|
43
|
+
|
44
|
+
class ConcatBaseParam(BaseModel):
|
45
|
+
"""Model for concatenating AnnData objects"""
|
46
|
+
|
47
|
+
axis: Literal["obs", 0, "var", 1] = Field(
|
48
|
+
default="obs",
|
49
|
+
description="Which axis to concatenate along. 'obs' or 0 for observations, 'var' or 1 for variables.",
|
50
|
+
)
|
51
|
+
join: Literal["inner", "outer"] = Field(
|
52
|
+
default="inner",
|
53
|
+
description="How to align values when concatenating. If 'outer', the union of the other axis is taken. If 'inner', the intersection.",
|
54
|
+
)
|
55
|
+
merge: Optional[Literal["same", "unique", "first", "only"]] = Field(
|
56
|
+
default=None,
|
57
|
+
description="How elements not aligned to the axis being concatenated along are selected.",
|
58
|
+
)
|
59
|
+
uns_merge: Optional[Literal["same", "unique", "first", "only"]] = Field(
|
60
|
+
default=None,
|
61
|
+
description="How the elements of .uns are selected. Uses the same set of strategies as the merge argument, except applied recursively.",
|
62
|
+
)
|
63
|
+
label: Optional[str] = Field(
|
64
|
+
default=None,
|
65
|
+
description="label different adata, Column in axis annotation (i.e. .obs or .var) to place batch information in. ",
|
66
|
+
)
|
67
|
+
keys: Optional[List[str]] = Field(
|
68
|
+
default=None,
|
69
|
+
description="Names for each object being added. These values are used for column values for label or appended to the index if index_unique is not None.",
|
70
|
+
)
|
71
|
+
index_unique: Optional[str] = Field(
|
72
|
+
default=None,
|
73
|
+
description="Whether to make the index unique by using the keys. If provided, this is the delimiter between '{orig_idx}{index_unique}{key}'.",
|
74
|
+
)
|
75
|
+
fill_value: Optional[Any] = Field(
|
76
|
+
default=None,
|
77
|
+
description="When join='outer', this is the value that will be used to fill the introduced indices.",
|
78
|
+
)
|
79
|
+
pairwise: bool = Field(
|
80
|
+
default=False,
|
81
|
+
description="Whether pairwise elements along the concatenated dimension should be included.",
|
82
|
+
)
|
83
|
+
|
84
|
+
|
85
|
+
class DPTIROOTParam(BaseModel):
|
86
|
+
"""Input schema for setting the root cell for diffusion pseudotime."""
|
87
|
+
|
88
|
+
diffmap_key: str = Field(
|
89
|
+
default="X_diffmap",
|
90
|
+
description="Key for diffusion map coordinates stored in adata.obsm.",
|
91
|
+
)
|
92
|
+
dimension: int = Field(
|
93
|
+
description="Dimension index to use for finding the root cell."
|
94
|
+
)
|
95
|
+
direction: Literal["min", "max"] = Field(
|
96
|
+
description="use the minimum or maximum value along the selected dimension to identify the root cell."
|
97
|
+
)
|
98
|
+
|
99
|
+
|
100
|
+
class CelltypeMapCellTypeParam(BaseModel):
|
101
|
+
"""Input schema for mapping cluster IDs to cell type names."""
|
102
|
+
|
103
|
+
cluster_key: str = Field(description="Key in adata.obs containing cluster IDs.")
|
104
|
+
added_key: str = Field(description="Key to add to adata.obs for cell type names.")
|
105
|
+
mapping: Dict[str, str] = Field(
|
106
|
+
default=None,
|
107
|
+
description="Mapping Dictionary from cluster IDs to cell type names.",
|
108
|
+
)
|
109
|
+
new_names: Optional[List[str]] = Field(
|
110
|
+
default=None, description="a list of new cell type names."
|
111
|
+
)
|
112
|
+
|
113
|
+
|
114
|
+
class AddLayerParam(BaseModel):
|
115
|
+
"""Input schema for adding a layer to AnnData object."""
|
116
|
+
|
117
|
+
layer_name: str = Field(description="Name of the layer to add to adata.layers.")
|
118
|
+
|
119
|
+
|
120
|
+
class QueryOpLogParam(BaseModel):
|
121
|
+
"""QueryOpLogModel"""
|
122
|
+
|
123
|
+
n: int = Field(default=10, description="Number of operations to return.")
|