Skip to content

Commit 9ae12c2

Browse files
committed
Sort subsamples
1 parent 7dbfe70 commit 9ae12c2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

reconstruction/create_subsamples.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def subsampleCells(organisms):
9292
subsetSubsampleSize = round(args.proportion * len(matchingCellIndices))
9393
subsetSubsample = random.sample(matchingCellIndices, subsetSubsampleSize)
9494
subsample.extend(subsetSubsample)
95+
subsample.sort()
9596
subsamples.append(subsample)
9697
return subsamples
9798

@@ -107,6 +108,7 @@ def subsampleCells(organisms):
107108
organismSubsample.extend(treatmentSubsample)
108109
if args.organism:
109110
subsample = list(itertools.chain(*[organismCellMap[organism] for organism in organismSubsample]))
111+
subsample.sort()
110112
subsamples.append(subsample)
111113
elif args.bothOrganismsAndCells:
112114
# Now that we have a sample of the organisms, take a sample of each selected organism's cells within each cell type
@@ -131,6 +133,7 @@ def subsampleCells(organisms):
131133
treatmentSubsampleSize = round(args.proportion * len(treatmentOrganismIndices))
132134
treatmentSubsample = random.sample(treatmentOrganismIndices, treatmentSubsampleSize)
133135
subsample.extend(treatmentSubsample)
136+
subsample.sort()
134137
subsamples.append(subsample)
135138

136139
subsampleFile = open(args.subsampleFile, "w")

0 commit comments

Comments
 (0)