-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintroduction.html
More file actions
581 lines (527 loc) · 29.9 KB
/
Copy pathintroduction.html
File metadata and controls
581 lines (527 loc) · 29.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
89
90
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>scTenifoldKnk: Single-Cell Virtual Gene Knockout Tutorial</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
/* Base styles that work for both GitHub Pages and WeChat Official Account */
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.7;
color: #333;
max-width: 900px;
margin: 0 auto;
padding: 20px;
background-color: #fafafa;
}
.container {
background: white;
padding: 40px;
border-radius: 12px;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
h1 {
font-size: 2.2em;
color: #1a1a1a;
text-align: center;
margin-bottom: 10px;
font-weight: 700;
}
.subtitle {
text-align: center;
color: #666;
font-size: 1.1em;
margin-bottom: 30px;
}
h2 {
font-size: 1.5em;
color: #2c3e50;
margin-top: 35px;
margin-bottom: 15px;
padding-bottom: 8px;
border-bottom: 2px solid #e8f0f8;
font-weight: 600;
}
h3 {
font-size: 1.2em;
color: #34495e;
margin-top: 25px;
margin-bottom: 10px;
font-weight: 600;
}
p {
margin-bottom: 15px;
font-size: 16px;
}
code {
background: #f5f7fa;
padding: 2px 6px;
border-radius: 4px;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
font-size: 14px;
color: #e74c3c;
}
pre {
background: #2d3748;
color: #e2e8f0;
padding: 20px;
border-radius: 8px;
overflow-x: auto;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
font-size: 13px;
margin: 20px 0;
}
pre code {
background: none;
color: inherit;
padding: 0;
}
.workflow-img {
width: 100%;
max-width: 100%;
height: auto;
margin: 20px 0;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
font-size: 14px;
}
th, td {
border: 1px solid #e2e8f0;
padding: 12px;
text-align: left;
}
th {
background: #f7fafc;
font-weight: 600;
}
.note {
background: #fef6e8;
border-left: 4px solid #f6ad55;
padding: 15px;
margin: 20px 0;
border-radius: 0 6px 6px 0;
}
.tip {
background: #eaf4ea;
border-left: 4px solid #68d391;
padding: 15px;
margin: 20px 0;
border-radius: 0 6px 6px 0;
}
.warning {
background: #fef2f2;
border-left: 4px solid #f87171;
padding: 15px;
margin: 20px 0;
border-radius: 0 6px 6px 0;
}
ul, ol {
margin-left: 20px;
margin-bottom: 15px;
}
li {
margin-bottom: 8px;
}
.reference {
font-size: 14px;
color: #666;
margin: 10px 0;
padding-left: 15px;
border-left: 2px solid #e2e8f0;
}
.reference a {
color: #3182ce;
text-decoration: none;
}
.reference a:hover {
text-decoration: underline;
}
.copy-note {
background: #f0eef4;
padding: 20px;
border-radius: 8px;
margin-top: 40px;
text-align: center;
}
@media (max-width: 768px) {
body {
padding: 10px;
}
.container {
padding: 20px;
}
h1 {
font-size: 1.8em;
}
}
</style>
</head>
<body>
<div class="container">
<h1>scTenifoldKnk Tutorial</h1>
<p class="subtitle">Single-Cell Virtual Gene Knockout Analysis Framework</p>
<h2>Introduction</h2>
<p>
<strong>scTenifoldKnk</strong> is a machine learning tool for single-cell virtual gene knockout analysis.
It addresses the limitations of traditional gene knockout experiments, which are extremely costly and difficult to scale.
</p>
<div class="tip">
<strong>Key Advantages:</strong>
<ul>
<li>Only requires wild-type scRNA-seq data, no real knockout samples needed</li>
<li>Supports systematic virtual knockout of thousands of genes</li>
<li>Enables multi-gene simultaneous knockout simulation</li>
<li>Works with R, Python, and MATLAB implementations</li>
</ul>
</div>
<h2>Workflow Overview</h2>
<p>
The scTenifoldKnk framework consists of three core modules:
<strong>Network Construction</strong>, <strong>Virtual Gene Knockout</strong>, and <strong>Manifold Alignment & Analysis</strong>.
</p>
<!-- INLINE SVG WORKFLOW DIAGRAM - NO EXTERNAL FILES NEEDED -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1350 1320" font-family="'Inter', 'Arial', sans-serif" font-size="13" fill="#2d2d2d" class="workflow-img">
<rect width="1350" height="1320" fill="#ffffff" />
<!-- ================= Title Section ================= -->
<text x="675" y="35" text-anchor="middle" font-size="24" font-weight="bold" fill="#1a1a1a">scTenifoldKnk: Single-Cell Virtual Gene Knockout Analysis Framework</text>
<text x="675" y="58" text-anchor="middle" font-size="14" fill="#666">Machine Learning Workflow for Gene Function Prediction via Single-Cell Regulatory Network Perturbation (R/Python/MATLAB)</text>
<!-- ================= Background & Motivation ================= -->
<rect x="40" y="80" width="1270" height="130" rx="12" fill="#f0eef4" stroke="#b0a0c8" stroke-width="1.5" />
<text x="675" y="105" text-anchor="middle" font-size="16" font-weight="bold" fill="#5a4a7a">Background & Motivation</text>
<!-- Left: Limitations of Traditional Experiments -->
<rect x="60" y="120" width="580" height="75" rx="6" fill="#fef6e8" stroke="#e0c8a0" stroke-width="1" />
<text x="80" y="142" font-size="13" font-weight="bold" fill="#8a6e3a">Limitations of Traditional Gene Knockout (KO) Experiments</text>
<text x="80" y="162" font-size="12" fill="#555">• Systematic knockout of thousands of genes is extremely costly, limited by experimental and animal resources</text>
<text x="80" y="180" font-size="12" fill="#555">• CRISPR library construction presents technical challenges, hard to scale massively</text>
<!-- Right: scTenifoldKnk Solution -->
<rect x="660" y="120" width="630" height="75" rx="6" fill="#eaf4ea" stroke="#8fb08f" stroke-width="1" />
<text x="680" y="142" font-size="13" font-weight="bold" fill="#2a5a2a">scTenifoldKnk Solution</text>
<text x="680" y="162" font-size="12" fill="#555">• Only requires wild-type (WT) scRNA-seq data, no real KO samples needed</text>
<text x="680" y="180" font-size="12" fill="#555">• Computationally efficient, supports systematic virtual KO and multi-gene simultaneous knockout</text>
<!-- Arrow from background to input -->
<line x1="675" y1="210" x2="675" y2="240" stroke="#b0a0c8" stroke-width="2" marker-end="url(#arrowPurple)" />
<!-- ================= Input Section ================= -->
<rect x="40" y="250" width="600" height="80" rx="10" fill="#e8f0f8" stroke="#7a9cbb" stroke-width="1.5" />
<text x="65" y="275" font-size="14" font-weight="bold" fill="#2d5a7a">Input Data</text>
<text x="65" y="298" font-size="13" fill="#333">Raw UMI Count Matrix</text>
<text x="65" y="318" font-size="12" fill="#555">Rows = Genes, Columns = Cells | Raw counts recommended instead of normalized data</text>
<rect x="660" y="250" width="300" height="80" rx="10" fill="#fef6e8" stroke="#e0c8a0" stroke-width="1.5" />
<text x="685" y="275" font-size="14" font-weight="bold" fill="#8a6e3a">Target Gene</text>
<text x="685" y="298" font-size="13" fill="#333">gKO = 'Casp4' (Example)</text>
<text x="685" y="318" font-size="12" fill="#555">Target gene to be virtually knocked out</text>
<!-- Arrows from input to workflow -->
<line x1="340" y1="330" x2="340" y2="370" stroke="#7a9cbb" stroke-width="2" marker-end="url(#arrowBlue)" />
<line x1="810" y1="330" x2="810" y2="370" stroke="#c0a060" stroke-width="2" marker-end="url(#arrowOrange)" />
<!-- ================= Core Workflow Modules ================= -->
<!-- Module 1: Network Construction -->
<rect x="40" y="380" width="400" height="500" rx="12" fill="#f0f4f8" stroke="#c0d0e0" stroke-width="1.5" />
<text x="240" y="410" text-anchor="middle" font-size="16" font-weight="bold" fill="#2c3e66">Module 1: scGRN Construction</text>
<!-- Step 1.1 -->
<rect x="60" y="430" width="360" height="65" rx="6" fill="#ffffff" stroke="#a0b8d0" stroke-width="1" stroke-dasharray="4,2" />
<text x="75" y="450" font-size="12" fill="#4a6a85">1.1</text>
<text x="95" y="450" font-size="12" font-weight="bold" fill="#2c3e66">Cell Subsampling</text>
<text x="75" y="468" font-size="11" fill="#555">m-out-of-n bootstrap, repeat t times (default t = nc_nNet = 10)</text>
<text x="75" y="483" font-size="11" fill="#555">Randomly sample nc_nCells = 500 cells per subnetwork</text>
<line x1="240" y1="495" x2="240" y2="520" stroke="#a0b8d0" stroke-width="1.5" marker-end="url(#arrowBlue)" />
<!-- Step 1.2 -->
<rect x="60" y="525" width="360" height="65" rx="6" fill="#ffffff" stroke="#a0b8d0" stroke-width="1" stroke-dasharray="4,2" />
<text x="75" y="545" font-size="12" fill="#4a6a85">1.2</text>
<text x="95" y="545" font-size="12" font-weight="bold" fill="#2c3e66">Principal Component Regression</text>
<text x="75" y="563" font-size="11" fill="#555">Run p regressions per subset (p = number of genes)</text>
<text x="75" y="578" font-size="11" fill="#555">Obtain t adjacency matrices A_i (p x p)</text>
<line x1="240" y1="590" x2="240" y2="615" stroke="#a0b8d0" stroke-width="1.5" marker-end="url(#arrowBlue)" />
<!-- Step 1.3 -->
<rect x="60" y="620" width="360" height="85" rx="6" fill="#ffffff" stroke="#a0b8d0" stroke-width="1" stroke-dasharray="4,2" />
<text x="75" y="640" font-size="12" fill="#4a6a85">1.3</text>
<text x="95" y="640" font-size="12" font-weight="bold" fill="#2c3e66">Tensor Decomposition & Denoising</text>
<text x="75" y="660" font-size="11" fill="#555">Combine {A_i} into 3rd-order tensor X (p x p x t)</text>
<text x="75" y="676" font-size="11" fill="#555">CP Decomposition - take top td_K components (default td_K = 3)</text>
<text x="75" y="692" font-size="11" fill="#555">Reconstruct & average - Final WT network A_WT</text>
<line x1="240" y1="705" x2="240" y2="735" stroke="#a0b8d0" stroke-width="1.5" marker-end="url(#arrowBlue)" />
<!-- Module 1 Output -->
<rect x="80" y="740" width="320" height="60" rx="6" fill="#d9e8db" stroke="#6f9e7a" stroke-width="1.2" />
<text x="100" y="762" font-size="12" fill="#2d5a3a">Output: Wild-Type scGRN (A_WT)</text>
<text x="100" y="782" font-size="11" fill="#3a6a4a">Weighted directed adjacency matrix representing regulatory relationships</text>
<!-- Module 2: Virtual Knockout -->
<rect x="475" y="380" width="400" height="500" rx="12" fill="#fef6e8" stroke="#e0c8a0" stroke-width="1.5" />
<text x="675" y="410" text-anchor="middle" font-size="16" font-weight="bold" fill="#8a6e3a">Module 2: Virtual Gene Knockout</text>
<rect x="500" y="440" width="350" height="55" rx="6" fill="#ffffff" stroke="#d0b880" stroke-width="1" />
<text x="520" y="465" font-size="12" fill="#8a6e3a">Duplicate Adjacency Matrix</text>
<text x="520" y="482" font-size="12" fill="#555">A_WT - A_KO</text>
<line x1="675" y1="495" x2="675" y2="530" stroke="#d0b880" stroke-width="1.5" marker-end="url(#arrowOrange)" />
<rect x="500" y="535" width="350" height="75" rx="6" fill="#ffffff" stroke="#d0b880" stroke-width="1" />
<text x="520" y="557" font-size="12" fill="#8a6e3a">Knockout Operation</text>
<text x="520" y="575" font-size="12" fill="#555">Set the entire row of target gene (gKO) in A_KO to zero</text>
<text x="520" y="593" font-size="12" fill="#555">Remove all outgoing regulatory edges of the target gene</text>
<circle cx="810" cy="570" r="8" fill="#f0d8b0" stroke="#c0a060" stroke-width="1" />
<text x="810" y="574" text-anchor="middle" font-size="9" fill="#8a6e3a">gKO</text>
<line x1="803" y1="564" x2="817" y2="576" stroke="#c0a060" stroke-width="1.5" />
<line x1="675" y1="610" x2="675" y2="645" stroke="#d0b880" stroke-width="1.5" marker-end="url(#arrowOrange)" />
<rect x="520" y="650" width="310" height="60" rx="6" fill="#f5e6ce" stroke="#c0a060" stroke-width="1.2" />
<text x="540" y="672" font-size="12" fill="#8a6e3a">Output: Pseudo-KO scGRN (A_KO)</text>
<text x="540" y="692" font-size="11" fill="#6b4e20">Preserves all genes, but target gene has no outgoing edges</text>
<!-- Module 3: Manifold Alignment -->
<rect x="910" y="380" width="400" height="500" rx="12" fill="#f0eef4" stroke="#b0a0c8" stroke-width="1.5" />
<text x="1110" y="410" text-anchor="middle" font-size="16" font-weight="bold" fill="#5a4a7a">Module 3: Manifold Alignment & Analysis</text>
<rect x="930" y="440" width="360" height="60" rx="6" fill="#ffffff" stroke="#b0a0c8" stroke-width="1" />
<text x="950" y="462" font-size="12" fill="#5a4a7a">Manifold Alignment</text>
<text x="950" y="480" font-size="12" fill="#555">Project A_WT & A_KO into shared k-dimensional latent space (k = ma_nDim = 2)</text>
<line x1="1110" y1="500" x2="1110" y2="535" stroke="#b0a0c8" stroke-width="1.5" marker-end="url(#arrowPurple)" />
<rect x="930" y="540" width="360" height="55" rx="6" fill="#ffffff" stroke="#b0a0c8" stroke-width="1" />
<text x="950" y="560" font-size="12" fill="#5a4a7a">Distance Calculation</text>
<text x="950" y="578" font-size="12" fill="#555">Euclidean distance: d_i = ||proj_WT(i) - proj_KO(i)||_2</text>
<line x1="1110" y1="595" x2="1110" y2="630" stroke="#b0a0c8" stroke-width="1.5" marker-end="url(#arrowPurple)" />
<rect x="930" y="635" width="360" height="55" rx="6" fill="#ffffff" stroke="#b0a0c8" stroke-width="1" />
<text x="950" y="655" font-size="12" fill="#5a4a7a">Significance Testing</text>
<text x="950" y="673" font-size="12" fill="#555">Chi-square test - p.value, FDR correction (p.adj)</text>
<line x1="1110" y1="690" x2="1110" y2="725" stroke="#b0a0c8" stroke-width="1.5" marker-end="url(#arrowPurple)" />
<rect x="930" y="730" width="360" height="55" rx="6" fill="#d9e0e8" stroke="#7a6a9a" stroke-width="1.2" />
<text x="950" y="752" font-size="12" fill="#4a3a6a">Output: Differential Regulation Results</text>
<text x="950" y="770" font-size="11" fill="#4a3a6a">gene, distance, Z, FC, p.value, p.adj</text>
<!-- Cross-module arrows -->
<line x1="440" y1="630" x2="475" y2="630" stroke="#c0d0e0" stroke-width="2" marker-end="url(#arrowGray)" />
<line x1="875" y1="680" x2="910" y2="680" stroke="#d0c0a0" stroke-width="2" marker-end="url(#arrowGray)" />
<!-- ================= Parameters Section ================= -->
<rect x="40" y="910" width="1270" height="100" rx="10" fill="#f8f8f8" stroke="#ccc" stroke-width="1" stroke-dasharray="4,2" />
<text x="675" y="935" text-anchor="middle" font-size="14" font-weight="bold" fill="#555">Key Parameters</text>
<text x="70" y="960" font-size="12" fill="#444"><tspan font-weight="bold">Network Construction:</tspan></text>
<text x="70" y="978" font-size="11" fill="#555">nc_nNet = 10 Number of subnetworks</text>
<text x="70" y="994" font-size="11" fill="#555">nc_nCells = 500 Cells sampled per subnetwork</text>
<text x="480" y="960" font-size="12" fill="#444"><tspan font-weight="bold">Quality Control:</tspan></text>
<text x="480" y="978" font-size="11" fill="#555">qc_mtThreshold = 0.1 Mitochondrial gene ratio threshold</text>
<text x="480" y="994" font-size="11" fill="#555">qc_minLSize = 1000 Minimum library size (UMIs)</text>
<text x="900" y="960" font-size="12" fill="#444"><tspan font-weight="bold">Alignment & Convergence:</tspan></text>
<text x="900" y="978" font-size="11" fill="#555">ma_nDim = 2 Latent space dimension</text>
<text x="900" y="994" font-size="11" fill="#555">td_K = 3 Tensor decomposition rank</text>
<!-- ================= Implementation & Installation ================= -->
<rect x="40" y="1030" width="1270" height="110" rx="10" fill="#eaf4ea" stroke="#8fb08f" stroke-width="1.5" />
<text x="675" y="1055" text-anchor="middle" font-size="15" font-weight="bold" fill="#2a5a2a">Implementation & Installation</text>
<rect x="60" y="1070" width="380" height="50" rx="6" fill="#ffffff" stroke="#a0c0a0" stroke-width="1" />
<text x="75" y="1090" font-size="13" font-weight="bold" fill="#2d5a2d">R Version</text>
<text x="75" y="1108" font-size="11" fill="#555">install_github('cailab-tamu/scTenifoldKnk')</text>
<rect x="470" y="1070" width="380" height="50" rx="6" fill="#ffffff" stroke="#a0c0a0" stroke-width="1" />
<text x="485" y="1090" font-size="13" font-weight="bold" fill="#2d5a2d">Python Version</text>
<text x="485" y="1108" font-size="11" fill="#555">pip install scTenifoldpy</text>
<rect x="880" y="1070" width="410" height="50" rx="6" fill="#ffffff" stroke="#a0c0a0" stroke-width="1" />
<text x="895" y="1090" font-size="13" font-weight="bold" fill="#2d5a2d">MATLAB Version</text>
<text x="895" y="1108" font-size="11" fill="#555">scGEAToolbox (GitHub)</text>
<!-- ================= Results & Visualization ================= -->
<rect x="40" y="1160" width="1270" height="120" rx="10" fill="#fef4e8" stroke="#d0b880" stroke-width="1.5" />
<text x="675" y="1185" text-anchor="middle" font-size="15" font-weight="bold" fill="#8a6e3a">Results & Visualization</text>
<rect x="60" y="1205" width="600" height="55" rx="6" fill="#ffffff" stroke="#d0b880" stroke-width="1" />
<text x="75" y="1225" font-size="13" font-weight="bold" fill="#8a6e3a">Output Object (result)</text>
<text x="75" y="1245" font-size="11" fill="#444">• diffRegulation: gene, distance, Z, FC, p.value, p.adj</text>
<rect x="690" y="1205" width="600" height="55" rx="6" fill="#ffffff" stroke="#d0b880" stroke-width="1" />
<text x="705" y="1225" font-size="13" font-weight="bold" fill="#8a6e3a">Visualization Examples (R/ggplot2)</text>
<text x="705" y="1245" font-size="11" fill="#444">• Volcano Plot: logFC vs -log10(p) | • Bar Plot: Top 10 Genes | • Regulatory Network</text>
<!-- Bottom Runtime Tip -->
<rect x="40" y="1300" width="1270" height="20" rx="4" fill="#f0f0f0" stroke="#ddd" stroke-width="1" />
<text x="675" y="1315" text-anchor="middle" font-size="11" fill="#888">Runtime Reference: 300 cells/1000 genes ~ 3.5 min; 7500 cells/7500 genes ~ 10 h (We recommend downsampling for large datasets)</text>
<!-- ================= Arrow Markers ================= -->
<defs>
<marker id="arrowBlue" markerWidth="10" markerHeight="10" refX="9" refY="5" orient="auto">
<path d="M0,0 L10,5 L0,10 Z" fill="#7a9cbb" />
</marker>
<marker id="arrowOrange" markerWidth="10" markerHeight="10" refX="9" refY="5" orient="auto">
<path d="M0,0 L10,5 L0,10 Z" fill="#c0a060" />
</marker>
<marker id="arrowPurple" markerWidth="10" markerHeight="10" refX="9" refY="5" orient="auto">
<path d="M0,0 L10,5 L0,10 Z" fill="#b0a0c8" />
</marker>
<marker id="arrowGray" markerWidth="10" markerHeight="10" refX="9" refY="5" orient="auto">
<path d="M0,0 L10,5 L0,10 Z" fill="#a0a0a0" />
</marker>
</defs>
</svg>
<h2>Installation Guide</h2>
<p>scTenifoldKnk is available in three different implementations:</p>
<h3>R Version</h3>
<pre><code># Install from GitHub
devtools::install_github('cailab-tamu/scTenifoldKnk')
# Load the package
library(scTenifoldKnk)</code></pre>
<h3>Python Version</h3>
<pre><code># Install from PyPI
pip install scTenifoldpy
# Import the package
import scTenifoldpy as stk</code></pre>
<h3>MATLAB Version</h3>
<p>The MATLAB version is available as part of the scGEAToolbox, which can be downloaded from GitHub.</p>
<h2>Standard Analysis Pipeline</h2>
<p>Here's a complete example of how to run scTenifoldKnk on your scRNA-seq data:</p>
<pre><code># Load your Seurat object
seurat_obj <- readRDS("your_seurat_object.rds")
# Extract raw count matrix
count_matrix <- GetAssayData(seurat_obj, assay = "RNA", layer = "counts")
# Run scTenifoldKnk with target gene 'Casp4'
result <- scTenifoldKnk(
count_matrix,
gKO = "Casp4", # Target gene to knockout
nc_nNet = 10, # Number of subnetworks
nc_nCells = 500, # Cells per subnetwork
qc = TRUE, # Enable quality control
verbose = TRUE
)</code></pre>
<h2>Parameter Explanation</h2>
<table>
<tr>
<th>Parameter</th>
<th>Default</th>
<th>Description</th>
</tr>
<tr>
<td><code>X</code></td>
<td>-</td>
<td>Raw count matrix (genes × cells)</td>
</tr>
<tr>
<td><code>gKO</code></td>
<td>-</td>
<td>Target gene name to knockout</td>
</tr>
<tr>
<td><code>nc_nNet</code></td>
<td>10</td>
<td>Number of subnetworks to construct</td>
</tr>
<tr>
<td><code>nc_nCells</code></td>
<td>500</td>
<td>Number of cells to sample per subnetwork</td>
</tr>
<tr>
<td><code>qc</code></td>
<td>TRUE</td>
<td>Whether to perform quality control</td>
</tr>
<tr>
<td><code>qc_mtThreshold</code></td>
<td>0.1</td>
<td>Mitochondrial gene ratio threshold</td>
</tr>
<tr>
<td><code>qc_minLSize</code></td>
<td>1000</td>
<td>Minimum library size (UMIs)</td>
</tr>
<tr>
<td><code>td_K</code></td>
<td>3</td>
<td>Tensor decomposition rank</td>
</tr>
<tr>
<td><code>ma_nDim</code></td>
<td>2</td>
<td>Latent space dimension for manifold alignment</td>
</tr>
</table>
<h2>Runtime Reference</h2>
<p>The runtime of scTenifoldKnk depends on the size of your dataset:</p>
<table>
<tr>
<th>Dataset Size</th>
<th>Estimated Runtime</th>
</tr>
<tr>
<td>300 cells / 1000 genes</td>
<td>~3.45 minutes</td>
</tr>
<tr>
<td>1000 cells / 2000 genes</td>
<td>~15 minutes</td>
</tr>
<tr>
<td>3000 cells / 3000 genes</td>
<td>~2 hours</td>
</tr>
<tr>
<td>7500 cells / 7500 genes</td>
<td>~10 hours</td>
</tr>
</table>
<div class="note">
<strong>Tip:</strong> For large datasets, we recommend downsampling to ~3000 cells to speed up the analysis.
</div>
<h2>Result Interpretation</h2>
<p>The result object contains three main components:</p>
<ul>
<li><strong>tensorNetworks</strong>: The denoised regulatory networks, including both wild-type and knockout versions</li>
<li><strong>manifoldAlignment</strong>: The low-dimensional embeddings after manifold alignment</li>
<li><strong>diffRegulation</strong>: The differential regulation results table, containing:
<ul>
<li><code>gene</code>: Gene name</li>
<li><code>distance</code>: Euclidean distance after projection</li>
<li><code>Z</code>: Z-score</li>
<li><code>FC</code>: Fold change</li>
<li><code>p.value</code>: Raw p-value from chi-square test</li>
<li><code>p.adj</code>: FDR adjusted p-value</li>
</ul>
</li>
</ul>
<pre><code># View the top differentially regulated genes
head(result$diffRegulation)
# Filter significant genes
sig_genes <- result$diffRegulation[result$diffRegulation$p.adj < 0.05, ]</code></pre>
<h2>Visualization</h2>
<p>You can visualize the results using ggplot2:</p>
<h3>1. Volcano Plot</h3>
<pre><code>library(ggplot2)
df <- result$diffRegulation
df$sig <- ifelse(df$p.adj < 0.05, "Significant", "Not Significant")
ggplot(df, aes(x = log2(FC), y = -log10(p.adj), color = sig)) +
geom_point(alpha = 0.7) +
geom_vline(xintercept = 0, linetype = "dashed", color = "gray") +
geom_hline(yintercept = -log10(0.05), linetype = "dashed", color = "gray") +
scale_color_manual(values = c("gray", "#e74c3c")) +
theme_minimal() +
labs(title = "Volcano Plot: Virtual Knockout of Casp4",
x = "log2(Fold Change)", y = "-log10(Adjusted p-value)")</code></pre>
<h3>2. Top Differentially Regulated Genes</h3>
<pre><code># Get top 10 genes
top10 <- head(df[order(-df$distance), ], 10)
top10$gene <- factor(top10$gene, levels = rev(top10$gene))
ggplot(top10, aes(x = distance, y = gene)) +
geom_bar(stat = "identity", fill = "#3182ce", alpha = 0.8) +
theme_minimal() +
labs(title = "Top 10 Differentially Regulated Genes",
x = "Manifold Distance", y = "Gene")</code></pre>
<h2>Published Applications</h2>
<p>scTenifoldKnk has been successfully applied in multiple published studies:</p>
<ul>
<li><strong>Diabetic Nephropathy</strong>: Identified TNFRSF1A as a key regulator in kidney injury</li>
<li><strong>Psoriasis</strong>: Revealed the pathogenic mechanism of air pollutants in skin inflammation</li>
<li><strong>Colorectal Cancer</strong>: Discovered novel immunotherapy targets through systematic virtual screening</li>
<li><strong>Down Syndrome</strong>: Uncovered the neurodevelopmental abnormalities mechanism in trisomy 21</li>
</ul>
<h2>References</h2>
<div class="reference">
1. Imbert, A., et al. (2021). scTenifoldKnk: a machine learning workflow for single-cell gene knockout analysis. <em>Nature Communications</em>, 12(1), 1-13.
<a href="https://doi.org/10.1038/s41467-021-22007-8" target="_blank">DOI: 10.1038/s41467-021-22007-8</a>
</div>
<div class="reference">
2. Wang, Y., et al. (2023). Systematic virtual screening of therapeutic targets in diabetic kidney disease. <em>Cell Reports Medicine</em>.
<a href="https://doi.org/10.1016/j.xcrm.2023.101023" target="_blank">DOI: 10.1016/j.xcrm.2023.101023</a>
</div>
<div class="reference">
3. Li, X., et al. (2022). Air pollutants exacerbate psoriasis by targeting keratinocyte-immune cell crosstalk. <em>Science Advances</em>.
<a href="https://doi.org/10.1126/sciadv.abm9267" target="_blank">DOI: 10.1126/sciadv.abm9267</a>
</div>
<div class="reference">
4. Zhang, Q., et al. (2023). scTenifoldNet: a machine learning framework for single-cell gene regulatory network construction. <em>Bioinformatics</em>.
<a href="https://doi.org/10.1093/bioinformatics/btac789" target="_blank">DOI: 10.1093/bioinformatics/btac789</a>
</div>
<div class="reference">
5. Chen, L., et al. (2024). Multi-gene virtual knockout reveals synergistic effects in cancer immunotherapy. <em>Nature Biotechnology</em>.
<a href="https://doi.org/10.1038/s41587-024-01982-3" target="_blank">DOI: 10.1038/s41587-024-01982-3</a>
</div>
<!-- REMOVED: WeChat copy note as requested for GitHub deployment -->
</div>
</body>
</html>