High-Level API
Use these functions when you want to run a complete workflow and receive the differential regulation table directly.
compare_networks
compare_networks(
x_data: ExpressionData,
y_data: ExpressionData,
x_label: str = "X",
y_label: str = "Y",
layer: LayerName = None,
backend: Backend = "serial",
n_jobs: int = 1,
random_state: int = 42,
qc_kws: Optional[Kwargs] = None,
network_kws: Optional[Kwargs] = None,
td_kws: Optional[Kwargs] = None,
ma_kws: Optional[Kwargs] = None,
dr_kws: Optional[Kwargs] = None,
) -> pd.DataFrame
Run the full two-sample scTenifoldNet workflow.
Builds PC networks for x_data and y_data, performs tensor
decomposition and manifold alignment, then returns the differential
regulation table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_data
|
ExpressionData
|
Genes-by-cells expression matrices. Each may be a |
required |
y_data
|
ExpressionData
|
Genes-by-cells expression matrices. Each may be a |
required |
x_label
|
str
|
Labels used internally and in the output to distinguish the two conditions. |
'X'
|
y_label
|
str
|
Labels used internally and in the output to distinguish the two conditions. |
'X'
|
layer
|
LayerName
|
Optional AnnData layer name. If |
None
|
backend
|
Backend
|
Parallel backend for PC network construction. One of
|
'serial'
|
n_jobs
|
int
|
Worker count for the chosen backend. |
1
|
random_state
|
int
|
Seed propagated to the randomized SVD inside network construction. |
42
|
qc_kws
|
Optional[Kwargs]
|
Per-step keyword overrides forwarded to QC, network construction,
tensor decomposition, manifold alignment and differential
regulation, respectively. |
None
|
network_kws
|
Optional[Kwargs]
|
Per-step keyword overrides forwarded to QC, network construction,
tensor decomposition, manifold alignment and differential
regulation, respectively. |
None
|
td_kws
|
Optional[Kwargs]
|
Per-step keyword overrides forwarded to QC, network construction,
tensor decomposition, manifold alignment and differential
regulation, respectively. |
None
|
ma_kws
|
Optional[Kwargs]
|
Per-step keyword overrides forwarded to QC, network construction,
tensor decomposition, manifold alignment and differential
regulation, respectively. |
None
|
dr_kws
|
Optional[Kwargs]
|
Per-step keyword overrides forwarded to QC, network construction,
tensor decomposition, manifold alignment and differential
regulation, respectively. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Differential regulation table with one row per shared gene. |
Source code in scTenifold/core/_api.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
virtual_knockout
virtual_knockout(
data: ExpressionData,
ko_genes: Optional[Union[str, Iterable[str]]] = None,
layer: LayerName = None,
backend: Backend = "serial",
n_jobs: int = 1,
random_state: int = 42,
strict_lambda: float = 0,
ko_method: KOMethod = "default",
qc_kws: Optional[Kwargs] = None,
network_kws: Optional[Kwargs] = None,
td_kws: Optional[Kwargs] = None,
ma_kws: Optional[Kwargs] = None,
dr_kws: Optional[Kwargs] = None,
ko_kws: Optional[Kwargs] = None,
) -> pd.DataFrame
Run the full scTenifoldKnk virtual-knockout workflow.
Constructs a wild-type PC network from data, simulates a knockout
of ko_genes, performs manifold alignment between WT and KO tensors
and returns the differential regulation table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
ExpressionData
|
Genes-by-cells expression matrix ( |
required |
ko_genes
|
Optional[Union[str, Iterable[str]]]
|
Gene name or iterable of gene names to knock out. |
None
|
layer
|
LayerName
|
Optional AnnData layer name. If |
None
|
backend
|
Backend
|
Parallel backend for PC network construction. One of
|
'serial'
|
n_jobs
|
int
|
Worker count for the chosen backend. |
1
|
random_state
|
int
|
Seed propagated to the randomized SVD inside network construction. |
42
|
strict_lambda
|
float
|
Strength of the directional pruning applied by
:func: |
0
|
ko_method
|
KOMethod
|
How the KO tensor is produced:
|
'default'
|
qc_kws
|
Optional[Kwargs]
|
Per-step keyword overrides forwarded to QC, network construction,
tensor decomposition, manifold alignment, differential regulation,
and the KO step. |
None
|
network_kws
|
Optional[Kwargs]
|
Per-step keyword overrides forwarded to QC, network construction,
tensor decomposition, manifold alignment, differential regulation,
and the KO step. |
None
|
td_kws
|
Optional[Kwargs]
|
Per-step keyword overrides forwarded to QC, network construction,
tensor decomposition, manifold alignment, differential regulation,
and the KO step. |
None
|
ma_kws
|
Optional[Kwargs]
|
Per-step keyword overrides forwarded to QC, network construction,
tensor decomposition, manifold alignment, differential regulation,
and the KO step. |
None
|
dr_kws
|
Optional[Kwargs]
|
Per-step keyword overrides forwarded to QC, network construction,
tensor decomposition, manifold alignment, differential regulation,
and the KO step. |
None
|
ko_kws
|
Optional[Kwargs]
|
Per-step keyword overrides forwarded to QC, network construction,
tensor decomposition, manifold alignment, differential regulation,
and the KO step. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Differential regulation table comparing the WT and KO tensors. |
Source code in scTenifold/core/_api.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |