Skip to content

Commit 81d5c8d

Browse files
committed
fixed handling of bi-modal results
1 parent 1c86447 commit 81d5c8d

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

r_scripts/clustGating.r

+12-8
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,28 @@ clustGating = function(flowframe,
5151

5252
noclust = 1 # pretend there's only one cluster
5353

54-
if(nrow(subpop[[1]]@expr) >= min.cells) {
54+
if(nrow(subpop[[1]]@exprs) >= min.cells) {
5555
flowframe = subpop[[1]]
5656
} else {
5757
flowframe = subpop[[2]]
5858
}
5959
}
60-
}
61-
62-
63-
if (noclust == 1) {
64-
60+
} else {
6561
flowframe = Subset(flowframe, clust.fluo)
6662

67-
cat("In cluster: ", nrow(flowframe@exprs), "\n")
68-
6963
# skip if less than 10 measurements
7064
if(nrow(flowframe@exprs) <= min.cells) {
7165
return(error.data(well.name, fluo.channel, "Too few events in the one and only cluster after cluster gating (there were ", nrow(flowframe@exprs), " events, which is less than the minimum of ", min.cells, " events)."))
7266
}
67+
}
68+
69+
cat("Got here 1\n")
70+
71+
72+
if (noclust == 1) {
73+
cat("Got here 2b\n")
74+
75+
cat("In cluster: ", nrow(flowframe@exprs), "\n")
7376

7477
if (nrow(flowframe > 2)) {
7578
flowframe@description$"sw.p.value"=shapiro.test(flowframe@exprs[,fluo])$p.value
@@ -80,6 +83,7 @@ clustGating = function(flowframe,
8083
}
8184

8285
} else if (noclust == 2) {
86+
cat("Got here 2\n")
8387

8488
cat("In cluster 1: ", nrow(subpop[[1]]@exprs), "\n")
8589
cat("In cluster 2: ", nrow(subpop[[2]]@exprs), "\n")

test.rb

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
out_path = File.join(root_path, 'output')
1414
dump_file = File.join(out_path, 'out.dump')
1515

16+
if ARGV[0]
17+
replicate_path = File.expand_path(ARGV[0])
18+
end
19+
1620
# channels for the different wells
1721
channels = {
1822
'A01' => 'RED',

0 commit comments

Comments
 (0)