Skip to content

Commit

Permalink
Fix for incorrect type return in annotation value selections. (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche authored Feb 1, 2024
1 parent e6d0658 commit 25ab4a9
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kana",
"description": "Single-cell data analysis in the browser",
"version": "3.0.21",
"version": "3.0.22",
"author": {
"name": "Jayaram Kancherla",
"email": "[email protected]",
Expand Down
7 changes: 7 additions & 0 deletions src/components/CellAnnotation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,13 @@ const CellAnnotation = (props) => {
props?.setSelectedCellAnnCluster(tmpselection);
setClusIdx(1);
} else {
// do the best
if (annotationObj[props?.selectedCellAnnAnnotation].values.constructor.name.includes("Float")) {
tmpselection = parseFloat(tmpselection)
} else if (annotationObj[props?.selectedCellAnnAnnotation].values.constructor.name.includes("Int")) {
tmpselection = parseInt(tmpselection)
}

props?.setSelectedCellAnnCluster(tmpselection);
setClusIdx(clusSel.map((x) => String(x)).indexOf(tmpselection));
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ExploreMode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ export function ExplorerMode() {
scranWorker.onmessage = (msg) => {
const payload = msg.data;

console.log("ON EXPLORE MAIN::RCV::", payload);
// console.log("ON EXPLORE MAIN::RCV::", payload);

// process any error messages
if (payload) {
Expand Down
14 changes: 14 additions & 0 deletions src/components/FeatureSets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,13 @@ const FeatureSetEnrichment = (props) => {
parseInt(tmpselection.replace("Cluster ", "")) - 1;
} else if (default_selection === props?.selectedFsetAnnotation) {
tmpselection = tmpselection.replace("Custom Selection ", "");
} else {
// do the best
if (annotationObj[props?.selectedFsetAnnotation].values.constructor.name.includes("Float")) {
tmpselection = parseFloat(tmpselection)
} else if (annotationObj[props?.selectedFsetAnnotation].values.constructor.name.includes("Int")) {
tmpselection = parseInt(tmpselection)
}
}

props?.setSelectedFsetCluster(tmpselection);
Expand Down Expand Up @@ -957,6 +964,13 @@ const FeatureSetEnrichment = (props) => {
"Custom Selection ",
""
);
} else {
// do the best
if (annotationObj[props?.selectedFsetAnnotation].values.constructor.name.includes("Float")) {
tmpselection = parseFloat(tmpselection)
} else if (annotationObj[props?.selectedFsetAnnotation].values.constructor.name.includes("Int")) {
tmpselection = parseInt(tmpselection)
}
}
props?.setSelectedFsetVSCluster(tmpselection);

Expand Down
14 changes: 14 additions & 0 deletions src/components/Markers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,13 @@ const MarkerPlot = (props) => {
default_selection === props?.selectedMarkerAnnotation
) {
tmpselection = tmpselection.replace("Custom Selection ", "");
} else {
// do the best
if (annotationObj[props?.selectedMarkerAnnotation].values.constructor.name.includes("Float")) {
tmpselection = parseFloat(tmpselection)
} else if (annotationObj[props?.selectedMarkerAnnotation].values.constructor.name.includes("Int")) {
tmpselection = parseInt(tmpselection)
}
}

props?.setSelectedCluster(tmpselection);
Expand Down Expand Up @@ -878,6 +885,13 @@ const MarkerPlot = (props) => {
"Custom Selection ",
""
);
} else {
// do the best
if (annotationObj[props?.selectedMarkerAnnotation].values.constructor.name.includes("Float")) {
tmpselection = parseFloat(tmpselection)
} else if (annotationObj[props?.selectedMarkerAnnotation].values.constructor.name.includes("Int")) {
tmpselection = parseInt(tmpselection)
}
}
props?.setSelectedVSCluster(tmpselection);

Expand Down
2 changes: 1 addition & 1 deletion src/workers/KanaDBHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ function remove_file(id, file_store, meta_store) {
};

request.onerror = event => {
console.log(event);
// console.log(event);
reject(new Error(`failed to retrieve file metadata ${id} from KanaDB: ${event.target.errorCode}`));
};
});
Expand Down

0 comments on commit 25ab4a9

Please sign in to comment.