Skip to content

Commit

Permalink
uupdate examples
Browse files Browse the repository at this point in the history
  • Loading branch information
whitews committed Mar 23, 2022
1 parent 0837b69 commit f5cb124
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 92 deletions.
2 changes: 1 addition & 1 deletion examples/compensate_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import flowutils
import numpy

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

Expand Down
50 changes: 4 additions & 46 deletions examples/fabricate_fcs_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,13 @@


if __name__ == '__main__':
# these clusters have lots of overlap
# cluster1 = np.random.multivariate_normal(
# [60000.0, 6000.0, 600.0, 6.0],
# [
# [2000, 100, 10, 10],
# [10, 5000, 10, 10],
# [10, 10, 1000, 10],
# [10, 10, 10, 1]
# ],
# (10000,)
# )
# cluster2 = np.random.multivariate_normal(
# [-100.0, -5.0, 400.0, 4000.0],
# [
# [10, 100, 10, 10],
# [10, 5, 10, 10],
# [1000, 10, 50, 10],
# [10, 10, 10, 5000]
# ],
# (10000,)
# )
# cluster3a = np.random.multivariate_normal(
# [25000, 25000.0, 25000.0, 0],
# [
# [1000, 0, 0, 0],
# [0, 1000, 0, 0],
# [0, 0, 1000, 0],
# [0, 0, 0, 1000]
# ],
# (10000,)
# )
# cluster3b = np.random.multivariate_normal(
# [25000, 0, 25000.0, 25000.0],
# [
# [1000, 0, 0, 0],
# [0, 1000, 0, 0],
# [0, 0, 1000, 0],
# [0, 0, 0, 1000]
# ],
# (10000,)
# )

np.random.seed(42)

# these clusters are clearly separated
cluster1 = np.random.multivariate_normal(
[6000.0, 6000.0, 0.0, 3000.0],
[
[600000, 600000, 0, 0],
[600000, 300, 0, 0],
[300, 1000, 0, 0],
[0, 0, 1, 10],
[0, 0, 10, 1000]
Expand Down Expand Up @@ -113,9 +71,9 @@
]

fh = open('data_set1.fcs', 'wb')
create_fcs(data_set1, channel_names, fh)
create_fcs(fh, data_set1, channel_names)
fh.close()

fh = open('data_set2.fcs', 'wb')
create_fcs(data_set2, channel_names, fh)
fh.close()
create_fcs(fh, data_set2, channel_names)
fh.close()
42 changes: 0 additions & 42 deletions examples/print_channels.py

This file was deleted.

4 changes: 2 additions & 2 deletions examples/read_fcs_file.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import flowio

fd = flowio.FlowData('data_set1.fcs')
fd = flowio.FlowData('fcs_files/data1.fcs')

print(len(fd.events))
print(fd.text)
print(fd.text)
4 changes: 3 additions & 1 deletion examples/reshape_events.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import flowio
import numpy

f = flowio.FlowData('001_F6901PRY_21_C1_C01.fcs')
f = flowio.FlowData('fcs_files/data1.fcs')
n = numpy.reshape(f.events, (-1, f.channel_count))

print(n.shape)

0 comments on commit f5cb124

Please sign in to comment.