From 501c4f6dfc4be2c1a624bdeab5ffac9e8a7bd82c Mon Sep 17 00:00:00 2001 From: Yuuki Galaxy Date: Mon, 2 Dec 2024 17:05:09 +0800 Subject: [PATCH] modified: Makefile modified: SpatialOmicsCoord.py modified: src1/worker.c --- c_cpp/salusFstReCoord/Makefile | 4 ++-- c_cpp/salusFstReCoord/SpatialOmicsCoord.py | 7 ++++--- c_cpp/salusFstReCoord/src1/worker.c | 5 ++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/c_cpp/salusFstReCoord/Makefile b/c_cpp/salusFstReCoord/Makefile index dfc34978c..efcbff395 100644 --- a/c_cpp/salusFstReCoord/Makefile +++ b/c_cpp/salusFstReCoord/Makefile @@ -124,9 +124,9 @@ fmt: cmp: $(MKDIR_P) tmp - python3 SpatialOmicsCoord.py n.fq tmp 1 + python3 SpatialOmicsCoord.py n.fq tmp 1.25 $(ZCAT) tmp/newCoord_n.gz >t2.fq - ./$(BUILT_PROGRAMS) n.fq 1 >t1.fq + ./$(BUILT_PROGRAMS) n.fq 1.25 >t1.fq diff -Nau t1.fq t2.fq shasum t1.fq t2.fq diff --git a/c_cpp/salusFstReCoord/SpatialOmicsCoord.py b/c_cpp/salusFstReCoord/SpatialOmicsCoord.py index 42a878ce1..4516acee9 100755 --- a/c_cpp/salusFstReCoord/SpatialOmicsCoord.py +++ b/c_cpp/salusFstReCoord/SpatialOmicsCoord.py @@ -105,13 +105,14 @@ def coordTransfer(unZoomRate, fqFile, output, imageHeight, imageWidth, ratioHeig if pres[0][1] == '': splitSet = title.split("_") - unZoomRate = 1 + THEunZoomRate = 1 elif pres[0][1] == ':': splitSet = title.split(":") + THEunZoomRate = unZoomRate else: continue - pos_y = float(splitSet[-1]) / unZoomRate - pos_x = float(splitSet[-2]) / unZoomRate + pos_y = float(splitSet[-1]) / THEunZoomRate + pos_x = float(splitSet[-2]) / THEunZoomRate '''if int(fov[1:4]) == 1: min_x = 0 diff --git a/c_cpp/salusFstReCoord/src1/worker.c b/c_cpp/salusFstReCoord/src1/worker.c index 730a96277..d489db873 100644 --- a/c_cpp/salusFstReCoord/src1/worker.c +++ b/c_cpp/salusFstReCoord/src1/worker.c @@ -26,7 +26,8 @@ void worker(int_least16_t worker_id) { // char* readName = malloc(91); // for testing CHARsCPYSTR char readName[MAXFQIDLEN + 1] = {0}; // 81 => [0,80] char fovRC[9] = {0}; // R123C567 - double unZoomRatio = (double)Parameters.unZoomRatio; + double GIVENunZoomRatio = (double)Parameters.unZoomRatio; + double unZoomRatio = 0; for (uint64_t index = 0; index < JOBITEMSIZE; index++) { fstBCdata_t *fstBCdata_p = &worker->jobDatArray[index]; if (fstBCdata_p->name[0] == 0) { @@ -62,8 +63,10 @@ void worker(int_least16_t worker_id) { fstBCdata_p->fov_column = (uint8_t)(RowCol[1] = atoi(fovRC + 5)); if (unlikely(matches[1].rm_so == -1)) { delim = "_"; + unZoomRatio = 1.0; } else { delim = ":"; + unZoomRatio = GIVENunZoomRatio; } assert(relen == (delim[0] == ':' ? sizeof(fovRC) : sizeof(fovRC) - 1)); // printf("%llu\t[%s], delim:[%s], fov[%s]\n", index, readName, delim, fovRC); -- 2.11.4.GIT