Skip to content

Commit

Permalink
Merge pull request #3 from Mye-InfoBank/sera/issue_random_sample_size
Browse files Browse the repository at this point in the history
Sera/issue random sample size
  • Loading branch information
nictru authored Jun 2, 2024
2 parents 668716e + 3df6e48 commit 9ac5941
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ services:
dockerfile: Dockerfile
ports:
- 8080:8080
image: bigdatainbiomedicine/simba-qc:0.2.0
image: bigdatainbiomedicine/simba-qc:0.2.1
8 changes: 4 additions & 4 deletions src/sliders.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ def return_of_adata_meta():
@reactive.effect
def random_sample():
adata = _adata_qc.get()
sample_size = input['random_sample_size'].get()

if adata is None:
return

adata_sample = adata[np.random.choice(adata.obs.index, sample_size, replace=False)]

sample_size = input['random_sample_size'].get()

adata_sample = adata[np.random.choice(adata.obs.index, min(sample_size, len(adata.obs)), replace=False)]
_adata_sample.set(adata_sample)

@output
Expand Down

0 comments on commit 9ac5941

Please sign in to comment.