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
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
|
%global _empty_manifest_terminate_build 0
Name: python-cstreet
Version: 1.1.2
Release: 1
Summary: CStreet is a python script (python 3.6, 3.7 or 3.8) for cell state trajectory construction by using k-nearest neighbors graph algorithm for time-series single-cell RNA-seq data.
License: MIT License
URL: https://github.com/yw-Hua/CStreet
Source0: https://mirrors.aliyun.com/pypi/web/packages/f9/cd/4c74db35a79bf79c48aedcba8a3b2a38561c93be8e8c41a199d1349f604c/cstreet-1.1.2.tar.gz
BuildArch: noarch
Requires: python3-pandas
Requires: python3-numpy
Requires: python3-scanpy
Requires: python3-anndata
Requires: python3-networkx
Requires: python3-colorama
Requires: python3-fa2
Requires: python3-retrying
Requires: python3-igraph
Requires: python3-louvain
%description
# CStreet: a computed <ins>C</ins>ell <ins>S</ins>tate <ins>tr</ins>ajectory inf<ins>e</ins>r<ins>e</ins>nce method for <ins>t</ins>ime-series single-cell RNA-seq data
 
**| [Overview](#overview) | [Installation](#installation) | [Quick Start](#quick-start) | [Parameter Details](#parameter-details) | [Run CStreet in python interface](#run-cstreet-in-python-interface) | [Data&Code](#supplementary-datacode) | [Citation](#citation) |**

## Overview
CStreet is a cell state trajectory inference method for time-series single-cell RNA-seq data. It is written in Python (3.6, 3.7 or 3.8) and is available as a command line tool and a Python library to meet the needs of different users.
CStreet uses time-series information to construct the k-nearest neighbors connections within and between time points. Then, CStreet calculates the connection probabilities of cell states and visualizes the trajectory, which may include multiple starting points and paths, using a force-directed layout method.
## Installation
CStreet has been packaged and uploaded to [PyPI](https://pypi.org/project/cstreet/). Before your installation, ensure that you have pip available. pip3 is the package installer for Python. If you do not have pip3 on your machine, click [here](https://pip.pypa.io/en/stable/) to install it. Then, CStreet and its relevant packages can be installed using a single command.
```shell
$ pip3 install cstreet
```
You may experience errors when installing or updating packages. This is because pip3 will change the way that it resolves dependency conflicts. We recommend you use the command below.
```shell
$ pip3 install cstreet --use-feature=2020-resolver
```
You may need to use the command below to add the default installation path of pip3 to your system path,
```shell
$ export PATH=~/.local/bin:$PATH
```
Then, type the command below to check whether CStreet has been installed successfully.(For the first time running, it may takes about one minute for CStreet’s initial configuration.)
```shell
$ CStreet -h
```
## Quick Start
### Step 1. CStreet installation following the above tutorial.
### Step 2. Input preparation
CStreet utilizes time-series expression levels in tab-delimited format or AnnData format as input.
The cell state information can be generated using the built-in clustering function of CStreet or input by the user.
We provided a small [test dataset](https://github.com/yw-Hua/CStreet/tree/master/test/test_data) containing normalized expression levels and the state information at three time points.
Or type the command below to download.
```shell
$ wget https://github.com/yw-Hua/CStreet/raw/master/test/test_data.zip
$ unzip test_data.zip
```
### Step 3. Operation of CStreet
Type the command below to run CStreet.
```shell
$ CStreet -i test_data/ExpressionMatrix_t1.txt test_data/ExpressionMatrix_t2.txt test_data/ExpressionMatrix_t3.txt -s test_data/CellStates_t1.txt test_data/CellStates_t2.txt test_data/CellStates_t3.txt -n test
```
### Step 4. Output
The contents of the output directory in tree format will be displayed as described below, including the clustered cell state information if it is not provided by users, the connection probabilities of the cell states and a visualization of the inferred cell state trajectories.
```shell
PATH/ProjectName
├── ProjectName_CStreetTopology.pdf
├── ProjectName_CellStatesConnCytoscape.txt
├── SupplementaryFigures
│ ├── ProjectName_t1_ForceDirectedLayout.pdf
│ ├── ProjectName_t1_LouvainUMAPClustering.pdf
│ ├── ProjectName_t1_LouvainUMAPClusteringCoordinates.txt
│ ├── ProjectName_t2_ForceDirectedLayout.pdf
│ ├── ProjectName_t2_LouvainUMAPClustering.pdf
│ ├── ProjectName_t2_LouvainUMAPClusteringCoordinates.txt
│ └── ...
└── SupplementaryResults
├── ProjectName_BetweenTimePoints_CellStatesConnectionProbabilities.txt
├── ProjectName_t1_FilteredCellInfo.txt
├── ProjectName_t1_FilteredGeneInfo.txt
├── ProjectName_t1_CellStatesConnectionProbabilities.txt
├── ProjectName_t2_FilteredCellInfo.txt
├── ProjectName_t2_FilteredGeneInfo.txt
├── ProjectName_t2_CellStatesConnectionProbabilities.txt
└── ...
```

## Parameter Details
The parameter details of CStreet are as follows:
```
usage: CStreet [-h] <-i ExpMatrix1 ExpMatrix2 ExpMatrix3 ...> [-s CellStates1 CellStates2 CellStates3 ...] [-n ProjectName] [-o OutputDir] [options]
CStreet is a cell states trajectory inference method for time-series single-cell RNA-seq data.
optional arguments:
-h, --help show this help message and exit
-v, --version show version number of CStreet and exit
-i INPUT_EXPMATRIX [INPUT_EXPMATRIX ...], --Input_ExpMatrix INPUT_EXPMATRIX [INPUT_EXPMATRIX ...]
This indicates expression matrixes, which contain the
time-series expression level as read counts or
normalized values in tab-delimited format. For
example: '-i ExpressionMatrix_t1.txt
ExpressionMatrix_t2.txt ExpressionMatrix_t3.txt'
indicates the input of 3 timepoint expression
matrixes.
-T, --Input_CellinCol
This determines whether the expression level of one
cell is displayed as a column in the expression
matrixes. For example, '-T' indicates that the gene
expression levels of one cell are displayed in a
column and the expression levels of one gene across
all cells are displayed in a row.
-o OUTPUT_DIR, --Output_Dir OUTPUT_DIR
The project directory, which is used to save all
output files. DEFAULT: "./".
-n OUTPUT_NAME, --Output_Name OUTPUT_NAME
The project name, which is used to generate output
file names as a prefix. DEFAULT: "CStreet"
-s [INPUT_CELLSTATES [INPUT_CELLSTATES ...]], --Input_CellStates [INPUT_CELLSTATES [INPUT_CELLSTATES ...]]
An optional parameter that uses CStreet's built-in
dimensionality reduction and clustering methods to
perform clustering without knowing the cell states
(DEFAULT) or accepts the user’s input. The input files
should contain the cell state information sharing the
same cell ID in the expression matrixes in tab-
delimited format.
--CellClusterParam_PCAn CELLCLUSTERPARAM_PCAN
The number of principal components to use, which is
enabled only if the cell state information is not
provided. It can be set from 1 to the minimum
dimension size of the expression matrixes. DEFAULT:
10.
--CellClusterParam_k CELLCLUSTERPARAM_K
The number of nearest neighbors to be searched, which
is enabled only if the cell state information is not
provided. It should be in the range of 2 to 100 in
general. DEFAULT: 15.
--CellClusterParam_Resolution CELLCLUSTERPARAM_RESOLUTION
The resolution of the Louvain algorithm, which is
enabled only if the cell state information is not
provided. A higher resolution means that more and
smaller clusters are found. DEFAULT: 0.1.
--Switch_DeadCellFilter {ON,OFF}
The switch for the dead cell filter, which filters
cell outliers based on the count percent of
mitochondrial genes. DEFAULT: "ON".
--Threshold_MitoPercent THRESHOLD_MITOPERCENT
The maximum count percent of mitochondrial genes
needed for a cell to pass filtering, which is enabled
only if '--Switch_DeadCellFilter' is "ON". DEFAULT:
0.2.
--Switch_LowCellNumGeneFilter {ON,OFF}
The switch for the low cell number gene filter, which
retains genes that are expressed in at least a certain
number of cells. DEFAULT: "ON".
--Threshold_LowCellNum THRESHOLD_LOWCELLNUM
The minimum number of cells expressed that is required
for a gene to pass filtering, which is enabled only if
'--Switch_LowCellNumGeneFilter' is "ON". DEFAULT: 3.
--Switch_LowGeneCellsFilter {ON,OFF}
The switch for the low gene number cell filter, which
retains cells with at least a certain number of genes
expressed. DEFAULT: "ON".
--Threshold_LowGeneNum THRESHOLD_LOWGENENUM
The minimum number of genes expressed that is required
for a cell to pass filtering, which is enabled only if
'--Switch_LowGeneCellsFilter' is "ON". DEFAULT: 200.
--Switch_Normalize {ON,OFF}
The switch to enable total read count normalization
for each cell. DEFAULT: "ON".
--Threshold_NormalizeBase THRESHOLD_NORMALIZEBASE
The base of normalization, which is enabled only if '
--Switch_Normalize' is "ON". If the DEFAULT is chosen,
it is CPM normalization. DEFAULT: 1e6.
--Switch_LogTransform {ON,OFF}
The switch to logarithmize the expression matrix.
DEFAULT: "ON".
--KNNParam_metric KNNPARAM_METRIC
The distance metric to use for kNN. It can be set to
"euclidean" or "correlation". DEFAULT: "euclidean".
--WithinTimePointParam_PCAn WITHINTIMEPOINTPARAM_PCAN
The number of principal components to use within a
timepoint. It can be set from 1 to the minimum
dimension size of the expression matrixes. DEFAULT:
10.
--WithinTimePointParam_k WITHINTIMEPOINTPARAM_K
The number of nearest neighbors to be searched within
a timepoint. It should be in the range of 2 to 100 in
general. DEFAULT: 15.
--BetweenTimePointParam_PCAn BETWEENTIMEPOINTPARAM_PCAN
The number of principal components to use between
timepoints. It can be set from 1 to the minimum
dimension size of the expression matrixes. DEFAULT:
10.
--BetweenTimePointParam_k BETWEENTIMEPOINTPARAM_K
The number of nearest neighbors to be searched between
timepoints. It should be in the range of 2 to 100 in
general. DEFAULT: 15.
--ProbParam_SamplingSize PROBPARAM_SAMPLINGSIZE
The number of repeated sampling trials used to
estimate the connection probability. DEFAULT: 5.
--ProbParam_RandomSeed PROBPARAM_RANDOMSEED
The seed of repeated sampling trials used to estimate
the connection probability. DEFAULT: 0.
--FigureParam_FigureSize FIGUREPARAM_FIGURESIZE FIGUREPARAM_FIGURESIZE
Figure size of the result figure. For example: '--
FigureParam_FigureSize 6 7' indicates width is 6 and
height is 7. DEFAULT: 6 7.
--FigureParam_LabelBoxWidth FIGUREPARAM_LABELBOXWIDTH
The width of the label box in the result figure. For
example, '--FigureParam_LabelBoxWidth 10' means that
10 characters will be shown in the label box of the
resulting figure. DEFAULT: 10.
--Threshold_MinProbability THRESHOLD_MINPROBABILITY
The minimum probability of edge for each cell state
that is displayed, which will only be used for
visualization. It can be a number between 0 and 1 or
"OTSU". When OTSU is selected, it will be
automatically estimated using OTSU's Method (OTSU,
1979). DEFAULT: "OTSU".
--Threshold_MaxOutDegree THRESHOLD_MAXOUTDEGREE
The maximum number of outdegrees for each cell state
that is displayed, which will only be used for
visualization. DEFAULT: 10.
--Threshold_MinCellNumofStates THRESHOLD_MINCELLNUMOFSTATES
The minimum cell number of each cell state that is
displayed, which will only be used for visualization.
DEFAULT: 0.
```
## Run CStreet in Python interface
CStreet can also be used step by step in the Python interface and easily integrated into custom scripts. [Here](https://nbviewer.jupyter.org/github/yw-Hua/CStreet/blob/master/tutorial.ipynb) is a tutorial written using [Jupyter Notebook](https://jupyter.org/).
## Supplementary Data&Code
All supplementary code and data, including cell type annotations, used to run the comparisons are available on [here](https://1drv.ms/u/s!Atc1l0sjoiRyhaxOqZYIGkgOyI3Lhg?e=bfhR9u).
The [Anndata h5ad file format](https://anndata.readthedocs.io/en/stable/index.html) is used to stored single-cell expression data and additional annotations in our supplementary file.
## Citation
Zhao C, Xiu W, Hua Y, Zhang N, Zhang Y. CStreet: a computed Cell State trajectory inference method for time-series single-cell RNA sequencing data. Bioinformatics (Oxford, England). 2021 Jul. DOI: 10.1093/bioinformatics/btab488.
%package -n python3-cstreet
Summary: CStreet is a python script (python 3.6, 3.7 or 3.8) for cell state trajectory construction by using k-nearest neighbors graph algorithm for time-series single-cell RNA-seq data.
Provides: python-cstreet
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-cstreet
# CStreet: a computed <ins>C</ins>ell <ins>S</ins>tate <ins>tr</ins>ajectory inf<ins>e</ins>r<ins>e</ins>nce method for <ins>t</ins>ime-series single-cell RNA-seq data
 
**| [Overview](#overview) | [Installation](#installation) | [Quick Start](#quick-start) | [Parameter Details](#parameter-details) | [Run CStreet in python interface](#run-cstreet-in-python-interface) | [Data&Code](#supplementary-datacode) | [Citation](#citation) |**

## Overview
CStreet is a cell state trajectory inference method for time-series single-cell RNA-seq data. It is written in Python (3.6, 3.7 or 3.8) and is available as a command line tool and a Python library to meet the needs of different users.
CStreet uses time-series information to construct the k-nearest neighbors connections within and between time points. Then, CStreet calculates the connection probabilities of cell states and visualizes the trajectory, which may include multiple starting points and paths, using a force-directed layout method.
## Installation
CStreet has been packaged and uploaded to [PyPI](https://pypi.org/project/cstreet/). Before your installation, ensure that you have pip available. pip3 is the package installer for Python. If you do not have pip3 on your machine, click [here](https://pip.pypa.io/en/stable/) to install it. Then, CStreet and its relevant packages can be installed using a single command.
```shell
$ pip3 install cstreet
```
You may experience errors when installing or updating packages. This is because pip3 will change the way that it resolves dependency conflicts. We recommend you use the command below.
```shell
$ pip3 install cstreet --use-feature=2020-resolver
```
You may need to use the command below to add the default installation path of pip3 to your system path,
```shell
$ export PATH=~/.local/bin:$PATH
```
Then, type the command below to check whether CStreet has been installed successfully.(For the first time running, it may takes about one minute for CStreet’s initial configuration.)
```shell
$ CStreet -h
```
## Quick Start
### Step 1. CStreet installation following the above tutorial.
### Step 2. Input preparation
CStreet utilizes time-series expression levels in tab-delimited format or AnnData format as input.
The cell state information can be generated using the built-in clustering function of CStreet or input by the user.
We provided a small [test dataset](https://github.com/yw-Hua/CStreet/tree/master/test/test_data) containing normalized expression levels and the state information at three time points.
Or type the command below to download.
```shell
$ wget https://github.com/yw-Hua/CStreet/raw/master/test/test_data.zip
$ unzip test_data.zip
```
### Step 3. Operation of CStreet
Type the command below to run CStreet.
```shell
$ CStreet -i test_data/ExpressionMatrix_t1.txt test_data/ExpressionMatrix_t2.txt test_data/ExpressionMatrix_t3.txt -s test_data/CellStates_t1.txt test_data/CellStates_t2.txt test_data/CellStates_t3.txt -n test
```
### Step 4. Output
The contents of the output directory in tree format will be displayed as described below, including the clustered cell state information if it is not provided by users, the connection probabilities of the cell states and a visualization of the inferred cell state trajectories.
```shell
PATH/ProjectName
├── ProjectName_CStreetTopology.pdf
├── ProjectName_CellStatesConnCytoscape.txt
├── SupplementaryFigures
│ ├── ProjectName_t1_ForceDirectedLayout.pdf
│ ├── ProjectName_t1_LouvainUMAPClustering.pdf
│ ├── ProjectName_t1_LouvainUMAPClusteringCoordinates.txt
│ ├── ProjectName_t2_ForceDirectedLayout.pdf
│ ├── ProjectName_t2_LouvainUMAPClustering.pdf
│ ├── ProjectName_t2_LouvainUMAPClusteringCoordinates.txt
│ └── ...
└── SupplementaryResults
├── ProjectName_BetweenTimePoints_CellStatesConnectionProbabilities.txt
├── ProjectName_t1_FilteredCellInfo.txt
├── ProjectName_t1_FilteredGeneInfo.txt
├── ProjectName_t1_CellStatesConnectionProbabilities.txt
├── ProjectName_t2_FilteredCellInfo.txt
├── ProjectName_t2_FilteredGeneInfo.txt
├── ProjectName_t2_CellStatesConnectionProbabilities.txt
└── ...
```

## Parameter Details
The parameter details of CStreet are as follows:
```
usage: CStreet [-h] <-i ExpMatrix1 ExpMatrix2 ExpMatrix3 ...> [-s CellStates1 CellStates2 CellStates3 ...] [-n ProjectName] [-o OutputDir] [options]
CStreet is a cell states trajectory inference method for time-series single-cell RNA-seq data.
optional arguments:
-h, --help show this help message and exit
-v, --version show version number of CStreet and exit
-i INPUT_EXPMATRIX [INPUT_EXPMATRIX ...], --Input_ExpMatrix INPUT_EXPMATRIX [INPUT_EXPMATRIX ...]
This indicates expression matrixes, which contain the
time-series expression level as read counts or
normalized values in tab-delimited format. For
example: '-i ExpressionMatrix_t1.txt
ExpressionMatrix_t2.txt ExpressionMatrix_t3.txt'
indicates the input of 3 timepoint expression
matrixes.
-T, --Input_CellinCol
This determines whether the expression level of one
cell is displayed as a column in the expression
matrixes. For example, '-T' indicates that the gene
expression levels of one cell are displayed in a
column and the expression levels of one gene across
all cells are displayed in a row.
-o OUTPUT_DIR, --Output_Dir OUTPUT_DIR
The project directory, which is used to save all
output files. DEFAULT: "./".
-n OUTPUT_NAME, --Output_Name OUTPUT_NAME
The project name, which is used to generate output
file names as a prefix. DEFAULT: "CStreet"
-s [INPUT_CELLSTATES [INPUT_CELLSTATES ...]], --Input_CellStates [INPUT_CELLSTATES [INPUT_CELLSTATES ...]]
An optional parameter that uses CStreet's built-in
dimensionality reduction and clustering methods to
perform clustering without knowing the cell states
(DEFAULT) or accepts the user’s input. The input files
should contain the cell state information sharing the
same cell ID in the expression matrixes in tab-
delimited format.
--CellClusterParam_PCAn CELLCLUSTERPARAM_PCAN
The number of principal components to use, which is
enabled only if the cell state information is not
provided. It can be set from 1 to the minimum
dimension size of the expression matrixes. DEFAULT:
10.
--CellClusterParam_k CELLCLUSTERPARAM_K
The number of nearest neighbors to be searched, which
is enabled only if the cell state information is not
provided. It should be in the range of 2 to 100 in
general. DEFAULT: 15.
--CellClusterParam_Resolution CELLCLUSTERPARAM_RESOLUTION
The resolution of the Louvain algorithm, which is
enabled only if the cell state information is not
provided. A higher resolution means that more and
smaller clusters are found. DEFAULT: 0.1.
--Switch_DeadCellFilter {ON,OFF}
The switch for the dead cell filter, which filters
cell outliers based on the count percent of
mitochondrial genes. DEFAULT: "ON".
--Threshold_MitoPercent THRESHOLD_MITOPERCENT
The maximum count percent of mitochondrial genes
needed for a cell to pass filtering, which is enabled
only if '--Switch_DeadCellFilter' is "ON". DEFAULT:
0.2.
--Switch_LowCellNumGeneFilter {ON,OFF}
The switch for the low cell number gene filter, which
retains genes that are expressed in at least a certain
number of cells. DEFAULT: "ON".
--Threshold_LowCellNum THRESHOLD_LOWCELLNUM
The minimum number of cells expressed that is required
for a gene to pass filtering, which is enabled only if
'--Switch_LowCellNumGeneFilter' is "ON". DEFAULT: 3.
--Switch_LowGeneCellsFilter {ON,OFF}
The switch for the low gene number cell filter, which
retains cells with at least a certain number of genes
expressed. DEFAULT: "ON".
--Threshold_LowGeneNum THRESHOLD_LOWGENENUM
The minimum number of genes expressed that is required
for a cell to pass filtering, which is enabled only if
'--Switch_LowGeneCellsFilter' is "ON". DEFAULT: 200.
--Switch_Normalize {ON,OFF}
The switch to enable total read count normalization
for each cell. DEFAULT: "ON".
--Threshold_NormalizeBase THRESHOLD_NORMALIZEBASE
The base of normalization, which is enabled only if '
--Switch_Normalize' is "ON". If the DEFAULT is chosen,
it is CPM normalization. DEFAULT: 1e6.
--Switch_LogTransform {ON,OFF}
The switch to logarithmize the expression matrix.
DEFAULT: "ON".
--KNNParam_metric KNNPARAM_METRIC
The distance metric to use for kNN. It can be set to
"euclidean" or "correlation". DEFAULT: "euclidean".
--WithinTimePointParam_PCAn WITHINTIMEPOINTPARAM_PCAN
The number of principal components to use within a
timepoint. It can be set from 1 to the minimum
dimension size of the expression matrixes. DEFAULT:
10.
--WithinTimePointParam_k WITHINTIMEPOINTPARAM_K
The number of nearest neighbors to be searched within
a timepoint. It should be in the range of 2 to 100 in
general. DEFAULT: 15.
--BetweenTimePointParam_PCAn BETWEENTIMEPOINTPARAM_PCAN
The number of principal components to use between
timepoints. It can be set from 1 to the minimum
dimension size of the expression matrixes. DEFAULT:
10.
--BetweenTimePointParam_k BETWEENTIMEPOINTPARAM_K
The number of nearest neighbors to be searched between
timepoints. It should be in the range of 2 to 100 in
general. DEFAULT: 15.
--ProbParam_SamplingSize PROBPARAM_SAMPLINGSIZE
The number of repeated sampling trials used to
estimate the connection probability. DEFAULT: 5.
--ProbParam_RandomSeed PROBPARAM_RANDOMSEED
The seed of repeated sampling trials used to estimate
the connection probability. DEFAULT: 0.
--FigureParam_FigureSize FIGUREPARAM_FIGURESIZE FIGUREPARAM_FIGURESIZE
Figure size of the result figure. For example: '--
FigureParam_FigureSize 6 7' indicates width is 6 and
height is 7. DEFAULT: 6 7.
--FigureParam_LabelBoxWidth FIGUREPARAM_LABELBOXWIDTH
The width of the label box in the result figure. For
example, '--FigureParam_LabelBoxWidth 10' means that
10 characters will be shown in the label box of the
resulting figure. DEFAULT: 10.
--Threshold_MinProbability THRESHOLD_MINPROBABILITY
The minimum probability of edge for each cell state
that is displayed, which will only be used for
visualization. It can be a number between 0 and 1 or
"OTSU". When OTSU is selected, it will be
automatically estimated using OTSU's Method (OTSU,
1979). DEFAULT: "OTSU".
--Threshold_MaxOutDegree THRESHOLD_MAXOUTDEGREE
The maximum number of outdegrees for each cell state
that is displayed, which will only be used for
visualization. DEFAULT: 10.
--Threshold_MinCellNumofStates THRESHOLD_MINCELLNUMOFSTATES
The minimum cell number of each cell state that is
displayed, which will only be used for visualization.
DEFAULT: 0.
```
## Run CStreet in Python interface
CStreet can also be used step by step in the Python interface and easily integrated into custom scripts. [Here](https://nbviewer.jupyter.org/github/yw-Hua/CStreet/blob/master/tutorial.ipynb) is a tutorial written using [Jupyter Notebook](https://jupyter.org/).
## Supplementary Data&Code
All supplementary code and data, including cell type annotations, used to run the comparisons are available on [here](https://1drv.ms/u/s!Atc1l0sjoiRyhaxOqZYIGkgOyI3Lhg?e=bfhR9u).
The [Anndata h5ad file format](https://anndata.readthedocs.io/en/stable/index.html) is used to stored single-cell expression data and additional annotations in our supplementary file.
## Citation
Zhao C, Xiu W, Hua Y, Zhang N, Zhang Y. CStreet: a computed Cell State trajectory inference method for time-series single-cell RNA sequencing data. Bioinformatics (Oxford, England). 2021 Jul. DOI: 10.1093/bioinformatics/btab488.
%package help
Summary: Development documents and examples for cstreet
Provides: python3-cstreet-doc
%description help
# CStreet: a computed <ins>C</ins>ell <ins>S</ins>tate <ins>tr</ins>ajectory inf<ins>e</ins>r<ins>e</ins>nce method for <ins>t</ins>ime-series single-cell RNA-seq data
 
**| [Overview](#overview) | [Installation](#installation) | [Quick Start](#quick-start) | [Parameter Details](#parameter-details) | [Run CStreet in python interface](#run-cstreet-in-python-interface) | [Data&Code](#supplementary-datacode) | [Citation](#citation) |**

## Overview
CStreet is a cell state trajectory inference method for time-series single-cell RNA-seq data. It is written in Python (3.6, 3.7 or 3.8) and is available as a command line tool and a Python library to meet the needs of different users.
CStreet uses time-series information to construct the k-nearest neighbors connections within and between time points. Then, CStreet calculates the connection probabilities of cell states and visualizes the trajectory, which may include multiple starting points and paths, using a force-directed layout method.
## Installation
CStreet has been packaged and uploaded to [PyPI](https://pypi.org/project/cstreet/). Before your installation, ensure that you have pip available. pip3 is the package installer for Python. If you do not have pip3 on your machine, click [here](https://pip.pypa.io/en/stable/) to install it. Then, CStreet and its relevant packages can be installed using a single command.
```shell
$ pip3 install cstreet
```
You may experience errors when installing or updating packages. This is because pip3 will change the way that it resolves dependency conflicts. We recommend you use the command below.
```shell
$ pip3 install cstreet --use-feature=2020-resolver
```
You may need to use the command below to add the default installation path of pip3 to your system path,
```shell
$ export PATH=~/.local/bin:$PATH
```
Then, type the command below to check whether CStreet has been installed successfully.(For the first time running, it may takes about one minute for CStreet’s initial configuration.)
```shell
$ CStreet -h
```
## Quick Start
### Step 1. CStreet installation following the above tutorial.
### Step 2. Input preparation
CStreet utilizes time-series expression levels in tab-delimited format or AnnData format as input.
The cell state information can be generated using the built-in clustering function of CStreet or input by the user.
We provided a small [test dataset](https://github.com/yw-Hua/CStreet/tree/master/test/test_data) containing normalized expression levels and the state information at three time points.
Or type the command below to download.
```shell
$ wget https://github.com/yw-Hua/CStreet/raw/master/test/test_data.zip
$ unzip test_data.zip
```
### Step 3. Operation of CStreet
Type the command below to run CStreet.
```shell
$ CStreet -i test_data/ExpressionMatrix_t1.txt test_data/ExpressionMatrix_t2.txt test_data/ExpressionMatrix_t3.txt -s test_data/CellStates_t1.txt test_data/CellStates_t2.txt test_data/CellStates_t3.txt -n test
```
### Step 4. Output
The contents of the output directory in tree format will be displayed as described below, including the clustered cell state information if it is not provided by users, the connection probabilities of the cell states and a visualization of the inferred cell state trajectories.
```shell
PATH/ProjectName
├── ProjectName_CStreetTopology.pdf
├── ProjectName_CellStatesConnCytoscape.txt
├── SupplementaryFigures
│ ├── ProjectName_t1_ForceDirectedLayout.pdf
│ ├── ProjectName_t1_LouvainUMAPClustering.pdf
│ ├── ProjectName_t1_LouvainUMAPClusteringCoordinates.txt
│ ├── ProjectName_t2_ForceDirectedLayout.pdf
│ ├── ProjectName_t2_LouvainUMAPClustering.pdf
│ ├── ProjectName_t2_LouvainUMAPClusteringCoordinates.txt
│ └── ...
└── SupplementaryResults
├── ProjectName_BetweenTimePoints_CellStatesConnectionProbabilities.txt
├── ProjectName_t1_FilteredCellInfo.txt
├── ProjectName_t1_FilteredGeneInfo.txt
├── ProjectName_t1_CellStatesConnectionProbabilities.txt
├── ProjectName_t2_FilteredCellInfo.txt
├── ProjectName_t2_FilteredGeneInfo.txt
├── ProjectName_t2_CellStatesConnectionProbabilities.txt
└── ...
```

## Parameter Details
The parameter details of CStreet are as follows:
```
usage: CStreet [-h] <-i ExpMatrix1 ExpMatrix2 ExpMatrix3 ...> [-s CellStates1 CellStates2 CellStates3 ...] [-n ProjectName] [-o OutputDir] [options]
CStreet is a cell states trajectory inference method for time-series single-cell RNA-seq data.
optional arguments:
-h, --help show this help message and exit
-v, --version show version number of CStreet and exit
-i INPUT_EXPMATRIX [INPUT_EXPMATRIX ...], --Input_ExpMatrix INPUT_EXPMATRIX [INPUT_EXPMATRIX ...]
This indicates expression matrixes, which contain the
time-series expression level as read counts or
normalized values in tab-delimited format. For
example: '-i ExpressionMatrix_t1.txt
ExpressionMatrix_t2.txt ExpressionMatrix_t3.txt'
indicates the input of 3 timepoint expression
matrixes.
-T, --Input_CellinCol
This determines whether the expression level of one
cell is displayed as a column in the expression
matrixes. For example, '-T' indicates that the gene
expression levels of one cell are displayed in a
column and the expression levels of one gene across
all cells are displayed in a row.
-o OUTPUT_DIR, --Output_Dir OUTPUT_DIR
The project directory, which is used to save all
output files. DEFAULT: "./".
-n OUTPUT_NAME, --Output_Name OUTPUT_NAME
The project name, which is used to generate output
file names as a prefix. DEFAULT: "CStreet"
-s [INPUT_CELLSTATES [INPUT_CELLSTATES ...]], --Input_CellStates [INPUT_CELLSTATES [INPUT_CELLSTATES ...]]
An optional parameter that uses CStreet's built-in
dimensionality reduction and clustering methods to
perform clustering without knowing the cell states
(DEFAULT) or accepts the user’s input. The input files
should contain the cell state information sharing the
same cell ID in the expression matrixes in tab-
delimited format.
--CellClusterParam_PCAn CELLCLUSTERPARAM_PCAN
The number of principal components to use, which is
enabled only if the cell state information is not
provided. It can be set from 1 to the minimum
dimension size of the expression matrixes. DEFAULT:
10.
--CellClusterParam_k CELLCLUSTERPARAM_K
The number of nearest neighbors to be searched, which
is enabled only if the cell state information is not
provided. It should be in the range of 2 to 100 in
general. DEFAULT: 15.
--CellClusterParam_Resolution CELLCLUSTERPARAM_RESOLUTION
The resolution of the Louvain algorithm, which is
enabled only if the cell state information is not
provided. A higher resolution means that more and
smaller clusters are found. DEFAULT: 0.1.
--Switch_DeadCellFilter {ON,OFF}
The switch for the dead cell filter, which filters
cell outliers based on the count percent of
mitochondrial genes. DEFAULT: "ON".
--Threshold_MitoPercent THRESHOLD_MITOPERCENT
The maximum count percent of mitochondrial genes
needed for a cell to pass filtering, which is enabled
only if '--Switch_DeadCellFilter' is "ON". DEFAULT:
0.2.
--Switch_LowCellNumGeneFilter {ON,OFF}
The switch for the low cell number gene filter, which
retains genes that are expressed in at least a certain
number of cells. DEFAULT: "ON".
--Threshold_LowCellNum THRESHOLD_LOWCELLNUM
The minimum number of cells expressed that is required
for a gene to pass filtering, which is enabled only if
'--Switch_LowCellNumGeneFilter' is "ON". DEFAULT: 3.
--Switch_LowGeneCellsFilter {ON,OFF}
The switch for the low gene number cell filter, which
retains cells with at least a certain number of genes
expressed. DEFAULT: "ON".
--Threshold_LowGeneNum THRESHOLD_LOWGENENUM
The minimum number of genes expressed that is required
for a cell to pass filtering, which is enabled only if
'--Switch_LowGeneCellsFilter' is "ON". DEFAULT: 200.
--Switch_Normalize {ON,OFF}
The switch to enable total read count normalization
for each cell. DEFAULT: "ON".
--Threshold_NormalizeBase THRESHOLD_NORMALIZEBASE
The base of normalization, which is enabled only if '
--Switch_Normalize' is "ON". If the DEFAULT is chosen,
it is CPM normalization. DEFAULT: 1e6.
--Switch_LogTransform {ON,OFF}
The switch to logarithmize the expression matrix.
DEFAULT: "ON".
--KNNParam_metric KNNPARAM_METRIC
The distance metric to use for kNN. It can be set to
"euclidean" or "correlation". DEFAULT: "euclidean".
--WithinTimePointParam_PCAn WITHINTIMEPOINTPARAM_PCAN
The number of principal components to use within a
timepoint. It can be set from 1 to the minimum
dimension size of the expression matrixes. DEFAULT:
10.
--WithinTimePointParam_k WITHINTIMEPOINTPARAM_K
The number of nearest neighbors to be searched within
a timepoint. It should be in the range of 2 to 100 in
general. DEFAULT: 15.
--BetweenTimePointParam_PCAn BETWEENTIMEPOINTPARAM_PCAN
The number of principal components to use between
timepoints. It can be set from 1 to the minimum
dimension size of the expression matrixes. DEFAULT:
10.
--BetweenTimePointParam_k BETWEENTIMEPOINTPARAM_K
The number of nearest neighbors to be searched between
timepoints. It should be in the range of 2 to 100 in
general. DEFAULT: 15.
--ProbParam_SamplingSize PROBPARAM_SAMPLINGSIZE
The number of repeated sampling trials used to
estimate the connection probability. DEFAULT: 5.
--ProbParam_RandomSeed PROBPARAM_RANDOMSEED
The seed of repeated sampling trials used to estimate
the connection probability. DEFAULT: 0.
--FigureParam_FigureSize FIGUREPARAM_FIGURESIZE FIGUREPARAM_FIGURESIZE
Figure size of the result figure. For example: '--
FigureParam_FigureSize 6 7' indicates width is 6 and
height is 7. DEFAULT: 6 7.
--FigureParam_LabelBoxWidth FIGUREPARAM_LABELBOXWIDTH
The width of the label box in the result figure. For
example, '--FigureParam_LabelBoxWidth 10' means that
10 characters will be shown in the label box of the
resulting figure. DEFAULT: 10.
--Threshold_MinProbability THRESHOLD_MINPROBABILITY
The minimum probability of edge for each cell state
that is displayed, which will only be used for
visualization. It can be a number between 0 and 1 or
"OTSU". When OTSU is selected, it will be
automatically estimated using OTSU's Method (OTSU,
1979). DEFAULT: "OTSU".
--Threshold_MaxOutDegree THRESHOLD_MAXOUTDEGREE
The maximum number of outdegrees for each cell state
that is displayed, which will only be used for
visualization. DEFAULT: 10.
--Threshold_MinCellNumofStates THRESHOLD_MINCELLNUMOFSTATES
The minimum cell number of each cell state that is
displayed, which will only be used for visualization.
DEFAULT: 0.
```
## Run CStreet in Python interface
CStreet can also be used step by step in the Python interface and easily integrated into custom scripts. [Here](https://nbviewer.jupyter.org/github/yw-Hua/CStreet/blob/master/tutorial.ipynb) is a tutorial written using [Jupyter Notebook](https://jupyter.org/).
## Supplementary Data&Code
All supplementary code and data, including cell type annotations, used to run the comparisons are available on [here](https://1drv.ms/u/s!Atc1l0sjoiRyhaxOqZYIGkgOyI3Lhg?e=bfhR9u).
The [Anndata h5ad file format](https://anndata.readthedocs.io/en/stable/index.html) is used to stored single-cell expression data and additional annotations in our supplementary file.
## Citation
Zhao C, Xiu W, Hua Y, Zhang N, Zhang Y. CStreet: a computed Cell State trajectory inference method for time-series single-cell RNA sequencing data. Bioinformatics (Oxford, England). 2021 Jul. DOI: 10.1093/bioinformatics/btab488.
%prep
%autosetup -n cstreet-1.1.2
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-cstreet -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.2-1
- Package Spec generated
|