@@ -51,36 +51,38 @@ ncols = 500 # Number of spots/cells
5151counts = np.random.rand(nrows, ncols)
5252
5353# Create feature annotations
54- row_data = BiocFrame({
55- " gene_ids" : [f " gene_ { i} " for i in range (nrows)],
56- " gene_names" : [f " Gene_ { i} " for i in range (nrows)]
57- })
54+ row_data = BiocFrame(
55+ {" gene_ids" : [f " gene_ { i} " for i in range (nrows)], " gene_names" : [f " Gene_ { i} " for i in range (nrows)]}
56+ )
5857
5958# Create spot/cell annotations
60- col_data = BiocFrame({
61- " n_genes" : [50 , 200 ] * int (ncols / 2 ),
62- " condition" : [" healthy" , " tumor" ] * int (ncols / 2 ),
63- " cell_id" : [f " spot_ { i} " for i in range (ncols)],
64- " sample_id" : [" sample_1" ] * int (ncols / 2 ) + [" sample_2" ] * int (ncols / 2 ),
65- })
59+ col_data = BiocFrame(
60+ {
61+ " n_genes" : [50 , 200 ] * int (ncols / 2 ),
62+ " condition" : [" healthy" , " tumor" ] * int (ncols / 2 ),
63+ " cell_id" : [f " spot_ { i} " for i in range (ncols)],
64+ " sample_id" : [" sample_1" ] * int (ncols / 2 ) + [" sample_2" ] * int (ncols / 2 ),
65+ }
66+ )
6667
6768# Generate spatial coordinates
68- spatial_coords = BiocFrame({
69- " x" : np.random.uniform(low = 0.0 , high = 100.0 , size = ncols),
70- " y" : np.random.uniform(low = 0.0 , high = 100.0 , size = ncols)
71- })
69+ spatial_coords = BiocFrame(
70+ {" x" : np.random.uniform(low = 0.0 , high = 100.0 , size = ncols), " y" : np.random.uniform(low = 0.0 , high = 100.0 , size = ncols)}
71+ )
7272
7373# Create image data
74- img_data = BiocFrame({
75- " sample_id" : [" sample_1" , " sample_1" , " sample_2" ],
76- " image_id" : [" aurora" , " dice" , " desert" ],
77- " data" : [
78- construct_spatial_image_class(" tests/images/sample_image1.jpg" ),
79- construct_spatial_image_class(" tests/images/sample_image2.png" ),
80- construct_spatial_image_class(" tests/images/sample_image3.jpg" ),
81- ],
82- " scale_factor" : [1 , 1 , 1 ],
83- })
74+ img_data = BiocFrame(
75+ {
76+ " sample_id" : [" sample_1" , " sample_1" , " sample_2" ],
77+ " image_id" : [" aurora" , " dice" , " desert" ],
78+ " data" : [
79+ construct_spatial_image_class(" tests/images/sample_image1.jpg" ),
80+ construct_spatial_image_class(" tests/images/sample_image2.png" ),
81+ construct_spatial_image_class(" tests/images/sample_image3.jpg" ),
82+ ],
83+ " scale_factor" : [1 , 1 , 1 ],
84+ }
85+ )
8486
8587# Create SpatialExperiment object
8688spe = SpatialExperiment(
0 commit comments