Skip to content

Commit f5cb124

Browse files
committed
uupdate examples
1 parent 0837b69 commit f5cb124

File tree

5 files changed

+10
-92
lines changed

5 files changed

+10
-92
lines changed

examples/compensate_example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import flowutils
33
import numpy
44

5-
fd = flowio.FlowData('example.fcs')
5+
fd = flowio.FlowData('fcs_files/100715.fcs')
66
spill, markers = flowutils.compensate.get_spill(fd.text['spill'])
77
events = numpy.reshape(fd.events, (-1, fd.channel_count))
88

examples/fabricate_fcs_file.py

+4-46
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,13 @@
33

44

55
if __name__ == '__main__':
6-
# these clusters have lots of overlap
7-
# cluster1 = np.random.multivariate_normal(
8-
# [60000.0, 6000.0, 600.0, 6.0],
9-
# [
10-
# [2000, 100, 10, 10],
11-
# [10, 5000, 10, 10],
12-
# [10, 10, 1000, 10],
13-
# [10, 10, 10, 1]
14-
# ],
15-
# (10000,)
16-
# )
17-
# cluster2 = np.random.multivariate_normal(
18-
# [-100.0, -5.0, 400.0, 4000.0],
19-
# [
20-
# [10, 100, 10, 10],
21-
# [10, 5, 10, 10],
22-
# [1000, 10, 50, 10],
23-
# [10, 10, 10, 5000]
24-
# ],
25-
# (10000,)
26-
# )
27-
# cluster3a = np.random.multivariate_normal(
28-
# [25000, 25000.0, 25000.0, 0],
29-
# [
30-
# [1000, 0, 0, 0],
31-
# [0, 1000, 0, 0],
32-
# [0, 0, 1000, 0],
33-
# [0, 0, 0, 1000]
34-
# ],
35-
# (10000,)
36-
# )
37-
# cluster3b = np.random.multivariate_normal(
38-
# [25000, 0, 25000.0, 25000.0],
39-
# [
40-
# [1000, 0, 0, 0],
41-
# [0, 1000, 0, 0],
42-
# [0, 0, 1000, 0],
43-
# [0, 0, 0, 1000]
44-
# ],
45-
# (10000,)
46-
# )
47-
486
np.random.seed(42)
497

508
# these clusters are clearly separated
519
cluster1 = np.random.multivariate_normal(
5210
[6000.0, 6000.0, 0.0, 3000.0],
5311
[
54-
[600000, 600000, 0, 0],
12+
[600000, 300, 0, 0],
5513
[300, 1000, 0, 0],
5614
[0, 0, 1, 10],
5715
[0, 0, 10, 1000]
@@ -113,9 +71,9 @@
11371
]
11472

11573
fh = open('data_set1.fcs', 'wb')
116-
create_fcs(data_set1, channel_names, fh)
74+
create_fcs(fh, data_set1, channel_names)
11775
fh.close()
11876

11977
fh = open('data_set2.fcs', 'wb')
120-
create_fcs(data_set2, channel_names, fh)
121-
fh.close()
78+
create_fcs(fh, data_set2, channel_names)
79+
fh.close()

examples/print_channels.py

-42
This file was deleted.

examples/read_fcs_file.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import flowio
22

3-
fd = flowio.FlowData('data_set1.fcs')
3+
fd = flowio.FlowData('fcs_files/data1.fcs')
44

55
print(len(fd.events))
6-
print(fd.text)
6+
print(fd.text)

examples/reshape_events.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import flowio
22
import numpy
33

4-
f = flowio.FlowData('001_F6901PRY_21_C1_C01.fcs')
4+
f = flowio.FlowData('fcs_files/data1.fcs')
55
n = numpy.reshape(f.events, (-1, f.channel_count))
6+
7+
print(n.shape)

0 commit comments

Comments
 (0)