Files
openpipeline_spatial/src/convert/from_cosmx_to_spatialexperiment/script.R
CI 72b5c7c839 Build branch build/main with version build_main (280b21f)
Build pipeline: openpipelines-bio.openpipeline-spatial.build-main-6h5zv

Source commit: 280b21fc21

Source message: deploy: 6840f3802d04d96d44f29d3cdbd31c62d144b14d
2025-07-24 15:39:45 +00:00

35 lines
934 B
R

library(SpatialExperimentIO)
### VIASH START
par <- list(
input = "resources_test/cosmx/Lung5_Rep2_tiny",
add_tx_path = TRUE,
add_polygon_path = FALSE,
add_fov_positions = TRUE,
alternative_experiment_features = c("NegPrb", "Negative", "SystemControl", "FalseCode"),
output = "spe_cosmx_test.rds"
)
### VIASH END
if (par$add_polygon_path == FALSE & par$add_tx_path == FALSE) {
add_parquet_paths <- FALSE
} else {
add_parquet_paths <- TRUE
}
spe <- readCosmxSXE(
dirName = par$input,
returnType = "SPE",
countMatPattern = "exprMat_file.csv",
metaDataPattern = "metadata_file.csv",
coordNames = c("CenterX_global_px", "CenterY_global_px"),
addFovPos = par$add_fov_positions,
fovPosPattern = "fov_positions_file.csv",
addParquetPaths = add_parquet_paths,
addPolygon = par$add_polygon_path,
addTx = par$add_tx_path,
altExps = par$alternative_experiment_features
)
saveRDS(spe, file = par$output)